Skip to content

Latest commit

 

History

History

swap

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Swapper

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.

Contracts

  • 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.

Diagrams

CowSwap

CowSwapDex hierarchy

CowSwap Dex Hierarchy

CowSwapDex contract

CowSwapDex

CowSwapDex storage

CowSwapDex

1Inch

OneInchDexSwap contract

OneInchDexSwap

OneInchDexSwap storage

OneInchDexSwap

Basic

BasicDexSwap contract

BasicDexSwap

Tests

CowSwap unit tests

yarn test ./test/vault/swap/CowSwapDex.spec.ts