Skip to content

Repository files navigation

KyberSwap DEX Adapter Lib

This library is for ecosystem partners that want to implement their own DEX adapter for use in the KyberSwap DEX Aggregator.

Contributing

Implement your own DEX adapter based on UniswapV2Adapter and UniswapV3Adapter and submit a PR to add it to the repository. Also, make sure to add tests for your adapter like the ones in UniswapV2Adapter.t.sol and UniswapV3Adapter.t.sol.

Below are a few assumptions you must follow before implementing your own adapter:

  • There are no limitations on the contracts that the adapter can interact with.
  • The input tokens are already transferred to the adapter contract.
  • Prefer to interact directly with pool contracts if possible, rather than through router contracts.
  • If your integration requires a callback function, implement it in the adapter contract.
  • Use our libraries TokenHelper to interact with tokens and CalldataDecoder to decode calldata whenever possible.
  • If your integration does not transfer the output tokens directly to the recipient, just leave them inside the adapter contract; you don't need to explicitly transfer them.
  • The adapter supports native tokens as input and output tokens, through the symbolic address 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE (TokenHelper.NATIVE_ADDRESS).
  • If your integration does not support native tokens directly, you can simply ignore it.

When submitting a PR, make sure the following are true:

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages