Exchange Rate

Exchange Rate of milkTIA and TIA

In the MilkyWay protocol, it is important to maintain an accurate milkTIA: TIA exchange rate. Exchange rate is based on the following formula:

ExchangeRate=TotalNativeToken+TotalRewardsTotalLiquidStakedTokenExchangeRate = \frac {Total NativeToken + TotalRewards} {TotalLiquidStakedToken}

TotalNativeToken = Staked TIA + accrued staking rewards. TotalLiquidStakedToken = milkTIA minted

It will initially start at a 1:1 ratio and will be dynamically updated based on the accrued staking rewards. To understand how this works, letā€™s consider an example:

Alice is MilkyWayā€™s first user and she stakes 100 TIA, she then receives 100 milkTIA in return.

ExchangeRate=100100=1.0ExchangeRate = \frac {100} {100} = 1.0

Letā€™s assume that time has passed and 10 rewards were accrued. Now, the new exchange rate would be:

ExchangeRate=100100+10=0.91ExchangeRate = \frac {100} {100+10} = 0.91

If Alice decides to withdraw her TIA, she receives 110 TIA for 100 milkTIA based on the new exchange rate.

Please note that this is an illustrative example of how the exchange rate works and did not account for the validatorā€™s commission and the MilkyWay DAO fee.

How do we update the exchange rate?

During the delegation process, the deposited osmoTIA is transferred to Celestia to stake on behalf of the MilkyWay users. Once it is staked, Celestia protocol begins to accrue staking rewards every block. To update the exchange rate on the staking contract on Osmosis, it's the responsibility of operators to regularly claim rewards and send them back to the staking contract, thereby updating the exchange rate. In MilkyWay, it leverages the authz module to grant limited authorization to withdraw staking rewards to the grantee account from the staker multisig account and the grantee account has limited authorization to IBC transfer from the rewards collector multisig account.

Hereā€™s a step-by-step breakdown of what happens in the background:

  1. The coordinator periodically monitors the accrued staking rewards of the delegations from the Staker multisig account and signs WithdrawDelegatorReward and MsgTransfer in a transaction and broadcast it to Celestia.

  2. IBC transfer the withdrawn staking rewards to the staking contract on Osmosis

  3. Upon the staking rewards arriving on Osmosis, the staking contract updates the exchange rate. This increases the value of milkTIA over time.

Last updated