fixed_gas_enabled is true. Check the parameter on the network where you submit the transaction. On Mainnet:
gasWanted) adds an estimated 120,000 gas for transaction checks to the exchange message gas. For multiple messages, budget for the sum of their message costs and the checks for the whole transaction. Simulate the exact transaction and leave headroom when setting the limit.
Binary options markets were removed in v1.21.0. Leave binary options fields empty when submitting MsgBatchUpdateOrders.
Single messages
Order creation values include the 12,000 gas charge for address order admission where applicable. Immediate atomic market orders use the base charge.
For a Good Till Block (GTB) limit order, apply the
1.1 multiplier to the base creation charge before adding the 12,000 admission charge. Use the post only base if applicable. For example, a regular spot GTB order uses 420,000 × 1.1 + 12,000 = 474,000 message gas. With the ante allowance, the suggested gas limit is 594,000.
Batch messages
For these estimates, allow 120,000 gas for transaction checks plus about 3,000 gas per listed order. Add the fixed message charge for each order.MsgBatchUpdateOrders
The v2 message has the following Go fields. Protobuf tags are omitted for readability.
Budget about 3,000 gas for transaction checks per explicit order or cancel all market ID.
Additional gas
- A permissionless token’s pre-send contract hook can charge additional gas to the transaction. Account for the hook separately because transaction simulation omits that charge in v1.21.0.
- Legacy
injective.exchange.v1beta1order, batch, and margin messages can incur extra market reads during conversion to v2. The release estimates about 1,700 gas per spot market read and 2,300 gas per derivative market read. - For calls from Solidity, estimate the full EVM transaction. The Exchange precompile uses exchange constants as part of its own gas accounting and can also charge for owner blacklist queries.
