Error During The Initialization Of The mSOL — SOL Pool

Meteora
3 min readOct 26, 2021

--

On October 18 (1430 UTC), we announced our mSOL-2Pool that supports stable-to-stable swapping between mSOL and SOL. This special type of non-pegged stable pool is designed to bring long-term capital efficiency between staked SOL and SOL, even as the value of the staked SOL increases over time. You can read more about the pool here.

For example, even in 2 years, when staked SOL will be 10–14% higher than SOL, the pool will still be balanced and function optimally. To do so, unpegged stable pools leverage an on-chain price oracle to retrieve and update the token prices in the pool — in this case, the mSOL price relative to the SOL.

The pool currently works as intended — it is a highly balanced pool with the price matching the price of mSOL/SOL on all the other major markets. But at the beginning, we accidentally mispriced the SOL to be slightly more expensive than the mSOL in the pool, due to an error when initializing the program.

In this post, we will explain the error, the compensation plan as well provide an example of a user who was affected.

The Error

Our permissionless oracle program had the tokens pair in the wrong order, for about 12 hours, SOL was priced at 1.012 to 1 mSOL in the mSOL-2Pool. Due to the small difference, it was not apparent immediately but was fixed on October 19 (0243 UTC). After that, mSOL is correctly priced at 1.012 to 1 SOL, that is the correct price from the Marinade staking program.

During this period, people who had deposited mSOL into the mSOL-2Pool would have gotten fewer mSOL-2Pool LP tokens than expected. People who had deposited SOL into the mSOL-2Pool would have gotten more mSOL-2Pool LP tokens.

To calculate the total amount of compensation, we sum up all the mSOL deposits during this period and recalculate the loss of value in mSOL because of our repricing and repay the mSOL depositors in our mSOL-2Pool LP tokens for their losses. SOL depositors had an advantage during this period because of the higher price of SOL.

To make the compensation as seamless as possible to mSOL depositors who experienced LP tokens loss during this period, we would airdrop mSOL-2Pool LP tokens to mSOL depositors who deposited during this period.

In total, we will need ~2462 mSOL-2Pool LP tokens to pay back the loss, that’s about 2462 mSOL/SOL to be deposited in the mSOL-2Pool. Mercurial would use its treasury to mint these mSOL-2Pool LP tokens by depositing them into the mSOL-2Pool. It will not affect the MER holders in any way.

Example

This account (https://explorer.solana.com/address/HWtUvR74YaPwgtsvb69bwFpRup7s5Fb9ZQoqMjfbSjwn) is affected by this incident. The user deposited ~3146.58 mSOL at different times during the incident period and got ~3157.93 mSOL-2Pool LP tokens. After the readjustment, the user will get extra ~37.85 mSOL-2Pool tokens.

In Summary

Duration of the incident: 1430 UTC October 18, 2021 to 0243 UTC October 19, 2021.

Total unique address affected: 392 addresses

Total compensation being paid out: ~2462 mSOL-2Pool LP tokens

When Airdrop:

Over the next week.

List of affected addresses and compensation amounts: https://gist.github.com/siong1987/85c7018034f1554ed2e9e5780cad9ea2

Our Apologies

We are very sorry for this error. To prevent this situation from happening again, we have implemented more checks and reviews before a pool goes live on mainnet, and more monitoring procedures after a pool goes live.

--

--

Meteora
Meteora

Written by Meteora

Building the most secure, sustainable and composable yield layer for all of Solana and DeFi. Discord: https://t.co/vJ6ey5RYnm

Responses (1)