Skip to main content
POST
/
lending-stocks
/
api
/
positions
/
{marketId}
/
close-loan
curl -X POST "https://api.trusset.org/lending-stocks/api/positions/{marketId}/close-loan" \
  -H "X-API-Key: trusset_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"loanId": 5, "useRelayer": true}'
{
  "success": true,
  "data": { "txHash": "0xabc...def", "loanId": 5 }
}
Closes a loan that has zero remaining debt and returns all collateral to the borrower. Reverts if any debt remains.

Path Parameters

marketId
string
required
Market ID.

Body Parameters

loanId
integer
required
On-chain loan ID.
useRelayer
boolean
default:"false"
Execute via relayer or return calldata.
curl -X POST "https://api.trusset.org/lending-stocks/api/positions/{marketId}/close-loan" \
  -H "X-API-Key: trusset_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"loanId": 5, "useRelayer": true}'
{
  "success": true,
  "data": { "txHash": "0xabc...def", "loanId": 5 }
}