OstiumBuilder Service
API ReferenceWebSocket APITrade Actions

WS Action: Open

Open positions via WebSocket.

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.

Action: open

Open new positions. The payload mirrors POST /v1/exchange/open.

Headers (in envelope)

HeaderRequiredDescription
X-Trader-AddressYesTrader wallet address.
X-API-KeyNoDelegated mode (delegate wallet must be verified).

Payload

FieldTypeRequiredDescription
openOpenYesThe open action.
spnumberNoSlippage percentage (0-100). Default 0.25. Only applies to market orders — ignored for limit and stop (hardcoded to 0).
bdBuilderConfigNoOptional builder fee configuration.

Open

FieldTypeRequiredDescription
anumberYesPair index.
bbooleanYesDirection: true = long, false = short.
tstringYesOpen type: market, limit, stop.
pstringYesPrice as numeric string (> 0).
sstringYesCollateral in USD (min 5).
lstringYesLeverage as numeric string (>= 1).
tpstringNoTake-profit price ("0" resets to default).
slstringNoStop-loss price ("0" resets to default).

BuilderConfig

FieldTypeRequiredDescription
bstringYesBuilder address (0x...).
fnumberYesFee percentage (0-0.5).

Constraints

  • Same as POST /v1/exchange/open.

Success Data (unsigned)

FieldTypeRequiredDescription
transactionsUnsignedTransaction[]YesOne unsigned transaction.

Delegated mode returns { "txHash", "smartAccountAddress" } as described in /docs/websocket/trade-actions.

Example

{
  "id": "1",
  "action": "open",
  "headers": { "X-Trader-Address": "0xYourWallet" },
  "payload": {
    "open": {"a":0,"b":true,"p":"42500","s":"100","l":"10","t":"market"},
    "sp": 0.25
  }
}

Success Response (unsigned)

{
  "id": "1",
  "ok": true,
  "data": {
    "transactions": [
      { "to": "0x...", "data": "0x...", "value": "0", "from": "0xYourWallet" }
    ]
  }
}

See /docs/http/exchange/open for HTTP details.

On this page