Swapper contracts are used to swap tokens on-chain. Swaps can be done synchronously via aggregators like 1Inch or Automated Market Makers (AMMs) like Uniswap. They can also be done asynchronously with aggregators like Cowswap.
Vaults that can swap underlying assets as part of a rebalancing process. Vaults can also swap reward tokens for vault assets.
-
IDexSwap Generic on-chain ABI to synchronously swap tokens on a DEX or aggregator.
-
IDexAsyncSwap Generic on-chain ABI to asynchronously swap tokens on a DEX or aggregator.
-
OneInchDexSwap Implementation of IDexSwap that uses 1inch API Aggregation Protocol v4.
-
CowswapDexSwap Implementation of IDexAsyncSwap that uses CowSwap.
-
BasicDexSwap Implementation of IDexSwap for testing purposes.
CowSwapDex
hierarchy
CowSwapDex
contract
CowSwapDex
storage
OneInchDexSwap
contract
OneInchDexSwap
storage
BasicDexSwap
contract
CowSwap unit tests
yarn test ./test/vault/swap/CowSwapDex.spec.ts