Skip to main content
PATCH
/
tpsl
cURL
curl --request PATCH \
  --url https://lite-api.jup.ag/perps/v1/tpsl \
  --header 'Content-Type: application/json' \
  --data '{
  "positionRequestPubkey": "5HHB8sCKjWPU2zr3p4Lg49mQiaPQiHbCjHW7jgVzp583",
  "triggerPrice": "20000000",
  "transactionType": "mixed"
}'
{
  "requireKeeperSignature": true,
  "serializedTxBase64": "<string>",
  "transactionType": "legacy",
  "txMetadata": {
    "blockhash": "<string>",
    "lastValidBlockHeight": "<string>",
    "transactionFeeLamports": "0.5",
    "accountRentLamports": "0.5"
  }
}

Body

application/json
positionRequestPubkey
string
required

The public key for the TP / SL request

Example:

"5HHB8sCKjWPU2zr3p4Lg49mQiaPQiHbCjHW7jgVzp583"

triggerPrice
string
required

Trigger price at which the TP / SL request will be executed. The value must be an integer corresponding to 6 decimal places. For example, to set a trigger price of $20, pass in 20000000

Example:

"20000000"

transactionType
enum<string>
default:mixed

Sets 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. If the transaction type is mixed, the transactionType returned in the response will be either legacy or instant.

Available options:
legacy,
mixed,
instant

Response

200 OK

requireKeeperSignature
boolean
required

When requireKeeperSignature is true, the transaction must be signed, serialized, and sent to the the POST /transaction/execute endpoint to execute the transaction. When requireKeeperSignature is false, the transaction can be submitted through the sendTransaction RPC call as usual

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

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:
legacy,
instant
txMetadata
object
required

Contains relevant metadata for the serialized transaction.