Gas
Gas Principles
The following principles are the basis of Synchronicity’s Gas system.
- Users should never be aware of Gas.
- Gas on Synchronicity exists to prevent spam, not drive value to the Synchronicity token. (Note, the Synchronicity token will accrue value from matching (i.e., trading) fees.)
- Gas should be as cheap as possible.
Gas Token
The Synchronicity Gas token is a separate token from the Synchronicity token.
When an account has value bridged to Synchronicity but doesn’t have any Gas tokens, it is automatically given a small initial balance of Gas (~$0.01 worth, too little to grief the network of compute, but enough to cover ~2,500 order creations).
Additional Gas tokens are also distributed to an account for each $1 in volume it trades. Therefore, as long as a trader is doing a reasonable amount of volume compared to the number of computations they do, their account will never run out of Gas. If a user does run out of Gas Tokens, Synchronicity token can be converted into the gas token (but not the other way around) at some predefined, yet-to-be-determined, rate.
Gas Metering
Each operation has a Gas cost. Every time an operation occurs, the associated amount of Gas is charged to the payer. This is very similar to the EVM.
EVM and SVM code will meter gas internally as they traditionally do, which will be converted to SyncVM gas according to a defined conversion rate.
Gas Payments
The SyncVM differs from the EVM in that a gas payer can be programmatically changed in the middle of a transaction. This is useful in the context of synchronous execution, where the payer of the gas for a transaction that initiates a state transition may be different than the payer of the gas for the synchronous execution triggered by it.
Gas for Synchronous Execution
When synchronous execution is added to state, its creator specifies which account will pay the Gas associated and the total maximum gas to pay for it. The payer must prepay for the cancellation of the synchronous execution as an insurance mechanism for the instance where the payer runs out of gas. Of course, the creator of the synchronous execution must have permission to list another account as a gas payer.
Gas does not need to be locked up in association with a particular state or set of synchronous executions. Instead, it can be used across all synchronous executions the payer is paying for. When synchronous execution is run, Gas payments are debited from the payer’s account. If the payer runs out of gas tokens, then the synchronous execution is cancelled (which is already paid for).
Gas Price
To keep the cost of gas as low as possible, Synchronicity will have a minimum gas cost that is slightly above the cost to run Synchronicity (~$0.000004 for a create order). Gas costs on Synchronicity will be negligibly small relative to trading fees.
An EIP-1559 style mechanism will help process transactions fairly in the instance of network congestion.
Public Goods
All protocol level functionality such as clearance, funding rate calculations and the liquidation engine will be paid for by the enshrined Synchronicity Exchange account, which will be granted an infinite supply of gas tokens to process predefined operations for the functioning of the system.