Skip to main content
POST
Which fields each operation needs, and which venue supports which: Perps.

Authorizations

x-api-key
string
header
required

Body

application/json

One body for every operation and venue. Fields an operation does not use are ignored. Always required: wallet, op, marketId, side, clientOrderId.

wallet
string
required

Fee payer, owner and only signer of the transaction (base58)

op
enum<string>
required
Available options:
open,
close,
tpsl,
cancel,
deposit,
withdraw,
limit,
update
marketId
string
required

<venue>:<SYMBOL>-PERP

Example:

"jupiter:SOL-PERP"

side
enum<string>
required

The position's side (buy/sell accepted). For close, tpsl, deposit, withdraw, cancel and update, the side of the existing position or order

Available options:
long,
short
clientOrderId
string
required

Your id, 1 to 64 bytes. Goes in the memo and derives the request/order address: use a new one per operation

Required string length: 1 - 64
collateralUsd
integer<int64>

open, limit (required): collateral in micro-USD

Required range: x >= 1
leverageBps
integer<int32>

open, limit (required): leverage in bps

Required range: x >= 10000
slippageBps
integer<int32>
default:50

Price band around the mark (around the trigger for limit; unused by tpsl) the keeper may execute at; the funding route's slippage; and how far the collateral may move from a routeTicket before 409

Required range: 0 <= x <= 9999
fundingMint
string

open, limit, deposit: what the wallet pays with; see /perp/quote

routeTicket
string

open, limit, deposit with a routed fundingMint: the funding.routeTicket of a /perp/quote. Without it the route is quoted again

closeBps
integer<int32>
default:10000

close, tpsl: share of the position, 10000 = all

Required range: 1 <= x <= 10000
trigger
enum<string>

tpsl (required). TP of a long and SL of a short must be above the mark, the other two below

Available options:
tp,
sl
triggerPriceE6
integer<int64>

limit, tpsl (required), update (optional): price × 10^6

Required range: x >= 1
orderId
string

cancel, update (required): the request/order address, from /perp/account orders[].orderId or a build's detail.request

amountUsd
integer<int64>

deposit, withdraw (required): micro-USD. update: the new size in micro-USD (how much a TP/SL closes, or a limit's notional)

Required range: x >= 1
serialize
boolean
default:false

Also return the unsigned transaction (transaction, lastValidBlockHeight)

transactionsFeeLamports
integer<int64>

Priority fee for the whole transaction in lamports (set in the serialized transaction's message)

txVersion
enum<integer>
default:1

Transaction format. Only v1 is served; 0 is refused

Available options:
1

Response

The operation, its accounts and its transaction

quoteId
string
required
buildId
string
required

Id of the built transaction (32 hex), joined with the landed transaction through the memo

op
string
required
marketId
string
required
venue
enum<string>
required
Available options:
jupiter,
gmtrade
side
enum<string>
required
Available options:
long,
short
atomic
object
required

What else this one transaction carries besides the order

detail
object
required

The accounts this operation creates or acts on

computeUnits
integer
required

Compute unit limit of the transaction (funding route + 300 000 on Jupiter, 400 000 on GMTrade)

loadedAccountsDataSize
integer
required

Bytes of accounts the transaction loads, declared in a v1 message

txVersion
enum<string>
required
Available options:
v1
instructions
object[]
required

In execution order. No ComputeBudget instruction: in v1 the limits are computeUnits and loadedAccountsDataSize, which you must set yourself if you assemble the transaction

addressLookupTableAddresses
string[]
required

Always empty

venueForm
string
required

How the venue executes the operation (by its keeper)

transaction
string

With serialize: the unsigned v1 transaction, base64. The wallet signs it

lastValidBlockHeight
integer<int64>

With serialize: the blockhash expires after this block height

quote
object

open and limit only: the numbers the order was built with

funding
object

Only with a routed fundingMint; routeTicket is not repeated here