Deep Dive: Sui Reference Gas Price

May 8, 2023
After an extensive Testnet consisting of three waves, Mysten Labs announced that Sui will be launching publicly on May 3rd, 2023. To get up to speed on Sui, feel free to check out Sui tokenomics, our First look and Figment Capital’s Testnet reports.

Sui has created a gas-pricing system that benefits both users and validators. Validators agree on a network-wide reference price at the start of each epoch, which serves as a reliable anchor for users. The system also rewards good validator behavior, creating a mutually beneficial relationship between SUI token holders, validators, and Sui network end users.

As part of their participation on the network, Sui validators are required to calculate a Reference Gas Price (RGP) quote on the basis of a number of inputs that can be gathered both on-chain and off-chain. These inputs include: Gas units executed per epoch, Staking Rewards each epoch, storage fund share, storage fund recapitalization, etc. Following public launch, the inputs required and the necessary calculations will be manually referenced and calculated, then steadily automated over time as their sources become available.

Process and assumptions:

We will need to build a number of data pipelines and potential automation layers in order to calculate for our suggested RGP, which will then inform the network-wide gas price and, in turn, affect our rewards on the network. As mentioned above, these inputs include, but are not limited to, Gas units executed per epoch, Stake Rewards each epoch, storage fund share, and storage fund recapitalization.

A number of these data sources necessary to calculate the RGP are not available until the chain moves from technical launch to Sui Public Mainnet on May 3rd. Eventually, the goal will be to automate more of the calculations for the RGP as the process becomes repeatable.

Automation to post the value through a CLI (Command Line Interface) script from our validator will be triggered before the end of each Epoch (~24hrs) on a recurring basis, with parameters requiring that it be adjusted either:

a) once a week based on historical data; or

b) any time there is a fluctuation in the SUI token price of +/- 20%.

Section 1: The Reference Gas Price Mechanism

Sui has created a gas-pricing system that benefits both users and validators. Validators agree on a network-wide reference price at the start of each epoch, which serves as a reliable anchor for users. The system also rewards good validator behavior, creating a mutually beneficial relationship between SUI token holders, validators, and Sui network end users.

The Sui network operates on a single reference price throughout each epoch, which is updated by the network’s validators at the end of each epoch (24 hrs.). Sui uses a Gas Price Survey to determine the RGP for transaction processing on the network. At the start of each epoch, validators submit their Gas Price Quote, which is the minimum gas price they will accept for processing transactions. This price also determines a validator’s rate for working for the network aka the rewards generated from processing transactions. These Gas Price Quotes are then ordered, and the 2/3 percentile of a Gas Price Survey by stake is chosen as the reference price. The goal of this survey is to set a reference price that a majority of validators are willing to accept for processing transactions. 

According to the most recent updates from Mysten Labs, validators who hold Staked Tokens on the Sui network must participate in the gas price survey by updating their Gas Price Quote at least once a week.

If there is a significant change in the value of the SUI token, such as a 20% or greater fluctuation, the validator must update their Gas Price Quote immediately. This ensures that the Gas Price Survey accurately reflects the current market conditions and helps to maintain a stable and reliable network.

Section 2: Establishing Values and Formulae

Total Gas units Executed by Validator- how to calculate for cost: 

The total cost to operate on Sui can be calculated by determining the product of the total number of gas units executed during an epoch and the marginal cost per gas unit per epoch. The formula would look something like this, and the value will be (for now) pulled through a CLI command:

 $ Total Cost in Epoch e = (Gas Units Executed in Epoch e) * (Cost in $ per Gas Unit in Epoch e)

Stake rewards: 

In order to calculate staking rewards in any given epoch, we must determine the product or stake subsidies and the Sui token price in that epoch. This is represented as the following:

$Total Rewards in Epoch e = (Stake Rewards in Epoch e) * (SUI Token Price in Epoch e)

Net Rewards: 

To calculate net validator rewards, a simple formula is provided by Mysten labs:

$ Net Rewards  in Epoch e = ($ Total Rewards in Epoch e) – ($ Total Cost in Epoch e)

To determine the missing values in the above formulas above we can utilize the calculations below:

$ Total Rewards in Epoch e = Stake Subsidies in Epoch e + Gas Fees in Epoch e

Note: stake/validator subsidies(1)  are determined programmatically and there is no way for a validator to influence them. In contrast, gas fees are equal to the sum of gas paid by all transactions throughout that epoch. 

Validator Gas fees in Epoch e = (gas units executed in epoch e) * (Reference Gas Price)

Given the above, we can deduce the following:

$ Total Rewards in Epoch e= [Stake Subsidies in Epoch e + (Gas units executed in Epoch e * Reference gas price )] *(Sui Token Price in epoch e)]

