Method Name
private/replace_quote
private/replace_quoteCancel an existing quote with nonce or quote_id and create new quote with different quote_id in a single RPC call.
If the cancel fails, the new quote will not be created.
If the cancel succeeds but the new quote fails, the old quote will still be cancelled.
Required minimum session key permission level is admin
Parameters
| directionstringrequired Quote direction, buy means trading each leg at its direction, sell means trading each leg in the opposite direction.enum buysell |
| max_feestringrequired Max fee ($ for the full trade). Request will be rejected if the supplied max fee is below the estimated fee for this trade. |
| nonceintegerrequired Unique nonce defined as a concatenated UTC timestamp in ms and random number up to 6 digits (e.g. 1695836058725001, where 001 is the random number) |
| rfq_idstringrequired RFQ ID the quote is for |
| signaturestringrequired Ethereum signature of the quote |
| signature_expiry_secintegerrequired Unix timestamp in seconds. Expiry MUST be at least 310 seconds from now. Once time till signature expiry reaches 300 seconds, the quote will be considered expired. This buffer is meant to ensure the trade can settle on chain in case of a blockchain congestion. |
| signerstringrequired Owner wallet address or registered session key that signed the quote |
| subaccount_idintegerrequired Subaccount ID |
| legsarray of objectsrequired Quote legs |
| legs[].amountstringrequired Amount in units of the base |
| legs[].directionstringrequired Leg direction enum buysell |
| legs[].instrument_namestringrequired Instrument name |
| legs[].pricestringrequired Leg price |
| clientstring Optional client that sent the quote |
| labelstring Optional user-defined label for the quote |
| mmpboolean Whether the quote is tagged for market maker protections (default false) |
| nonce_to_cancelinteger Cancel quote by nonce (choose either quote_id or nonce). |
| quote_id_to_cancelstring Cancel quote by quote_id (choose either quote_id or nonce). |
Response
| idstring or integerrequired |
| resultobjectrequired |
| result.create_quote_errorobject or nullrequired Optional. Returns error during new quote creation |
| result.create_quote_error.codeintegerrequired |
| result.create_quote_error.messagestringrequired |
| result.create_quote_error.datastring or null |
| result.quoteobject or nullrequired New quote that was created |
| result.quote.cancel_reasonstringrequired Cancel reason, if any enum user_requestinsufficient_marginsigned_max_fee_too_lowmmp_triggercancel_on_disconnectsession_key_deregisteredsubaccount_withdrawnrfq_no_longer_opencompliance |
| result.quote.creation_timestampintegerrequired Creation timestamp in ms since Unix epoch |
| result.quote.directionstringrequired Quote direction enum buysell |
| result.quote.extra_feestringrequired Extra fee in USDC added by the referring client (included in quote fee) |
| result.quote.feestringrequired Fee paid for this quote (if executed) |
| result.quote.fill_pctstringrequired Percentage of the RFQ that this quote would fill, from 0 to 1. |
| result.quote.is_transferbooleanrequired Whether the order was generated through private/transfer_position |
| result.quote.labelstringrequired User-defined label, if any |
| result.quote.last_update_timestampintegerrequired Last update timestamp in ms since Unix epoch |
| result.quote.legs_hashstringrequired Hash of the legs of the best quote to be signed by the taker. |
| result.quote.liquidity_rolestringrequired Liquidity role enum makertaker |
| result.quote.max_feestringrequired Signed max fee |
| result.quote.mmpbooleanrequired Whether the quote is tagged for market maker protections (default false) |
| result.quote.nonceintegerrequired Nonce |
| result.quote.quote_idstringrequired Quote ID |
| result.quote.rfq_idstringrequired RFQ ID |
| result.quote.signaturestringrequired Ethereum signature of the quote |
| result.quote.signature_expiry_secintegerrequired Unix timestamp in seconds |
| result.quote.signerstringrequired Owner wallet address or registered session key that signed the quote |
| result.quote.statusstringrequired Status enum openfilledcancelledexpired |
| result.quote.subaccount_idintegerrequired Subaccount ID |
| result.quote.tx_hashstring or nullrequired Blockchain transaction hash (only for executed quotes) |
| result.quote.tx_statusstring or nullrequired Blockchain transaction status (only for executed quotes) enum requestedpendingsettledrevertedignoredtimed_out |
| result.quote.legsarray of objectsrequired Quote legs |
| result.quote.legs[].amountstringrequired Amount in units of the base |
| result.quote.legs[].directionstringrequired Leg direction enum buysell |
| result.quote.legs[].instrument_namestringrequired Instrument name |
| result.quote.legs[].pricestringrequired Leg price |
| result.cancelled_quoteobjectrequired Quote that was cancelled |
| result.cancelled_quote.cancel_reasonstringrequired Cancel reason, if any enum user_requestinsufficient_marginsigned_max_fee_too_lowmmp_triggercancel_on_disconnectsession_key_deregisteredsubaccount_withdrawnrfq_no_longer_opencompliance |
| result.cancelled_quote.creation_timestampintegerrequired Creation timestamp in ms since Unix epoch |
| result.cancelled_quote.directionstringrequired Quote direction enum buysell |
| result.cancelled_quote.extra_feestringrequired Extra fee in USDC added by the referring client (included in quote fee) |
| result.cancelled_quote.feestringrequired Fee paid for this quote (if executed) |
| result.cancelled_quote.fill_pctstringrequired Percentage of the RFQ that this quote would fill, from 0 to 1. |
| result.cancelled_quote.is_transferbooleanrequired Whether the order was generated through private/transfer_position |
| result.cancelled_quote.labelstringrequired User-defined label, if any |
| result.cancelled_quote.last_update_timestampintegerrequired Last update timestamp in ms since Unix epoch |
| result.cancelled_quote.legs_hashstringrequired Hash of the legs of the best quote to be signed by the taker. |
| result.cancelled_quote.liquidity_rolestringrequired Liquidity role enum makertaker |
| result.cancelled_quote.max_feestringrequired Signed max fee |
| result.cancelled_quote.mmpbooleanrequired Whether the quote is tagged for market maker protections (default false) |
| result.cancelled_quote.nonceintegerrequired Nonce |
| result.cancelled_quote.quote_idstringrequired Quote ID |
| result.cancelled_quote.rfq_idstringrequired RFQ ID |
| result.cancelled_quote.signaturestringrequired Ethereum signature of the quote |
| result.cancelled_quote.signature_expiry_secintegerrequired Unix timestamp in seconds |
| result.cancelled_quote.signerstringrequired Owner wallet address or registered session key that signed the quote |
| result.cancelled_quote.statusstringrequired Status enum openfilledcancelledexpired |
| result.cancelled_quote.subaccount_idintegerrequired Subaccount ID |
| result.cancelled_quote.tx_hashstring or nullrequired Blockchain transaction hash (only for executed quotes) |
| result.cancelled_quote.tx_statusstring or nullrequired Blockchain transaction status (only for executed quotes) enum requestedpendingsettledrevertedignoredtimed_out |
| result.cancelled_quote.legsarray of objectsrequired Quote legs |
| result.cancelled_quote.legs[].amountstringrequired Amount in units of the base |
| result.cancelled_quote.legs[].directionstringrequired Leg direction enum buysell |
| result.cancelled_quote.legs[].instrument_namestringrequired Instrument name |
| result.cancelled_quote.legs[].pricestringrequired Leg price |
Example
{request_example_shell}{request_example_javascript}{request_example_python}The above command returns JSON structured like this:
{response_example_json}