Skip to main content
POST
/
positions
/
decrease
cURL
curl --request POST \
  --url https://lite-api.jup.ag/perps/v1/positions/decrease \
  --header 'Content-Type: application/json' \
  --data '{
  "collateralUsdDelta": "10000000",
  "desiredMint": "So11111111111111111111111111111111111111112",
  "entirePosition": false,
  "maxSlippageBps": "100",
  "positionPubkey": "5HHB8sCKjWPU2zr3p4Lg49mQiaPQiHbCjHW7jgVzp583",
  "sizeUsdDelta": "10000000"
}'
{
  "positionPubkey": "<string>",
  "positionRequestPubkey": "<string>",
  "quote": {
    "closeFeeUsd": "0.0063",
    "feeUsd": "0.0063",
    "leverage": "2.99",
    "liquidationPriceUsd": "13.24",
    "outstandingBorrowFeeUsd": "0.1000",
    "pnlAfterFees": "1045000",
    "pnlAfterFeesPercent": "-20.24",
    "pnlAfterFeesUsd": "10.45",
    "pnlBeforeFees": "1045000",
    "pnlBeforeFeesPercent": "20.24",
    "pnlBeforeFeesUsd": "10.45",
    "positionCollateralSizeUsd": "1124.45",
    "positionSizeUsd": "1124.45",
    "priceImpactFeeBps": "1.3301",
    "priceImpactFeeUsd": "1.3301",
    "side": "long",
    "transferTokenMint": "So11111111111111111111111111111111111111112",
    "transferAmountToken": "100000000",
    "transferAmountUsd": "1099.95"
  },
  "requireKeeperSignature": true,
  "serializedTxBase64": "<string>",
  "txMetadata": {
    "blockhash": "<string>",
    "lastValidBlockHeight": "<string>",
    "transactionFeeLamports": "0.5",
    "accountRentLamports": "0.5"
  }
}

Body

application/json
collateralUsdDelta
string
required

The amount of collateral to withdraw in USD from the position. Must be an integer representing the USD amount multiplied by 10^6 (1 million) to align with the 6 decimal places used for USDC/USDT tokens on-chain. For example, to decrease by $10 USD, set 'collateralUsdDelta' to 10000000; for $20.50 USD, set 'collateralUsdDelta' to 20500000.

Example:

"10000000"

desiredMint
enum<string>
required

The mint address for the token to be used when withdrawing collateral or closing position.

Available options:
So11111111111111111111111111111111111111112,
7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs,
3NZ9JMVBmGAqocybic2c7LQCJScmgsAZ6vQqTDzcqmJh,
EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v,
Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB
Example:

"So11111111111111111111111111111111111111112"

positionPubkey
string
required

The public key for the open position. Use the GET positions endpoint to fetch the public key for the trader's open positions.

Example:

"5HHB8sCKjWPU2zr3p4Lg49mQiaPQiHbCjHW7jgVzp583"

sizeUsdDelta
string
required

The amount in USD to decrease the position size by. Must be an integer representing the USD amount multiplied by 10^6 (1 million) to align with the 6 decimal places used for USDC/USDT tokens on-chain. For example, to decrease by $10 USD, set 'sizeUsdDelta' to 10000000; for $20.50 USD, set 'sizeUsdDelta' to 20500000.

Example:

"10000000"

entirePosition
boolean
default:false

When set to true, this will close the position and transfer the remaining collateral and realised profits (if the position is profitable) to the trader.

Example:

false

maxSlippageBps
string
default:200

The maximum slippage in (BPS) for the token swap (if required) and the token price when executing the increase position trade

Example:

"100"

Response

200 OK

positionPubkey
string
required

The unique identifier (i.e. a program derived address) for the position account. Use this address to find the position account onchain.

quote
object
required

The 'quote' object contains the position's updated values (leverage, size, collateral size, etc.) after withdrawing collateral.

serializedTxBase64
string
required

The serialized transaction (base64 encoded) containing the instructions and given parameters for the decrease position request. The transaction can be deserialized, signed by the owner of walletAddress and submitted onchain to execute the decrease position request

txMetadata
object
required

Contains relevant metadata for the serialized transaction.

positionRequestPubkey
string | null

The unique identifier (i.e. a program derived address) for the position request. Use this address to find the position request account onchain. Returns null if requireKeeperSignature is true.

requireKeeperSignature
boolean | null