Skip to main content
POST
/
lending
/
pay-withdraw
cURL
curl --request POST \
  --url https://lite-api.jup.ag/perps/v1/lending/pay-withdraw \
  --header 'Content-Type: application/json' \
  --data '{
  "repayMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
  "repayTokenAmount": "<string>",
  "withdrawTokenAmount": "<string>",
  "walletAddress": "<string>"
}'
{
  "borrowSizeUsd": "<string>",
  "borrowSizeTokenAmount": "<string>",
  "borrowTokenMint": "<string>",
  "collateralTokenAmount": "<string>",
  "collateralTokenUsd": "<string>",
  "maxBorrowTokenAmount": "<string>",
  "maxBorrowUsd": "<string>",
  "maxWithdrawUsd": "<string>",
  "maxWithdrawTokenAmount": "<string>",
  "maxWithdrawTokenAmountBeforeWithdraw": "<string>",
  "maxRepayTokenAmount": "<string>",
  "liquidationPriceUsd": "<string>",
  "ltvBps": "<string>",
  "ltvPercentage": "<string>",
  "positionPubkey": "<string>",
  "serializedTxBase64": "<string>",
  "txMetadata": {
    "blockhash": "<string>",
    "lastValidBlockHeight": "<string>",
    "transactionFeeLamports": "0.5",
    "accountRentLamports": "0.5"
  },
  "requireKeeperSignature": true,
  "transactionType": "<string>"
}

Body

application/json
repayTokenAmount
string
required

Token amount to pay for the position's debt

withdrawTokenAmount
string
required

The JLP token amount to withdraw from the position

walletAddress
string
required

Public key for the wallet to pay / withdraw

repayMint
enum<string>
default:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v

Mint address for the payment token

Available options:
EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v

Response

200 OK

borrowSizeUsd
string
required

The borrowed amount (including interest) in USD formatted to 6 decimals as per the USDC mint

borrowSizeTokenAmount
string
required

The borrowed amount (including interest) in the token amount formatted to the borrowed token mint decimals

borrowTokenMint
string
required

The mint address for the borrowed token

collateralTokenAmount
string
required

Locked JLP token amount as collateral

collateralTokenUsd
string
required

Locked JLP token amount as collateral in USD formatted to 6 decimals as per the USDC mint

maxBorrowTokenAmount
string
required

Maximum borrow amount in the token amount formatted to the borrowed token mint decimals

maxBorrowUsd
string
required

Maximum borrow amount in USD formatted to 6 decimals as per the USDC mint

maxWithdrawUsd
string
required

The maximum withdrawable amount in USD formatted to 6 decimals as per the USDC mint

maxWithdrawTokenAmount
string
required

The maximum withdrawable JLP token amount

maxWithdrawTokenAmountBeforeWithdraw
string
required

The maximum withdrawable JLP token amount before repaying

maxRepayTokenAmount
string
required

The maximum repayable USDC token amount for this position

liquidationPriceUsd
string
required

The JLP price at which the borrow position will be liquidated in the token amount

ltvBps
string
required

LTV (loan-to-value) in basis points. A higher LTV express a higher risk of liquidation

ltvPercentage
string
required

LTV (loan-to-value) percentage. A higher LTV express a higher risk of liquidation

positionPubkey
string
required

Pubkey for the borrow lending position

serializedTxBase64
string | null
required

The serialized transaction (base64 encoded) containing the instructions and given parameters for the borrow / deposit request. The transaction can be deserialized, signed by the owner of walletAddress and submitted onchain.

txMetadata
object | null
required

Contains relevant metadata for the serialized transaction. Null if no wallet address passed in.

requireKeeperSignature
boolean
required

Whether this transaction requires a keeper signature

transactionType
string
required

The type of transaction

Allowed value: "legacy"