pub async fn replace_order(
__arg0: State<AppState>,
signer_ctx: SignerContext,
__arg2: SonicJson<ReplaceOrderRequest>,
) -> Result<SonicJson<OrderUpdateMessage>, ApiError>Expand description
Atomically cancel an existing order and place a new one.
The old order is canceled first. If the cancel fails (order not found, already filled), the new order is NOT placed and the endpoint returns an error. If the cancel succeeds, the new order is placed in the same engine tick with no gap.