Skip to main content
POST
/
lending-stocks
/
api
/
positions
/
{marketId}
/
open-loan
curl -X POST "https://api.trusset.org/lending-stocks/api/positions/{marketId}/open-loan" \
  -H "X-API-Key: trusset_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "collateralAmount": "100",
    "borrowAmount": "5000",
    "useRelayer": true
  }'
{
  "success": true,
  "data": {
    "txHash": "0xabc...def",
    "loanId": "5",
    "collateralAmount": "100",
    "borrowAmount": "5000"
  }
}
Opens a new overcollateralized loan. The borrower deposits stock tokens as collateral and receives USDC. The maximum borrow amount is determined by the collateral value multiplied by the market’s collateral factor. Optionally pass a signedPrice from the Sign Price endpoint for an atomic price update.

Path Parameters

marketId
string
required
Market ID.

Body Parameters

collateralAmount
string
required
Stock tokens to post as collateral (18-decimal, e.g. "100").
borrowAmount
string
required
USDC to borrow (6-decimal, e.g. "5000").
signedPrice
object
Optional EIP-712 signed price from the /sign-price endpoint.
useRelayer
boolean
default:"false"
Execute via relayer or return calldata.
curl -X POST "https://api.trusset.org/lending-stocks/api/positions/{marketId}/open-loan" \
  -H "X-API-Key: trusset_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "collateralAmount": "100",
    "borrowAmount": "5000",
    "useRelayer": true
  }'
{
  "success": true,
  "data": {
    "txHash": "0xabc...def",
    "loanId": "5",
    "collateralAmount": "100",
    "borrowAmount": "5000"
  }
}