Skip to main content
POST
/
lending-stocks
/
api
/
positions
/
{marketId}
/
withdraw-collateral
curl -X POST "https://api.trusset.org/lending-stocks/api/positions/{marketId}/withdraw-collateral" \
  -H "X-API-Key: trusset_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"loanId": 5, "amount": "10", "useRelayer": true}'
{
  "success": true,
  "data": { "txHash": "0xabc...def", "loanId": 5, "amount": "10" }
}
Withdraws collateral from a loan. Reverts if the withdrawal would push the health factor below 1.0.

Path Parameters

marketId
string
required
Market ID.

Body Parameters

loanId
integer
required
On-chain loan ID.
amount
string
required
Stock tokens to withdraw.
signedPrice
object
Optional EIP-712 signed price.
useRelayer
boolean
default:"false"
Execute via relayer or return calldata.
curl -X POST "https://api.trusset.org/lending-stocks/api/positions/{marketId}/withdraw-collateral" \
  -H "X-API-Key: trusset_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"loanId": 5, "amount": "10", "useRelayer": true}'
{
  "success": true,
  "data": { "txHash": "0xabc...def", "loanId": 5, "amount": "10" }
}