Skip to content

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.

FieldTypeRequiredDescription
base_tokenTokenIdyesThe base token id for spot markets
oracle_idOption<OracleId>noOptional oracle id for pegged orders
tick_sizeuint64yesThe tick size of the orderbook.
base_decimalsuint8yesThe decimal scale of the quantity of the orderbook. this should just be the decimals of the base token
default_maker_fee_bpsuint16yesThe default maker fee in basis points
default_taker_fee_bpsuint16yesThe default taker fee in basis points
fee_recipientEthereumAddressyesfee recipient
base_lot_sizeuint64yesbase 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_notionalOption<uint64>noMinimum order notional in quote lots. Orders below this value are rejected. 0 = disabled.

Place Order

spot.place_order

Place an order.

FieldTypeRequiredDescription
ownerOption<EthereumAddress>noOptional owner when signed by a delegate
subaccount_idOption<SubAccountId>noThe subaccount to place the order from (defaults to 0)
market_idMarketIdyesThe ID of the orderbook.
sideSideyesThe side of the order.
order_typeOrderTypeyesThe type of the order.
order_fill_methodTimeInForceyesfill method
priceOption<uint64>noThe 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.
quantityuint64yesThe quantity of the order.
client_order_idClientOrderIdyesThe optional client ID of the order. If client order id is provided it must be unique for each active order, or NULL
offsetOption<uint8>noThe optional price offset of the order for oracle peg orders
max_priceOption<uint64>noMaximum price for pegged orders (price cap for buy, floor for sell)
trigger_priceOption<uint64>noThe optional trigger price of the order for stop orders
parentOption<ClientOrderId>noThe optional parent order id of the order for OCO orders

Place Oco Order

spot.place_oco_order

FieldTypeRequiredDescription
ownerOption<EthereumAddress>noOptional owner when signed by a delegate
subaccount_idOption<SubAccountId>noThe subaccount to place orders from (defaults to 0)
order_1PlaceOrderParamsyesThe first order
order_2PlaceOrderParamsyesThe second order

Place Multiple Orders

spot.place_multiple_orders

Place multiple orders.

FieldTypeRequiredDescription
ownerOption<EthereumAddress>noOptional owner when signed by a delegate
subaccount_idOption<SubAccountId>noThe subaccount to place orders from (defaults to 0)
ordersSafeVec_512_of_PlaceOrderParamsyesThe 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.

FieldTypeRequiredDescription
ownerOption<EthereumAddress>noOptional owner when signed by a delegate
subaccount_idOption<SubAccountId>noThe subaccount the order belongs to (defaults to 0)
market_idMarketIdyesThe new orderbook id.
sideSideyesThe new side of the order.
order_typeOrderTypeyesThe new type of the order.
order_fill_methodTimeInForceyesfill method
priceOption<uint64>noThe new limit price. None for market/pegged orders.
quantityuint64yesThe quantity of the order.
client_order_idClientOrderIdyesThe client ID of the order.
offsetOption<uint8>noThe optional price offset of the order for oracle peg orders
max_priceOption<uint64>noMaximum price for pegged orders
trigger_priceOption<uint64>noThe optional trigger price of the order for stop orders
parentOption<ClientOrderId>noThe optional parent order id of the order for OCO orders

Cancel Order

spot.cancel_order

Cancel an order by client order ID.

FieldTypeRequiredDescription
ownerOption<EthereumAddress>noOptional owner when signed by a delegate
subaccount_idOption<SubAccountId>noThe subaccount the order belongs to (defaults to 0)
client_order_idClientOrderIdyesThe 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.

FieldTypeRequiredDescription
ownerOption<EthereumAddress>noOptional owner when signed by a delegate
subaccount_idOption<SubAccountId>noThe subaccount the order belongs to (defaults to 0)
client_order_idClientOrderIdyesThe client ID of the order.

Cancel All Orders

spot.cancel_all_orders

Cancel all orders for a user subaccount.

FieldTypeRequiredDescription
ownerOption<EthereumAddress>noOptional owner when signed by a delegate
subaccount_idOption<SubAccountId>noThe subaccount to cancel all orders for (defaults to 0)

Crank Stop Orders

spot.crank_stop_orders

Protocol / admin operation.

FieldTypeRequiredDescription
market_idMarketIdyes

Pause Market

spot.pause_market

Pause a spot market — blocks new orders and cranks, allows cancellations.

Protocol / admin operation.

FieldTypeRequiredDescription
market_idMarketIdyes

Unpause Market

spot.unpause_market

Unpause a previously paused spot market.

Protocol / admin operation.

FieldTypeRequiredDescription
market_idMarketIdyes

Update Spot Fee Recipient

spot.update_spot_fee_recipient

Update the fee recipient for a spot market (admin only)

Protocol / admin operation.

FieldTypeRequiredDescription
market_idMarketIdyes
fee_recipientEthereumAddressyes