To keep things simple, we will be using the formula above for our purposes.

To calculate total validator and delegator rewards (rewards we keep) we would first need to establish and pull initial values. These are represented in the table below:

* All marked values are specific to each validator. Values not marked are ones provided by Mysten Labs. 

To calculate our rewards each epoch the formula would be as follows:

Validator Rewards =[e {d + c (1-d)} *b * c + (1-a) (V/N) ] * Total Network Stake Rewards

Delegator Rewards =[a(1-c)(1-d)] * b * c * Total Network Stake Rewards

Lastly, to calculate rewards at any given RGP quote the formula is as follows:

Rewards at Quote= (validator multiplier)*(Sui Token Price) *(RGP)*(Executed Gas Units)

This would translate into:

$ Net Rewards at Quote= $Rewards at Quote – $Costs

Note: The $Costs represented above would be representative of our costs for operating on Sui per epoch.

Lastly, to calculate the Storage Fund Share we will utilize the following formula:

Storage Fund Share= Total Stake / (Storage Fund + Total Stake)

Section 3: How to calculate Net Rewards

Before we dive into the calculations it is worth clarifying that the calculations provided by Mysten Labs are meant to calculate Net Rewards rather than a Gas Price Quote. Therefore, the desired outcome for these calculations is to project Net Rewards rather than suggest a Gas Price Quote.

Step 1: Calculate Cost

Calculate Total Validator cost using the following formula:

 $ Total Cost in Epoch e = (Gas Units Executed in Epoch e) * (Cost in $ per Gas Unit in Epoch e)

To calculate(Cost in $ per Gas Unit in Epoch e), we would need to use the following:

 Cost in $ per Gas Unit in Epoch e = Cost in $ Per Epoch / Total Gas units executed in Epoch e  

Note: Accurate number of Gas Units executed will not be available until the public launch of Mainnet as there will not be enough activity to collect accurate values before that. 

Step 2: Calculate Rewards 

To calculate our overall validator rewards we will use the the following:

Validator Rewards =[e {d + c (1-d)} *b * c + (1-a) (V/N) ] * Total Network Stake Rewards

The representations of all characters can be seen in Table 2.1. The only values unknown in the formula above are “V”, “e” and the Total Network Stake Rewards. Once we have obtained these values from Mysten Labs and/or on-chain activity, we will be able to calculate validator rewards.

In order to see our rewards at a specific Gas Price Quote we can use the formula below:

Rewards at Quote= (validator multiplier)*(Sui Token Price) *(RGP)*(Executed Gas Units)

All the variables above are currently unknown, therefore we will not be able to make an estimate until after the public launch of Mainnet.

Step 3: Calculate Rewards

By using the formula below we can determine Net Rewards at a given Gas Price Quote at any given time:

$ Net Rewards= $Rewards at Quote – $Costs

Figment’s Approach to SUI Reference Gas Price

The RGP plays an important role in incentivization on Sui and has a direct impact on staking rewards. From a validator’s perspective, there is an incentive to set lower RGP than other validators, as doing so would provide a greater than average chance of said validator being selected to process transactions and receive greater than average rewards. However, setting the RGP too low could result in unsustainable operations. As a result, it is critical that each validator on SUI sets RGP in a way that comports with its desired outcomes.

The formula for calculating optimal RGP was determined by Mysten Labs when designing the tokenomics of SUI, and is a straightforward process. However, many of the variables involved in the calculation will not be known at Mainnet launch. As a result, SUI has notified validators that RGP will be set to 1,000 until 1-2 weeks post-Mainnet launch. This will give validators a sufficient operating timeframe to gauge network activity and establish a process and cadence for setting RGP.

Our Protocol, Data, and DevOps Teams have a cross-functional task force that understands the importance of RGP in the context of SUI’s tokenomics and is working on both interim (Mainnet launch – 6 months) and long-term processes for monitoring and adjusting RGP as necessary to achieve our desired outcomes. From a technical perspective, this will involve building automated data ingestion pipelines for each of the elements of the calculation (each of which has been defined and sourced), monitoring and alerting tools to escalate visibility and action when anomalies or long-term shifts have been detected, and automating the submission of RGP through SUI’s Client CLI. We are confident that our approach to RGP will enable us to achieve our desired outcomes while reducing the effort required to manage it.

(1) –  Validator subsidies: The Foundation has set aside a substantial amount of tokens to subsidize stake rewards in the network’s early innings. This is to compensate for potentially low rewards validators may face due to low network activity.

(2) – Percentage of self bond.

(3) – For now fixed, but governance can change. Source provides a count.

