YOGA
Rest easy! It's just short for Yield Optimization Greedy Algorithm
Y Pool does not put all the money into the Swapper. Instead, some of the assets go into other DeFi protocols to earn yield. For example, the pool on Ethereum places
of assets into Swapper (X Swap) to provide liquidity needed for X Swap; another pool on BSC puts
of assets into Swapper; the other also puts
on Polygon. Meanwhile, the rest of the assets in each pool goes to lending protocols like AAVE.
What YOGA does is find the best percentage,
, which maximizes the profits earned outside of Y Pool while still being able to afford the liquidity needed for X Swap. For instance, if there's $100m altogether in Y Pool, and Y Pool moves a certain ratio of $100m, say $80m, to a strategy that earns yield according to the YOGA, which begets the
based on the parameters given.
Let's take a look at an example here, but first, we need some assumptions:
Parameter | Description | Ethereum | BSC | Polygon | |
| TVL of Y Pool | $5,000,000 | $5,000,000 | $5,000,000 | |
| Ratio of swapping out | 80% | 80% | 80% | |
| Supply APY of USDT on lending platforms | 10.5% | 5% | 2% | |
| Withdrawal cost from lending platforms | $20 | $5 | $1 | |
| Safe reserve ratio | 10% | 10% | 10% | |
And
, the Daily trading volume in total, in reference to the 24h volume of the AnySwap bridge, is $10,000,000. We can have the earnings (Earning as in the formulae below) per day based on YOGA if
of
is moved to supply USDT on a certain lending platform:
On the other hand, the cost to withdraw supplied assets in the lending platform back to the pool that supports liquidity would be:
By
it imagines a scenario where every pool is not able to make ends meet themselves. Under these circumstances, users are more likely to withdraw money from one chain instead of making any more deposits, so XY Protocol would have to continuously return liquidity. Thus, we adjust
to
to represent the worst scenario on each chain.
Net profit per day is displayed in the formula as follows.
We could find which
leads to maximum
by differentiating
.
Consider all the parameters from the table above, do the math and we will have:

Ethereum

BSC

Polygon
Parameter | Ethereum | BSC | Polygon |
| 88% | 92% | 94% |
| 88% | 90% | 90% |
| 7.79% | 4.05% | 1.70% |
should never be greater than
.
We may earn more yields and get all the swap fees simultaneously owing to the invention of YOGA, which gives rise to the best way of managing your wealth and utilizing your assets. Notice that what we've just talked about is even the worst case of bonus APY, let alone the enormous full potential that YOGA can achieve!
Since we are purely being conservative in numbers and, in fact, the frequency of withdrawing from lending platforms should be much lower, it is impossible for
to be greater than
on all chains at the same time and the volume should be divided into each chain accordingly. Simply put, the bonus APY would be a lot higher than the results we have yielded here.
If we charge 0.1% of the swap amount as our fee, the APY of collecting the fee would be
YOGA then provides at least
% boost of APY compared to merely collecting fees for liquidity providers.
Last modified 9mo ago