Skip to main content
POST
/
tpsl-with-fee
cURL
curl --request POST \
  --url https://lite-api.jup.ag/perps/v1/tpsl-with-fee \
  --header 'Content-Type: application/json' \
  --data '{
  "feeReceiver": "<string>",
  "feeToken": "USDC",
  "feeTokenAmount": "1000000",
  "positionPubkey": "5HHB8sCKjWPU2zr3p4Lg49mQiaPQiHbCjHW7jgVzp583",
  "tpsl": [
    {
      "entirePosition": false,
      "receiveToken": "BTC",
      "requestType": "tp",
      "sizeUsdDelta": "10000000",
      "triggerPrice": "20000000"
    }
  ],
  "walletAddress": "<string>"
}'
{
  "integratorFeeTokenMint": "<string>",
  "integratorFeeTokenAmount": "<string>",
  "integratorFeeUsd": "<string>",
  "integratorFeeUsdFormatted": "<string>",
  "serializedTxBase64": "<string>",
  "tpslPubkeys": [
    "<string>"
  ],
  "transactionType": "instant",
  "txMetadata": {
    "accountRentLamports": "0",
    "blockhash": "<string>",
    "lastValidBlockHeight": "<string>",
    "transactionFeeLamports": "0.5"
  }
}

Body

application/json
feeReceiver
string
required

The token address (ATA) to receive the fee specified in feeTokenAmount. The ATA must match the token mint specified in feeToken

feeToken
enum<string>
required

The token symbol for the fee token. Currently only USDC is supported. Must be the same as input token.

Available options:
USDC
feeTokenAmount
string
required

The amount of fee tokens to send to feeReceiver. The value must match the token mint decimals specified in feeToken (e.g., for USDC with 6 decimals, 1000000 = 1 USDC)

Example:

"1000000"

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"

tpsl
object[]
required

TPSL requests to set

walletAddress
string
required

The wallet address / public key for the trader, Required when opening a new position.

Response

200 OK

integratorFeeTokenMint
string
required

The token mint for the integrator fee token

integratorFeeTokenAmount
string
required

The amount of the integrator fee token

integratorFeeUsd
string
required

The estimated integrator fee in USD (raw value with 6 decimal places)

integratorFeeUsdFormatted
string
required

The estimated integrator fee in USD (human-readable format)

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

tpslPubkeys
string[]
required

The position request account pubkeys for the TP / SL

transactionType
enum<string>
required

Returns the type of serialized transaction to execute the action. If the transaction type is legacy, the transaction must be submitted by the client itself through the RPC. If the transaction type is instant, the transaction must be sent to the POST /transaction/execute endpoint.

Available options:
instant
txMetadata
object
required

Contains relevant metadata for the serialized transaction.