A guide to rETH rate (beginner-friendly)

In the few weeks ago, Celsius transferred 1,393 rETH to Wintermute Trading and received 1,393 ETH.

https://twitter.com/lookonchain/status/1676797417927372801

Although the rETH/ETH rate in the transaction was 1:1, the rToken app displayed a different rate of 1.056:1. This raises the question of what happened.

To understand this phenomenon, we need to consider how users stake ETH to receive rETH through platforms like StaFi. The exchange rate for rETH is calculated on the chain based on the total ETH balance divided by the rETH total supply.

source code: https://github.com/stafiprotocol/eth2-staking/blob/main/contracts/token/RETHToken.sol

function getEthValue(uint256 _rethAmount) override public view returns (uint256) {
        // Get network balances
        IStafiNetworkBalances stafiNetworkBalances = IStafiNetworkBalances(getContractAddress("stafiNetworkBalances"));
        uint256 totalEthBalance = stafiNetworkBalances.getTotalETHBalance();
        uint256 rethSupply = stafiNetworkBalances.getTotalRETHSupply();
        // Use 1:1 ratio if no rETH is minted
        if (rethSupply == 0) { return _rethAmount; }
        // Calculate and return
        return _rethAmount.mul(totalEthBalance).div(rethSupply);
    }

function getExchangeRate() override public view returns (uint256) {
        return getEthValue(1 ether);
    }

This rate is always greater than 1. For example, if you stake 1.05 ETH and the current exchange rate for rETH is 1.05, you will receive 1 rETH.

Dune Dashboard: https://dune.com/signal_stafi/stafi-staked-eth-dashboard

However, when users stake or unstake rETH through a decentralized exchange (DEX), the exchange rate is determined by the pool balance and may not be the same as the rate on the chain. This is reflected in the non-linear nature of the rETH exchange rate graph, as seen by the red line.

Before the ETH Shanghai upgrade, users could not withdraw ETH from the deposit contract. As a result, if a user wanted to unstake rETH, they could only swap rETH to ETH on the DEX. This caused the rETH/ETH rate on the DEX to be lower than the rate on the chain. Similarly, if a user wanted to stake ETH, they might find that the rETH/ETH exchange rate on the DEX is lower than the rate on the chain. In this scenario, it would be more advantageous to swap ETH to rETH on the DEX, as it would result in receiving more rETH than staking ETH on the StaFi app. This swap would also cause the rETH/ETH exchange rate on the DEX to increase, further contributing to the non-linear nature of the exchange rate graph.

It’s important to note that now, StaFi ETH staking supports ETH withdrawal with a limit of 100 ETH per day. If a user wants to unstake rETH and receive an amount of ETH greater than 100 in one transaction, it is not supported on the StaFi rToken app. However, they could swap rETH to ETH on the DEX in one transaction. This would result in the user receiving an amount of ETH less than on the StaFi rToken app and cause the rETH/ETH rate on the DEX to be lower than the rate on the chain.

In summary, the discrepancy between the rETH/ETH rate in the Celsius transaction and the rate displayed on the rToken app can be attributed to the fact that the exchange rate on the DEX is not always the same as the rate on the chain. This can create opportunities for users to take advantage of market inefficiencies and earn more rETH for their ETH, but it’s important to understand the risks involved and the potential impact on the exchange rate.

1 Like