Skip to main content

order_replace_to_derive_payload

Function order_replace_to_derive_payload 

Source
pub fn order_replace_to_derive_payload(
    order: &OrderAny,
    instrument: &DeriveInstrument,
    subaccount_id: u64,
    wallet: Address,
    signer: &PrivateKeySigner,
    nonce: u64,
    signature_expiry_sec: i64,
    module_address: Address,
    domain_separator: B256,
    action_typehash: B256,
    max_fee: Decimal,
    explicit_quantity: Option<Decimal>,
    explicit_price: Option<Decimal>,
    order_id_to_cancel: &str,
) -> Result<DeriveReplaceParams>
Expand description

Builds typed params for a signed private/replace request.

Derive’s replace endpoint atomically cancels a stale order and submits a new signed order. The new-order half is signed against TradeModuleData exactly like private/order.

§Errors

Returns an error when the order is not a Limit or Market order, when the instrument’s base_asset_address cannot be parsed, when decimal scaling fails, when a Market order has no explicit_price, or when EIP-712 signing fails.