Migrate from UniswapV2

Guide on required changes if you come from UniswapV2

  • Router and Factory were combined in our SwapOperations contract

    • use isPair, getPair, allPairs to check out SwapPairs

    • besides a fixed 0.3% swap fee, we have an additional dynamic fee on swaps, that move peg away from oracle price.

    • don't use quote, as it wont include dynamic fee, so only use getAmountsOut and getAmountsIn

    • token0 in each swap pair is always our stablecoin aUSD

    • we only have swapTokensForExactTokens and swapExectTokensForTokens

    • both functions have a different signature from UniswapV2, which is the additionnal parameter bytes[] memory priceUpdateData. Just prrovide an empty array as we already update the PYTH oracle in regular intervals.

Last updated