Skip to content

Wasabi propamm adapter#2

Merged
thepluck merged 6 commits intoKyberNetwork:mainfrom
dev-wasabi:wasabi-propamm-adapter
Mar 5, 2026
Merged

Wasabi propamm adapter#2
thepluck merged 6 commits intoKyberNetwork:mainfrom
dev-wasabi:wasabi-propamm-adapter

Conversation

@dev-wasabi
Copy link
Copy Markdown
Contributor

Summary

  • Add a KyberSwap DEX adapter for the Wasabi Prop AMM, enabling the KyberSwap aggregator to route swaps through Wasabi's oracle-anchored AMM pools on Base
  • The adapter interacts directly with PropPool contracts (not through the PropSwapRouter), following the guideline to prefer direct pool interaction

Details

Each Wasabi Prop AMM pool pairs a single base token (e.g. WETH) with USDC as the quote token. The adapter handles one pool per call -- for token-to-token routes (e.g. WETH -> WBTC), the aggregator chains two calls through USDC.

The data parameter encodes only the pool address:

bytes memory data = abi.encode(poolAddress);

ERC20 output tokens are left in the adapter for the framework to collect. Native token wrapping/unwrapping is handled by KyberSwap's internal flow and does not need to be implemented in the adapter.

Deployment note: The adapter contract must be granted AUTHORIZED_SWAPPER_ROLE (role 100) on the PropPoolFactory's access manager after deployment.

Copilot AI review requested due to automatic review settings March 4, 2026 17:43
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new KyberSwap DEX adapter implementation for Wasabi Prop AMM pools on Base, along with a mainnet-fork Foundry test to validate swap execution against real deployed contracts.

Changes:

  • Introduce WasabiPropAmmAdapter that swaps against a Wasabi PropPool using swapExactInput.
  • Add IPropPool interface used by the adapter to interact with Wasabi pools.
  • Add a Base mainnet-fork fuzz test covering both base→USDC and USDC→base swap directions.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/adapters/wasabi-prop-amm/WasabiPropAmmAdapter.sol New adapter contract that decodes a PropPool address from calldata, approves tokenIn, and executes an exact-input swap.
src/adapters/wasabi-prop-amm/IPropPool.sol Interface definition for interacting with Wasabi PropPool contracts (swap + base/quote token getters).
test/adapters/wasabi-prop-amm/WasabiPropAmmAdapter.t.sol Base mainnet-fork test that funds the adapter, executes swaps, and asserts output accounting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/adapters/wasabi-prop-amm/WasabiPropAmmAdapter.sol
Comment thread src/adapters/wasabi-prop-amm/WasabiPropAmmAdapter.sol
Comment thread src/adapters/wasabi-prop-amm/WasabiPropAmmAdapter.sol
@thepluck thepluck merged commit 4b4114e into KyberNetwork:main Mar 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants