Gas usage for transactions in StarkEx

Mint, Settlement and Transfer transactions have very low gas usage, as they take place entirely off-chain.

Other transaction types, while having off-chain steps in their execution, also take place on-chain. So while having minimal off-chain gas usage commensurate with the values listed below, these usage values are not significant when compared with their on-chain gas costs.

The gas usage values listed here per transaction type, for all transactions except Forced Withdrawal and Forced Trade, are estimates that assume fully optimized batches. These numbers give a very rough estimate of the actual gas usage per transaction. Real-world factors that can affect gas usage are not taken into account, so actual gas usage might vary.

The gas usage values listed here for Forced Withdrawal and Forced Trade are based on an average of several random transactions within a three month period leading up to February 28, 2023, for each type listed. These transactions were identified using L2Beat Explorer. These values are not a guarantee of future usage. Actual gas usage might vary.

Table 1. Gas cost per transaction type
Transaction type Gas usage per transaction
(Recursive proofs)
StarkEx Spot or Perpetual

Mint

28

StarkEx Spot

Settlement

71

StarkEx Spot

Trade

426

StarkEx Perpetual

Transfer

36

Both

Deposit

10000

Both

Withdrawal

31000

Both

Full Withdrawal

40000

StarkEx Spot

False Full Withdrawal

20000

StarkEx Spot

Conditional Transfer (fast withdrawal)

6000

Both

Forced Withdrawal

86,185

StarkEx Perpetual

Forced Trade

104,189

StarkEx Perpetual