Skip to content

Add RamsesV3 DEX integration#1151

Open
josephd8 wants to merge 6 commits intoVeloraDEX:masterfrom
RamsesExchange:feature/ramses-velora
Open

Add RamsesV3 DEX integration#1151
josephd8 wants to merge 6 commits intoVeloraDEX:masterfrom
RamsesExchange:feature/ramses-velora

Conversation

@josephd8
Copy link

@josephd8 josephd8 commented Feb 26, 2026

Summary

  • Adds RamsesV3 concentrated liquidity DEX integration for Arbitrum, HyperEVM, and Polygon
  • RamsesV3 uses tickSpacing (not fee) as pool identifier with dynamic fees read on-chain via pool.fee()
  • Adds Network.HYPEREVM (chain 999) with full network config
  • Custom RamsesV3EventPool class extending UniswapV3EventPool with dynamic fee reading and custom StateMulticall

Changes

  • New files: src/dex/uniswap-v3/forks/ramses-v3/ (main class + event pool)
  • New ABIs: src/abi/ramses-v3/ (Pool ABI + StateMulticall ABI)
  • Config: RamsesV3 entries for 3 networks in uniswap-v3/config.ts
  • Tests: Integration tests (SELL + BUY + getTopPools) for all 3 networks, E2E tests for Arbitrum and Polygon

Test plan

  • yarn test-integration ramses-v3 — integration tests pass for Arbitrum, Polygon, HyperEVM
  • yarn test-e2e ramses-v3 — e2e tests pass for Arbitrum (USDC/USDCe) and Polygon (USDCn/USDT)

Note

Medium Risk
Adds a new DEX and a new network configuration, which can affect routing/pricing behavior and on-chain calls across multiple chains. Risk is mitigated by extensive integration/E2E tests but still touches critical swap-path code.

Overview
Adds a new RamsesV3 concentrated-liquidity DEX integration (UniswapV3/Slipstream-style) with network configs for Arbitrum, Polygon, and the newly introduced Network.HYPEREVM (chainId 999).

Introduces RamsesV3-specific ABIs plus custom factory/pool implementations to treat tickSpacing as the pool identifier while reading the actual fee on-chain via pool.fee(), and wires the new DEX into the global dex registry. Adds integration + E2E coverage for pricing and swaps on Arbitrum/Polygon/HyperEVM, and extends test token constants for HyperEVM.

Written by Cursor Bugbot for commit d28b4ff. This will update automatically on new commits. Configure here.

RamsesV3 is a concentrated liquidity DEX (UniV3-style) using tickSpacing
as pool identifier with dynamic fees. Adds Network.HYPEREVM (chain 999),
custom pool class with on-chain fee reading, StateMulticall ABI, and
integration/e2e tests for all three networks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
RamsesV3 PoolCreated events emit tickSpacing instead of fee as the pool
identifier. Without a custom factory, the default UniswapV3Factory would
extract the wrong value, breaking new pool discovery. Follows the same
pattern as PharaohV3Factory and VelodromeSlipstreamFactory.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
);

return pools;
}
Copy link

Choose a reason for hiding this comment

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

Subgraph query uses clPools entity name inconsistently

Low Severity

RamsesV3.getTopPoolsForToken overrides the parent's version with a simpler implementation that skips on-chain balance fetching and USD valuation. PharaohV3 — the closest comparable fork that also uses clPools in its subgraph — performs on-chain balance lookups via _getPoolBalances and USD conversions via getUsdTokenAmounts, providing more accurate liquidity data. This simplified override reduces the accuracy of pool ranking and connectorToken.liquidityUSD values used by the routing engine.

Fix in Cursor Fix in Web

Extend VelodromeSlipstream instead of UniswapV3 to inherit tickSpacing-based
pool routing and periodic fee refresh. Override buildFeeCallData() to query
pool.fee() on pool contracts (same pattern as PharaohV3). Add
tickSpacings/tickSpacingsToFees config for all 3 networks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move HYPEREVM = 999 to correct numerical position in Network enum.
Use this.tickSpacing instead of this.feeCode in RamsesV3EventPool
state multicall for semantic correctness.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Override poolAddress setter in RamsesV3EventPool to clear
_stateRequestCallData cache when initCallback corrects the
pool address from computed CREATE2 to actual on-chain address.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Override _computePoolAddress in RamsesV3EventPool to use
this.deployer instead of this.factoryAddress for CREATE2
computation, and tickSpacing instead of fee in the salt.
Matches the Ramses V3 factory deployment pattern.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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