Place TP/SL order

Create a Take Profit or Stop Loss order. Orders are stored off-chain and executed on-chain when the stop price condition is met.

Order Types:

  • TAKE_PROFIT: Triggers when price moves favorably (long: price >= stop_price, short: price <= stop_price)
  • STOP_LOSS: Triggers when price moves unfavorably (long: price <= stop_price, short: price >= stop_price)

Stop Price Options:

  • MARK_PRICE: Use oracle mark price for trigger
  • LAST_TRADED_PRICE: Use last traded price for trigger

Signature (required):
Sign EIP-712 typed data (same domain as regular orders) with primaryType PlaceTpslOrder:
fields: account(address), marketId(uint64), side(uint8), size(string), stopType(uint8), stopPrice(string), limitPrice(string), orderType(uint8), stopPriceOption(uint8), tif(uint8), deadline(uint32), sizePercentBps(uint32).
Use exact same string values in signature and request body.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params
string

Account address in hex format (0x...)

string

Market ID for the TPSL order

string
enum
Defaults to BUY
Allowed:
string

Order size in base asset (decimal string, e.g. "1.5" for 1.5 units)

string
enum
Defaults to TAKE_PROFIT
Allowed:
string
enum
Defaults to MARKET
Allowed:
string

Stop price that triggers the order (decimal string, e.g. "70000" for $70k)

string

Limit price for execution (decimal string), required for LIMIT orders

string
enum
Defaults to LAST_TRADED_PRICE
Allowed:
string
enum
Defaults to GTC
Allowed:
string

Signer address (session key) that signed this request

string

65-byte ECDSA signature (r+s+v) from signer over EIP-712 PlaceTpslOrder typed data

int64

Unix timestamp after which the signature expires

int64

Proportional size in basis points of the position (0..10000; 10000 = full position). 0 (default) = fixed size

Responses

Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json