How to know your holding of each token in a pool in MistSwap

0 39
Avatar for mortinp
2 years ago

Let's make this a quick article.

MistSwap is a DEX/DeFi platform for smartBCH, so you can swap tokens and add liquidity to Liquidity Pools.

When you are farming in the pool, you are not exactly sure how many tokens of each one in the pair you are to get in return if you were to withdraw your position from the pool.

Let's say your are in the Mist/flexUSD liquidity pool and let's do the exercise.

STEP 1: Check how many LP tokens you own (which you are staking in the Mist/flexUSD farm). See figure below:

In my case, that's 3484 LP tokens in the Mist/flexUSD farm. Write this number down as it will be used in Step 2.

STEP 2: Calculate your share in the Mist/flexUSD pool.

Go to this url: http://smartbch.tuxpaper.nu/TokenTransferScanner/?c=0x3a7b9d0ed49a90712da4e087b17ee4ac1375a5d4

This is the MasterChef contract.

Click the Calculate Balances button. You will see the Total LP token balance of each pair of tokens.

In the picture below you can find the balance of the Mist/flexUSD LP token. It is ~1,924,404.

To calculate your rate, just do this calculation:

your LP token count / total LP token balance = 3484 / 1,924,404 = 0.0018

0.0018 is your share in the Mist/flexUSD pool. Write this number down.

STEP 3 and final: calculate how much flexUSD and how much Mist I would get back if I withdrew my LP tokens from staking right now.

Go to this url: http://smartbch.tuxpaper.nu/TokenTransferScanner/?c=0x437e444365ad9ed788e8f255c908bcead5aea645

This is the Mist/flexUSD LP token contract.

Click the Calculate Balances button. You will see the total Mist balance and the total flexUSD balance separately.

See picture below:

In the picture, these are the TOTAL balances:

Mist: 12,905,123
flexUSD: 294,872

So, how many tokens of each would I get?

You do: your rate * total balance of the respective token in the LP contract

So, for Mist:

0.0018 * 12,905,123 = 23,229

For flexUSD:

0.0018 * 294,872 = 530

In summary, if I withdrew my LP tokens from staking from the Mist/flexUSD farm, I would get:

23,229 Mist
530 flexUSD

That's it. Hope it helps!

5
$ 0.12
$ 0.10 from @tula_s
$ 0.01 from @alian_rignack
$ 0.01 from @halu
Avatar for mortinp
2 years ago

Comments