Skip to main content
POST
/
markets
/
lending_vaults
/
withdraw
Vault withdraw
curl --request POST \
  --url https://tars.loopscale.com/v1/markets/lending_vaults/withdraw \
  --header 'Content-Type: application/json' \
  --header 'user-wallet: <user-wallet>' \
  --data '{
  "amountPrincipal": 123,
  "maxAmountLp": 123,
  "vault": "<string>",
  "withdrawAll": true
}'
{
  "transaction": {
    "message": "<string>",
    "signatures": [
      {
        "publicKey": "<string>",
        "signature": "<string>"
      }
    ]
  },
  "stakeAccount": "<string>"
}

Headers

user-wallet
string
required

Wallet address of the withdrawing user

Body

application/json
amountPrincipal
number
required

Amount of Principal tokens to withdraw (in lamports)

maxAmountLp
number
required

Maximum number of LP tokens you are willing to accept in exchange for your principal withdrawal, in the event vault loses value between quote and execution

vault
string
required

Lending vault address

withdrawAll
boolean

Set to true to withdraw all available principal (ignores amountPrincipal and maxAmountLp)

Response

Serialized transaction and update stake account

transaction
object
stakeAccount
string

Address of the stake account holding LP tokens (if >0)

I