Backtesting

The arbitration backtesting was done to estimate the additional APY gained from arbitration on top of the fees and to determine hyperparameters used in the protocol that maximizes the interest of all parties involved. The 2 parameters that were finetuned during the backtesting are the minimum price difference to initiate an arbitrage and the portion of the arbitrage profit to distribute to parties involved.

The data that was used to conduct the backtesting is the swap data from Sushiswap and reserves data from both Sushiswap and UniswapV2 ETH/USDC pool from block 10829340(Sep-09-2020 07:08:28 PM +UTC) to block 12912129(Jul-28-2021 03:43:53 AM +UTC). The APY was calculated from the assumption that Sushiswap has implemented post-swap arbitration between itself and UniswapV2. The product invariant constant was calculated pre-arbitrage KpreArbK_{preArb}and post-arbitrage KpostArbK_{postArb}. The ratio of the pool value of post-arbitrage to pre-arbitrage is

p=KpostArbKpreArbp=\sqrt{\frac{K_{postArb}}{K_{preArb}}}

, meaning for the ithi^{th} arbitration the pool value increased by pip_i times. Thus, the ratio of the total pool value increase that is purely from arbitration is

i=1npi\prod_{i=1}^np_i

All possible combinations of the minimum price difference to initiate arbitrage and portion of arbitrage profit were backtested. It was found that with the minimum price difference to trigger an arbitrage set to 1.2%1.2\% between NostraSwap and third-party DEXes and 10%10\%of the arbitrage profit sent back to the trader, NostraSwap is able to ensure that every arbitration resulted in a profit for the traders as they would receive more bonus than the amount of additional gas they paid. Moreover, the liquidity providers gain 9.45%9.45\% profit from arbitraging alone for ETH/USDC pool during the test period.

Since the duration of the backtesting is 323 days, we can convert this number to be the APY by raising it to the power of 365323\frac{365}{323}. The final number we get as the APY for the ETH/USDC pool from arbitraging alone is 10.7%10.7\%.

This APY number is from the backtesting on the ETH/USDC pool only and can vary between different pools as it depends on the volatility of the pair.

Last updated