Skip to main content
POST
/
markets
/
creditbook
/
collateral
/
withdraw
Withdraw collateral
curl --request POST \
  --url https://tars.loopscale.com/v1/markets/creditbook/collateral/withdraw \
  --header 'Content-Type: application/json' \
  --header 'user-wallet: <user-wallet>' \
  --data '
{
  "loan": "<string>",
  "collateralMint": "<string>",
  "amount": 123,
  "collateralIndex": 123,
  "expectedLoanValues": {
    "expectedApy": 123,
    "expectedLqt": [
      123
    ]
  },
  "assetIndexGuidance": [
    123
  ]
}
'
{
  "message": "<string>",
  "signatures": [
    {
      "publicKey": "<string>",
      "signature": "<string>"
    }
  ]
}

Headers

user-wallet
string
required

Wallet address of the borrower withdrawing collateral.

payer
string

Optional fee payer. Defaults to user-wallet when omitted.

Body

application/json
loan
string
required
collateralMint
string
required
amount
number
required
collateralIndex
integer
required

Collateral slot index to withdraw from.

expectedLoanValues
object
required
assetIndexGuidance
integer[]

Optional oracle asset ordering hints used by Loopscale when validating a transaction.

Response

Serialized transaction for withdrawing collateral.

message
string
required

Base64-encoded versioned transaction message

signatures
object[]
required