Formula

The arbitration logic of NostraSwap is to maximize the product invariant by bringing the market price of the third party DEX as close to our market price as possible, eliminating any potential arbitrage opportunity. 10% of the arbitraging profit goes to the trader, while the rest goes to the liquidity pool.

NostraSwap begins with determining the amount of bonus token the trader should receive by calculating the profit from the arbitrage from the newReserves NostraSwap expects to have if it arbitrages between itself and a third party DEX with the assumption that no bonus token will be returned to the trader.

Where

The percent increase of the pool value can be calculated by:

NostraSwap then uses this ratio to calculate the arbitration profit. 10% of the expected arbitration profit is sent to the trader. This calculation is done on all third-party DEXes to find the one that would yield the best profit.

Last updated