Appearance
Spot Calls
Calls on the spot module, submitted Borsh-encoded to the single Submit Transaction endpoint. Fields are listed in Borsh serialization order; see Encoding and Data Structures & Constants.
Create Spot Orderbook
spot.create_spot_orderbook
Create a new spot orderbook.
Protocol / admin operation.
| Field | Type | Required | Description |
|---|---|---|---|
base_token | TokenId | yes | The base token id for spot markets |
oracle_id | Option<OracleId> | no | Optional oracle id for pegged orders |
tick_size | uint64 | yes | The tick size of the orderbook. |
base_decimals | uint8 | yes | The decimal scale of the quantity of the orderbook. this should just be the decimals of the base token |
default_maker_fee_bps | uint16 | yes | The default maker fee in basis points |
default_taker_fee_bps | uint16 | yes | The default taker fee in basis points |
fee_recipient | EthereumAddress | yes | fee recipient |
base_lot_size | uint64 | yes | base lot size in base units. If we call the smallest possible of a token an atom. the base lot size is the number of atoms in a base lot. |
min_order_notional | Option<uint64> | no | Minimum order notional in quote lots. Orders below this value are rejected. 0 = disabled. |
Place Order
spot.place_order
Place an order.
| Field | Type | Required | Description |
|---|---|---|---|
owner | Option<EthereumAddress> | no | Optional owner when signed by a delegate |
subaccount_id | Option<SubAccountId> | no | The subaccount to place the order from (defaults to 0) |
market_id | MarketId | yes | The ID of the orderbook. |
side | Side | yes | The side of the order. |
order_type | OrderType | yes | The type of the order. |
order_fill_method | TimeInForce | yes | fill method |
price | Option<uint64> | no | The limit price of the order. None for market orders and pegged orders (use offset instead). For stop orders, this is the limit price at which the order will execute. |
quantity | uint64 | yes | The quantity of the order. |
client_order_id | ClientOrderId | yes | The optional client ID of the order. If client order id is provided it must be unique for each active order, or NULL |
offset | Option<uint8> | no | The optional price offset of the order for oracle peg orders |
max_price | Option<uint64> | no | Maximum price for pegged orders (price cap for buy, floor for sell) |
trigger_price | Option<uint64> | no | The optional trigger price of the order for stop orders |
parent | Option<ClientOrderId> | no | The optional parent order id of the order for OCO orders |
Place Oco Order
spot.place_oco_order
| Field | Type | Required | Description |
|---|---|---|---|
owner | Option<EthereumAddress> | no | Optional owner when signed by a delegate |
subaccount_id | Option<SubAccountId> | no | The subaccount to place orders from (defaults to 0) |
order_1 | PlaceOrderParams | yes | The first order |
order_2 | PlaceOrderParams | yes | The second order |
Place Multiple Orders
spot.place_multiple_orders
Place multiple orders.
| Field | Type | Required | Description |
|---|---|---|---|
owner | Option<EthereumAddress> | no | Optional owner when signed by a delegate |
subaccount_id | Option<SubAccountId> | no | The subaccount to place orders from (defaults to 0) |
orders | SafeVec_512_of_PlaceOrderParams | yes | The orders to place |
Modify Order
spot.modify_order
Modify an order. Cancels and replaces with a new order allowing to keep the same client order id.
| Field | Type | Required | Description |
|---|---|---|---|
owner | Option<EthereumAddress> | no | Optional owner when signed by a delegate |
subaccount_id | Option<SubAccountId> | no | The subaccount the order belongs to (defaults to 0) |
market_id | MarketId | yes | The new orderbook id. |
side | Side | yes | The new side of the order. |
order_type | OrderType | yes | The new type of the order. |
order_fill_method | TimeInForce | yes | fill method |
price | Option<uint64> | no | The new limit price. None for market/pegged orders. |
quantity | uint64 | yes | The quantity of the order. |
client_order_id | ClientOrderId | yes | The client ID of the order. |
offset | Option<uint8> | no | The optional price offset of the order for oracle peg orders |
max_price | Option<uint64> | no | Maximum price for pegged orders |
trigger_price | Option<uint64> | no | The optional trigger price of the order for stop orders |
parent | Option<ClientOrderId> | no | The optional parent order id of the order for OCO orders |
Cancel Order
spot.cancel_order
Cancel an order by client order ID.
| Field | Type | Required | Description |
|---|---|---|---|
owner | Option<EthereumAddress> | no | Optional owner when signed by a delegate |
subaccount_id | Option<SubAccountId> | no | The subaccount the order belongs to (defaults to 0) |
client_order_id | ClientOrderId | yes | The client ID of the order. |
Cancel Pegged Order If Beyond Max Price
spot.cancel_pegged_order_if_beyond_max_price
Cancel a pegged order if its effective price exceeds its max price.
| Field | Type | Required | Description |
|---|---|---|---|
owner | Option<EthereumAddress> | no | Optional owner when signed by a delegate |
subaccount_id | Option<SubAccountId> | no | The subaccount the order belongs to (defaults to 0) |
client_order_id | ClientOrderId | yes | The client ID of the order. |
Cancel All Orders
spot.cancel_all_orders
Cancel all orders for a user subaccount.
| Field | Type | Required | Description |
|---|---|---|---|
owner | Option<EthereumAddress> | no | Optional owner when signed by a delegate |
subaccount_id | Option<SubAccountId> | no | The subaccount to cancel all orders for (defaults to 0) |
Crank Stop Orders
spot.crank_stop_orders
Protocol / admin operation.
| Field | Type | Required | Description |
|---|---|---|---|
market_id | MarketId | yes |
Pause Market
spot.pause_market
Pause a spot market — blocks new orders and cranks, allows cancellations.
Protocol / admin operation.
| Field | Type | Required | Description |
|---|---|---|---|
market_id | MarketId | yes |
Unpause Market
spot.unpause_market
Unpause a previously paused spot market.
Protocol / admin operation.
| Field | Type | Required | Description |
|---|---|---|---|
market_id | MarketId | yes |
Update Spot Fee Recipient
spot.update_spot_fee_recipient
Update the fee recipient for a spot market (admin only)
Protocol / admin operation.
| Field | Type | Required | Description |
|---|---|---|---|
market_id | MarketId | yes | |
fee_recipient | EthereumAddress | yes |