Guides
Examples
Sample HTTP and WebSocket calls.
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.
Open Trade (HTTP)
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"}}'Close 50% (HTTP)
curl -X POST https://builder.ostiscan.xyz/v1/exchange/close \
-H "Content-Type: application/json" \
-H "X-Trader-Address: 0xYourWallet" \
-d '{"closes":[{"a":0,"t":0,"p":"43000","r":50}],"sp":0.25}'Modify TP (HTTP)
curl -X POST https://builder.ostiscan.xyz/v1/exchange/modify \
-H "Content-Type: application/json" \
-H "X-Trader-Address: 0xYourWallet" \
-d '{"a":0,"i":0,"tp":"46000"}'Remove Margin (HTTP)
curl -X POST https://builder.ostiscan.xyz/v1/exchange/margin \
-H "Content-Type: application/json" \
-H "X-Trader-Address: 0xYourWallet" \
-d '{"a":0,"i":0,"amount":"-25"}'Create Delegate Wallet (HTTP)
curl -X POST https://builder.ostiscan.xyz/v1/auth/create \
-H "X-Trader-Address: 0xYourWallet"Verify Delegate Wallet (HTTP)
curl -X POST https://builder.ostiscan.xyz/v1/auth/verify-auth \
-H "Content-Type: application/json" \
-H "X-Trader-Address: 0xYourWallet" \
-H "X-API-Key: <apiKey>" \
-d '{}'Delegated Open (HTTP)
curl -X POST https://builder.ostiscan.xyz/v1/exchange/open \
-H "Content-Type: application/json" \
-H "X-Trader-Address: 0xYourWallet" \
-H "X-API-Key: <apiKey>" \
-d '{"open":{"a":0,"b":true,"p":"42500","s":"100","l":"10","t":"market"}}'Trade Action (WebSocket)
wscat -c wss://builder.ostiscan.xyz/v1/exchange/ws
> {"id":"1","action":"open","headers":{"X-Trader-Address":"0xYourWallet"},"payload":{"open":{"a":0,"b":true,"p":"42500","s":"100","l":"10","t":"market"}}}