XY Finance

Search…

Getting Started

DEVELOPER

Rebalance

In Y pool, there are situations that pool supported token in one chain is usually swapped out and another usually swapped in, which causes unbalance of each chain.

The following graph shows an unbalance situation where USDT balance in:

- Ethereum: 0.1M
- BSC: 10M
- Polygon: 50M

unbalance of each chain

Unbalance Formula

To give reward to those help rebalance the pools, we have a formula to express how unbalanced the pools are:

Assumption

- There are
**n**different chains, which has its pool supported token - Token on each chain is represented as
**a1**,**a2**, ...**an**. - Max XY token reward each time =
**m**

Formula

$A = \frac{a_1 + a_1 + ... + a_n}{n}$

$balance\ ratio:\ R = \frac{a_1 * a_2 *...* a_n}{A^n}$

Reward

$reward\ = (R_2 - R_1) * m$

For the example on top:

- A = 20.03M
- balance ratio R1 = 0.0062 = 0.62%

If someone calls rebalance and swaps in 20M USDT in Ethereum and swaps out 20M USDT in Polygon, balance in each chain would be:

- Ethereum: 20.1M
- BSC: 10M
- Polygon: 30M

balance ratio R2 = 0.75 = 75%
He will get (0.75 - 0.0062) * m =

`0.7438 * m`

XY tokens as rewardWe will limit total reward per day to prevent over inflation of XY token.

Last modified 9mo ago

Copy link

Contents

Unbalance Formula