feat: add Rubicon Aquila V2 (constant-product AMM, 4 chains) - #1182
Open
bghughes wants to merge 1 commit into
Open
feat: add Rubicon Aquila V2 (constant-product AMM, 4 chains)#1182bghughes wants to merge 1 commit into
bghughes wants to merge 1 commit into
Conversation
Adds Rubicon Aquila V2, a UniswapV2-fork constant-product AMM deployed by Rubicon Finance on Ethereum, Optimism, Arbitrum, and Base, as a routable liquidity source via the existing generic UniswapV2 adapter. Aquila is byte-identical to UniswapV2 — same pair `swap()` ABI (IAquilaPair.sol:70-75), same `getReserves()` shape, and the standard 997/1000 fee numerator (AquilaLibrary.sol:82). Adding it is a single new entry in UniswapV2Config plus a minimal SELL e2e test per chain. Pair init code hash (same on all chains, from AquilaLibrary.sol:35): 0x79cb29831f0abd24ae48de6fa5dc9eb647f10df38618ed09b70b2044d35dfba5 Factories: Ethereum: 0x7bad585c3ae4ae266f92a4af13b388bc7b26067c Optimism: 0x3B2C6fe3039B42f00E98b76531C05932abfB258e Arbitrum: 0xEca3EA559b7566e610d113bbA8D1B15B085C9c68 Base: 0xA5cA8Ba2e3017E9aF3Bd9EDa69e9E8C263Abf6cD Cross-validation: Aquila Base factory matches the address DefiLlama's adapter already indexes at DefiLlama-Adapters projects/rubicon/index.js. Docs: https://docs.rubicon.finance/integrations Contracts: https://github.com/RubiconDeFi/aquila
This was referenced May 19, 2026
Author
|
Hi @0xNazarii @KanievskyiDanylo 👋 — friendly bump on this one. It adds Rubicon's Aquila V2 (constant-product AMM) across 4 chains; CI (Cursor Bugbot) is green and there are no open comments. Companion to #1183 (our CLMM PR). Happy to rebase or address anything whenever you get a chance — thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Rubicon Aquila V2 — Rubicon Finance's UniswapV2-fork constant-product AMM — as a routable liquidity source via the existing generic
UniswapV2adapter. Aquila is deployed on Ethereum, Optimism, Arbitrum, and Base.Scope
Config-only on the adapter side. The
UniswapV2class in this repo is parameterized overUniswapV2Configand auto-registers every key viagetDexKeysWithNetwork/_.omit. Adding Aquila is a new top-level entry in that map. No new directory, no new class, no math.Files changed (5 files, +109 / -0)
src/dex/uniswap-v2/config.ts— one new entry,RubiconAquila, covering all four chains.src/dex/uniswap-v2/uniswap-v2-e2e-mainnet.test.ts— one minimaldescribe('RubiconAquila', ...)block with a single SELL test (WETH → USDC).src/dex/uniswap-v2/uniswap-v2-e2e-optimism.test.ts— same shape, single SELL test (USDC → DAI — Aquila Optimism has no native WETH/USDC pair).src/dex/uniswap-v2/uniswap-v2-e2e-arbitrum.test.ts— single SELL test (WETH → USDC).src/dex/uniswap-v2/uniswap-v2-e2e-base.test.ts— single SELL test via the file'stestForNetwork()helper (WETH/USDC).Configuration
feeCode0x7bad585c3ae4ae266f92a4af13b388bc7b26067c0x79cb29831f0abd24ae48de6fa5dc9eb647f10df38618ed09b70b2044d35dfba50x3B2C6fe3039B42f00E98b76531C05932abfB258e0xEca3EA559b7566e610d113bbA8D1B15B085C9c680xA5cA8Ba2e3017E9aF3Bd9EDa69e9E8C263Abf6cDVerification
swap()ABI — byte-identical to UniswapV2 (IAquilaPair.sol:70-75).getReserves()shape — standard UniV2(uint112, uint112, uint32)confirmed on-chain.RubiconDeFi/aquila → AquilaLibrary.sol:35; verified on-chain by computingpairFor(USDC.e, OP)and matchingfactory.allPairs(0)on Optimism.997/1000numerator fromAquilaLibrary.sol:82→feeCode: 30(standard UniV2).0xA5cA8Ba2e3017E9aF3Bd9EDa69e9E8C263Abf6cDis the same addressDefiLlama/DefiLlama-Adaptersalready indexes atprojects/rubicon/index.js.Local checks
pretty-quick,tsc, andeslintall pass (run via the repo'spreparescript duringpnpm installand again via the pre-commit hook). Existinguniswap-v2-integration.test.tscontinues to pass on the 2 RPC-only cases (getTopPoolsForTokenrequiresAPI_KEY_THE_GRAPHwhich we don't set locally — affects all UniswapV2 forks equally, not specific to this change).Links
Note
Low Risk
Low risk: config-only addition of a new UniswapV2-fork entry plus new e2e tests; main risk is incorrect
factoryAddress/initCodevalues causing routing or quoting failures on the listed networks.Overview
Adds
RubiconAquilatoUniswapV2Config, wiring in factory addresses + init code hash (and standardfeeCode/gas estimates) for Mainnet, Optimism, Arbitrum, and Base so the existingUniswapV2adapter can route against Aquila.Extends UniswapV2 e2e suites on those networks with minimal
RubiconAquilaswap tests (e.g., WETH→USDC on Mainnet/Arbitrum/Base, USDC→DAI on Optimism) to validate integration.Reviewed by Cursor Bugbot for commit 1ed2fe3. Bugbot is set up for automated code reviews on this repo. Configure here.