Skip to content

feat: add uniswap v3 as a native router venue - #1477

Open
iamyxsh wants to merge 8 commits into
masterfrom
feat/uniswap-v3-router
Open

feat: add uniswap v3 as a native router venue#1477
iamyxsh wants to merge 8 commits into
masterfrom
feat/uniswap-v3-router

Conversation

@iamyxsh

@iamyxsh iamyxsh commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Adds Uniswap v3 as a native router venue: an EVM trade executor (QuoterV2 quotes, SwapRouter02 swaps), governable contract addresses in pallet-parameters, and a UniswapV3Api. Ships a lark deploy + mixed-swap validation CLI.

Integration tests are snapshot-gated (#[ignore]d, same pattern as aave_router); the multi-hop Omnipool→UniswapV3 path was validated live on lark1. make clippy-all + make test pass locally.

PoolType::UniswapV3 executor (QuoterV2 quotes, SwapRouter02 swaps), governable addresses in pallet-parameters, UniswapV3Api runtime API, and a lark deploy + mixed-swap validation CLI.
@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown

Crate versions that have not been updated:

  • runtime-integration-tests: v1.108.0
  • pallet-parameters: v1.3.0
  • hydradx-traits: v4.12.0

Crate versions that have been updated:

  • pallet-broadcast: v1.7.0 -> v1.8.0
  • primitives: v6.4.1 -> v6.5.0
  • hydradx-adapters: v1.13.3 -> v1.14.0
  • hydradx-runtime: v440.0.0 -> v442.0.0

Runtime version has been increased.

iamyxsh added 2 commits August 7, 2026 18:40
- 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

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

iamyxsh and others added 4 commits August 24, 2026 13:22
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).

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

@github-actions

Copy link
Copy Markdown

Quick benchmark at commit e399bc6 has been executed successfully.
View results

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.

1 participant