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=na1+a1+...+an
balanceratio:R=Ana1∗a2∗...∗an
Reward
reward=(R2−R1)∗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 reward
We will limit total reward per day to prevent over inflation of XY token.