API Reference HTTP API Exchange Operations Exchange: Open Build transactions to open new positions.
Alpha Version The Ostium Builder Service is in Alpha . API endpoints, specifications, and builder URLs may change without notice . Use with caution in production environments.
Builds unsigned transactions to open new trading positions.
Header Required Description X-Trader-AddressYes Trader wallet address. X-API-KeyNo Delegated mode (delegate wallet must be verified). Content-TypeYes application/json or text/plain (JSON string).
Field Type Required Description openOpenYes The open action. spnumberNo Slippage percentage (0-100). Default 0.25. Only applies to market orders — ignored for limit and stop (hardcoded to 0). bdBuilderConfigNo Optional builder fee configuration.
Field Type Required Description anumberYes Pair index. bbooleanYes Direction: true = long, false = short. tstringYes Open type: market, limit, stop. pstringYes Price as a numeric string (> 0). sstringYes Collateral in USD (min 5). lstringYes Leverage as a numeric string (>= 1). tpstringNo Take-profit price ("0" resets to default). slstringNo Stop-loss price ("0" resets to default).
Field Type Required Description bstringYes Builder address (0x...). fnumberYes Fee percentage (0-0.5).
tp and sl must be non-negative when provided.
For longs, tp must be above p and sl below p when they are > 0.
For shorts, tp must be below p and sl above p when they are > 0.
Field Type Required Description transactionsUnsignedTransaction[]Yes One unsigned transaction.
Field Type Required Description txHashstringYes Transaction hash of the delegated action. smartAccountAddressstringYes Smart account used for delegation.
curl -X POST https://builder.ostiscan.xyz/v1/exchange/open \
-H "Content-Type: application/json" \
-H "X-Trader-Address: 0xYourWallet" \
-d '{"open":{"a":0,"b":true,"p":"42500","s":"100","l":"10","t":"market"},"sp":0.25}'
{
"transactions" : [
{ "to" : "0x..." , "data" : "0x..." , "value" : "0" , "from" : "0xYourWallet" }
]
}
{
"txHash" : "0x..." ,
"smartAccountAddress" : "0x..."
}
See /docs/errors .