Skip to main content

estimateGasOfOrders

Submits an array of orders to the node to estimate the required gas fee for each order (paid in max_extra_fee_asset0). The node returns an array of objects, each containing the computed gas units and the gas fee value.

Note: As with estimateGas, the gas fee is expressed as a fixed value in gwei. Future updates may adjust this metric to better reflect actual gas usage.

Parameters

ParameterTypeDescription
is_bookboolIs the gas for a book order or a top of block order.
is_internalboolIs the order going to use deposited tokens to trade.
token_0Addressthe quote asset of the pair wanted to be traded.
token_1Addressthe base asset of the pair wanted to be traded.

Result

Array<{ "Ok": ["0x23123", 232342] | "Err": msg }> — Returns an internal status containing:

  • Ok: The request was successful, gives the amount of gas in token0 needed to be included in the next block.
  • Err: Internal message explaining failure.

Code Sample

 curl "NODE_URL" -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 0,
"method": "angstrom_estimateGasOfOrders",
"params": [
{
true, false, "0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14", "0x1c7d4b196cb0c7b01d743fbc6116a902379c7238" ,
},
{
true, true, "0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14", "0x1c7d4b196cb0c7b01d743fbc6116a902379c7238" ,
}
]
}
'

Response

{
"jsonrpc": "2.0",
"id": "0",
"result": [
{
"Ok": ["0x7f6f8", 23027061]
},
{
"Ok": ["0xa16f8", 23027061]
}
]
}