Trading operations let you manage orders directly over the WebSocket connection without making separate HTTP requests. Every trading operation message must carry a valid Ed25519 signature — the same signing scheme used for REST POST requests. TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/pacifica-fi/docs-migrate/llms.txt
Use this file to discover all available pages before exploring further.
signature, timestamp, and account fields are mandatory on every operation. See Authentication for a full walkthrough of how to construct a valid signature.
All WebSocket trading operations require Ed25519 signing. A missing or invalid signature causes the server to reject the request immediately. The Pacifica Python SDK provides ready-to-use helpers for building and signing each message type.
id (a UUID you choose to correlate responses) and a params object whose single key names the operation. The server echoes your id back in the response so you can match requests to replies.
Create Market Order
Places a market order for immediate execution at the best available price. Market orders are subject to a configurable slippage limit; orders that would exceed the limit are rejected rather than filled at a worse price.To protect liquidity providers from adverse selection, all market orders are subject to an approximately 200 ms delay before matching.
Client-defined request UUID. Echoed back in the response for correlation. Example:
660065de-8f32-46ad-ba1e-83c93d3e3966.User’s wallet address. Example:
42trU9A5....Agent wallet address, if submitting on behalf of an account via an agent. Example:
69trU9A5....Ed25519 cryptographic signature of the request payload. Example:
5j1Vy9Uq....Current Unix timestamp in milliseconds at the time of signing. Example:
1716200000000.Signature validity window in milliseconds after
timestamp. Requests arriving outside this window are rejected. Example: 30000.Trading pair symbol. Example:
BTC.When
true, the order will only reduce an existing position and will be rejected if no position exists.Order size in base token units. Example:
"0.001".Order side:
"bid" (buy / long) or "ask" (sell / short).Maximum acceptable slippage as a percentage.
"0.5" means the order will not fill if the price moves more than 0.5% from the mark price.Client-defined order UUID for tracking. Example:
79f948fd-7556-4066-a128-083f3ea49322.Builder program referral code. 3–16 alphanumeric characters. Example:
MYCODE.Optional take-profit stop order to attach to this position. Contains:
stop_price(string, required) — Trigger price.limit_price(string, optional) — Limit fill price for the triggered order.client_order_id(string, optional) — UUID for the stop order.trigger_price_type(string, optional) —mark_price(default),last_trade_price, ormid_price.
Optional stop-loss order to attach to this position. Contains:
stop_price(string, required) — Trigger price.limit_price(string, optional) — Limit fill price for the triggered order.client_order_id(string, optional) — UUID for the stop order.trigger_price_type(string, optional) —mark_price(default),last_trade_price, ormid_price.
HTTP-style status code.
200 indicates success.Client order ID (
client_order_id), if provided in the request.Exchange-assigned order ID.
Symbol.
Echoes the
id from your request.Server timestamp in milliseconds.
Operation type:
"create_market_order".Create Limit Order
Places a limit order on the order book at a specified price. Supports all standard time-in-force options.GTC and IOC limit orders are subject to an approximately 200 ms delay before matching to protect liquidity providers from adverse selection.
Client-defined request UUID. Echoed back in the response for correlation.
User’s wallet address.
Agent wallet address, if submitting via an agent.
Ed25519 cryptographic signature of the request payload.
Current Unix timestamp in milliseconds at the time of signing.
Signature validity window in milliseconds after
timestamp.Trading pair symbol. Example:
BTC.Limit price. Example:
"100000.00".When
true, the order will only reduce an existing position.Order size in base token units. Example:
"0.001".Order side:
"bid" (buy / long) or "ask" (sell / short).Time-in-force instruction:
GTC— Good Till CancelledIOC— Immediate or CancelALO— Add Liquidity Only (post-only)TOB— Top of Book
Client-defined order UUID for tracking.
Builder program referral code. 3–16 alphanumeric characters.
Optional take-profit stop order to attach. Contains:
stop_price(string, required) — Trigger price.limit_price(string, optional) — Limit fill price for the triggered order.client_order_id(string, optional) — UUID for the stop order.trigger_price_type(string, optional) —mark_price(default),last_trade_price, ormid_price.
Optional stop-loss order to attach. Contains:
stop_price(string, required) — Trigger price.limit_price(string, optional) — Limit fill price for the triggered order.client_order_id(string, optional) — UUID for the stop order.trigger_price_type(string, optional) —mark_price(default),last_trade_price, ormid_price.
HTTP-style status code.
200 indicates success.Client order ID, if provided in the request.
Exchange-assigned order ID.
Symbol.
Echoes the
id from your request.Server timestamp in milliseconds.
Operation type:
"create_order".Edit Order
Modifies the price and/or amount of an existing open order in a single request. Identify the order to edit by providing either its exchange-assignedorder_id or your client_order_id.
Editing an order cancels the original and creates a replacement. The new order retains the same side, reduce-only flag, and client order ID (if the original had one), but receives a new system-assigned order ID and is placed with TIF = ALO (post-only). Edit operations are not subject to the taker speed bump.
Client-defined request UUID. Echoed back in the response.
User’s wallet address.
Agent wallet address, if submitting via an agent.
Ed25519 cryptographic signature of the request payload.
Current Unix timestamp in milliseconds at the time of signing.
Signature validity window in milliseconds after
timestamp.Trading pair symbol. Example:
BTC.New limit price for the replacement order. Example:
"99500".New order size in base token units. Example:
"0.002".Exchange-assigned order ID of the order to edit. Required if
client_order_id is not provided.Client-defined order UUID of the order to edit. Required if
order_id is not provided.HTTP-style status code.
200 indicates success.Client order ID, if the original order had one.
New exchange-assigned order ID for the replacement order.
Symbol.
Echoes the
id from your request.Server timestamp in milliseconds.
Operation type:
"edit_order".Batch Orders
Submits multiple order operations in a single WebSocket message. Each action in the batch is individually signed and executed atomically in the order provided — if one action fails, subsequent actions are still attempted. The batch supports up to 10 actions per request. Each action has atype that maps to the corresponding standalone operation, and a data object with the same fields as that operation’s individual message.
Speed bump behaviour: A randomised 50–100 ms delay is applied to the entire batch if it contains any market orders (CreateMarket) or limit orders with TIF = GTC or IOC. The delay is not applied when the batch contains only ALO/TOB limit orders, cancel operations, or TP/SL operations.
Request
Client-defined request UUID. Echoed back in the response.
Array of up to 10 action objects. Each must contain:
type(string, required) — Action type (case-sensitive). One of:Create,CreateMarket,Cancel,Edit,SetPositionTpsl,CancelStopOrder.data(object, required) — Signed payload for the action. Fields are identical to the corresponding standalone operation.
HTTP-style status code.
200 = success, 400 = bad request, 500 = internal error.Per-action result objects. Each contains:
success(boolean) — Whether the individual action succeeded.order_id(integer) — Exchange-assigned order ID (for create/edit actions).client_order_id(string) — Client order ID, if provided.symbol(string) — Symbol for the action.
Echoes the
id from your request.Server timestamp in milliseconds.
Operation type:
"batch_orders".Cancel Order
Cancels a single open order. Identify the order to cancel by providing either its exchange-assignedorder_id or your client_order_id. Cancel requests are not subject to any speed bump.
Request
Client-defined request UUID. Echoed back in the response.
User’s wallet address.
Agent wallet address, if submitting via an agent.
Ed25519 cryptographic signature of the request payload.
Current Unix timestamp in milliseconds at the time of signing.
Signature validity window in milliseconds after
timestamp.Trading pair symbol. Example:
BTC.Exchange-assigned order ID. Required if
client_order_id is not provided.Client-defined order UUID. Required if
order_id is not provided.HTTP-style status code.
200 indicates success.Client order ID, if provided in the request.
Exchange order ID, or
null.Symbol.
Echoes the
id from your request.Server timestamp in milliseconds.
Operation type:
"cancel_order".Cancel All Orders
Cancels all open orders for an account in a single request. You can cancel across all symbols at once or restrict the cancellation to a specific symbol. Optionally exclude reduce-only orders from being cancelled. Cancel operations are not subject to any speed bump. RequestClient-defined request UUID. Echoed back in the response.
User’s wallet address.
Agent wallet address, if submitting via an agent.
Ed25519 cryptographic signature of the request payload.
Current Unix timestamp in milliseconds at the time of signing.
Signature validity window in milliseconds after
timestamp.Set
true to cancel orders across all markets. Set false and provide symbol to restrict cancellation to one market.Set
true to preserve reduce-only orders during the bulk cancel.Trading pair symbol to restrict cancellation to. Required when
all_symbols is false. Example: BTC.HTTP-style status code.
200 indicates success.Number of orders successfully cancelled.
Echoes the
id from your request.Server timestamp in milliseconds.
Operation type:
"cancel_all_orders".