(4) – Rate at which storage fund is refunded. Mysten Labs will communicate this eventually.

Sui FAQ:

Could Epoch length change? 

Only through a Governance vote.

How do you adapt to account for a 20% increase or decrease?

IF there is no adjustment to the token price, then the RGP is decided on a trailing price action over the last 10 days and the gas price over the same period

IF there IS an adjustment to the token price over the last 24 hours, then the RGP is adjusted to the last token price at the end of the last epoch.

Where are we obtaining all the data necessary for the calculation?
We obtain data from a number of different sources, including: (i) the chain directly (e.g. epoch duration), (ii) other sources we had to build from indirect channels for (e.g. token price), and (iii) our own data team (e.g., opex and yearly maintenance cost).

What happens if our strategy changes?

In case we need to pivot to another strategy in order to accrue more rewards in the network, we’ll run all numbers again and follow the method established above – any impact that might have in our monitoring and maintenance processes will be dutifully reflected in this document, as well as the one geared towards clients.

When are staking rewards enabled? When are transfers enabled?

Rewards and transfers will be live upon public launch of Mainnet (May 3rd).

Why stake SUI?

Initially, the SUI is being staked to earn new issuance (“inflationary”) subsidies. This means that the SUI supply will increase by approximately 1,111,111 SUI tokens per epoch (24 hours) and stakers will capture the newly issued SUI through rewards. It is estimated that stakers will earn around 6% annually. However, the subsidies will decrease every 90 days by 10%. So it would reduce from 6% to 5.40%, then 4.86%, reducing continuously each 90 days. Although the inflationary subsidies will reduce over time, the total Staking rewards rate also consists of rewards derived from network activity / gas fees. Due to low network activity upon launch, Stake subsidies will help make up for rewards until the activity picks up and eventually the rewards will largely be derived from gas fees rather than subsidies.

Stakers will also capture fees from network transactions, so as Sui transaction volume increases, SUI stakers will earn more than just new issuance subsidies.

The SUI token also gives stakers the right to vote on policy decisions for how the Sui network will operate and distribute treasury funds. Owning staked SUI is ownership of the Sui network, entitling SUI stakers to set/change the rules of the Sui network.

What is the Sui unbonding period?

Currently, stakers can unbond their tokens right away. Eventually, there will be a unbonding period during which the tokens will be locked to the protocol. The unbonding period is subject to change through governance.

Do I maintain custody of my SUI tokens? 

While your tokens are staked, you remain in control of your tokens. Third party custody providers such as Anchorage, Bitgo, and Ledger Enterprise offer services for storing your private keys for SUI. 

Can my staked SUI be slashed (seized or destroyed)?

Currently, the parameters for how SUI could be slashed are not fully defined, however some slashing properties have been shared.

At the time of this article, Tally Rule Slashing applies, but there are no predefined slashing parameters:

Tally Rule Slashing: a validator who gets given a 0 score by 2/3 of its peers will see rewards slashed by a to-be-determined number. Parameters that will inform this will be low network performance,malicious behavior, and poor community membership.

How are staking rewards disbursed? Are staking rewards automatically staked?

Staking rewards on Sui Network are automatically distributed every 24 hours and Figment is never in control of your rewards. The rewards are both staked and compounded automatically, which means you will need to unstake to withdraw.

Can I miss out on potential staking rewards?

Your potential rewards depend upon validator performance. When your validator is down, you will not be earning staking rewards, and if your validator acts maliciously, you may be slashed a portion of your staked SUI tokens.

An additional way that a staker might miss out on rewards is by quoting an incorrect gas price that is enough outside of the norm to lead to an unoptimized Gas Reference Price for the network. This would mean that the reference price quoted by an individual validator could lead to suboptimal fee accrual from transactions on the network and resulting suboptimal transaction fee accrual for a validator. We do not cover a suboptimal rewards rate for the network on the basis of an out-of-norm RGP, but do have an optimization strategy that should lead to optimal rewards.

How are decisions about the network made?

Sui uses token voting for on-chain governance, the details of which are not clear at this time.

If you have any outstanding questions, please feel free to reach out to our team.

The information herein is being provided to you for general informational purposes only. It is not intended to be, nor should it be relied upon as, legal, business, or investment advice. Figment undertakes no obligation to update the information herein. Figment and its officers and directors expressly disclaim any liability of any nature associated with the information herein. Please consult your own advisers and lawyers for their advice on the matters covered herein.

SHARE POST

Meet with us

Bring the Complete Staking Solution to Your Organization

Figment respects your privacy. By submitting this form, you are acknowledging that you have read and agree to our Privacy Policy, which details how we collect and use your information.