feat: add uniswap v3 as a native router venue - #1477
Conversation
PoolType::UniswapV3 executor (QuoterV2 quotes, SwapRouter02 swaps), governable addresses in pallet-parameters, UniswapV3Api runtime API, and a lark deploy + mixed-swap validation CLI.
|
Crate versions that have not been updated:
Crate versions that have been updated:
Runtime version has been increased. |
- record every v3 swap into the EMA oracle under a new uniswpv3 source, so DCA and set_route stop failing on v3 routes - get_liquidity_depth now uses in-range liquidity from slot0 + liquidity(), not the pool's token balance - split the one 1M gas limit into per-call limits and derive trade_weight from them - check approve returns true, emit an event when the addresses are set - un-ignore the integration tests, add oracle/DCA/depth/weight tests
There was a problem hiding this comment.
Claude Code Review
Claude Code Review is paused for this repository. To reconnect it, an admin of this repository's GitHub organization (or the account owner, for personal repositories) who can also manage your Claude organization's Code Review settings needs to re-link GitHub in Code Review settings. This is a one-time step.
Tip: disable this comment in your organization's Code Review settings.
Both changed in the uniswap v3 work but kept master's version, which the CI version check flags: primitives 6.4.0 -> 6.5.0 new UNISWAPV3_SOURCE constant hydradx-adapters 1.13.2 -> 1.14.0 OraclePriceProvider now prices v3 legs Minor rather than patch on adapters: a route that previously returned None now returns a price, which changes routing behaviour rather than fixing it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
227 commits behind. Conflicts and how they were taken:
runtime/hydradx spec_version 429 vs 440 -> 441, crate 441.0.0
`frame_system::can_set_code` rejects `new <= current`, so the branch at
429 could not have been enacted on any chain already past it.
primitives 6.4.1 vs 6.5.0 -> 6.5.0 (ours is higher)
hydradx-adapters 1.13.3 vs 1.14.0 -> 1.14.0 (ours is higher)
evm/mod.rs both sides added a module -> keep both
pallet-parameters both sides added storage -> keep both
Cargo.lock took master's, reconciled with `cargo update -w`
Carries a consequence for the TWAP work: master moved the chain to
2-SECOND blocks (MILLISECS_PER_BLOCK 6_000 -> 2_000, with a
SetTwoSecBlocksSince migration recording the transition). Observation-ring
sizing is a function of block time, so the values chosen for 6s no longer
hold — see the follow-up commit.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The five EVM-path tests were un-ignored and pointed at real addresses, but the snapshot backing them was gitignored (SNAPSHOT*), so they could only ever run on the machine that generated it. Committed the way the Aave tests already commit theirs, and slim at 244K against their 2.1M. Without it `with_uniswap_v3` has no chain state to load and every test in the file fails at setup — including the two that exist to prove DCA now survives a v3 leg. Also: keyringFromSuri used ss58 prefix 63, so every account it printed disagreed with the explorer and the rest of the repo's scripts. Same account and signatures either way; only the display form changes. No hardcoded ss58 address anywhere in these scripts depends on it. .env.lark4 records the lark4 aDOT/HOLLAR run, alongside the existing .env.zombienet / .env.lark-backup. Dev keys only (//Alice, hardhat account 0).
There was a problem hiding this comment.
Claude Code Review
Claude Code Review is paused for this repository. To reconnect it, an admin of this repository's GitHub organization (or the account owner, for personal repositories) who can also manage your Claude organization's Code Review settings needs to re-link GitHub in Code Review settings. This is a one-time step.
Tip: disable this comment in your organization's Code Review settings.
|
Quick benchmark at commit e399bc6 has been executed successfully. |
Adds Uniswap v3 as a native router venue: an EVM trade executor (QuoterV2 quotes, SwapRouter02 swaps), governable contract addresses in
pallet-parameters, and aUniswapV3Api. Ships a lark deploy + mixed-swap validation CLI.Integration tests are snapshot-gated (
#[ignore]d, same pattern asaave_router); the multi-hop Omnipool→UniswapV3 path was validated live on lark1.make clippy-all+make testpass locally.