Skip to main content
POST
/
lending-stocks
/
api
/
markets
/
{marketId}
/
sign-price
curl -X POST "https://api.trusset.org/lending-stocks/api/markets/{marketId}/sign-price" \
  -H "X-API-Key: trusset_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"price": 186.25, "validitySeconds": 300}'
{
  "success": true,
  "data": {
    "price": "186250000",
    "priceUsd": "186.25",
    "timestamp": 1718445600,
    "validUntil": 1718445900,
    "signature": "0xabc...def",
    "signer": "0x123...456"
  }
}
Returns a signed price message that can be passed to openLoan, withdrawCollateral, or borrowMore on the smart contract. The borrower submits the signed price alongside their transaction, allowing atomic price updates without requiring the relayer to submit a separate transaction.

Path Parameters

marketId
string
required
Market ID.

Body Parameters

price
number
Price in USD. If omitted, fetched from the configured feed.
validitySeconds
integer
default:"300"
How long the signature remains valid. Min 60, max 3600.
curl -X POST "https://api.trusset.org/lending-stocks/api/markets/{marketId}/sign-price" \
  -H "X-API-Key: trusset_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"price": 186.25, "validitySeconds": 300}'
{
  "success": true,
  "data": {
    "price": "186250000",
    "priceUsd": "186.25",
    "timestamp": 1718445600,
    "validUntil": 1718445900,
    "signature": "0xabc...def",
    "signer": "0x123...456"
  }
}