Skip to content

Ekubo v3#1127

Merged
Ivan011001 merged 27 commits intoVeloraDEX:masterfrom
die-herdplatte:ekubo-v3
Feb 16, 2026
Merged

Ekubo v3#1127
Ivan011001 merged 27 commits intoVeloraDEX:masterfrom
die-herdplatte:ekubo-v3

Conversation

@die-herdplatte
Copy link
Contributor

@die-herdplatte die-herdplatte commented Jan 6, 2026

This PR integrates Ekubo V3.

Changes to this integration from a technical perspective in comparison to v2:

  • Many contract interfaces were changed to save gas
  • Addition of the new stableswap pool type
  • We now fetch pool keys once from a subgraph and then switch over to event-based pool creations

Note

Medium Risk
Large addition of new pricing/math and event-driven pool state logic that can affect quote correctness and runtime performance, though it is mostly additive and isolated behind a new EkuboV3 dex key.

Overview
Adds a full new EkuboV3 DEX integration (Mainnet + Arbitrum) including contract ABIs, network/config wiring, and a new EkuboV3 exchange implementation that produces quotes and builds router calldata via swapAllowPartialFill.

Introduces an EkuboV3PoolManager that bootstraps pool keys from a subgraph and then subscribes to on-chain logs to create/update/rollback pools on PoolInitialized and other events, with support for multiple pool/extension types (concentrated, stableswap/full-range, oracle, MEV-capture, TWAMM).

Adds substantial new pool state/quoting + math modules (ticks, sqrt ratios, swap steps, TVL) and a comprehensive test suite (unit, integration, events, e2e) to validate quoting accuracy against on-chain router quote and event-driven state updates; also bumps package version and upgrades jest/@types/jest dev deps.

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

cursor[bot]

This comment was marked as outdated.

Only the pool manager is subscribed and sends the filtered logs to the corresponding pools.
@die-herdplatte
Copy link
Contributor Author

There's one failing test for Arbitrum:

  ● Arbitrum One › BUY › swapExactAmountOut › ETH -> USDC

    expect(received).toBeLessThanOrEqual(expected)

    Expected: <= 10n
    Received:    333888393845427n

      314 |   const paraswapShare = decodedOutput.paraswapShare?.toNumber() ?? 0;
      315 |
    > 316 |   expect(amountDiff.toBigInt()).toBeLessThanOrEqual(10n); // 10 wei max allowed difference
          |                                 ^
      317 |   expect(paraswapShare).toEqual(0);
      318 | }
      319 |

      at testE2E (tests/utils-e2e.ts:316:33)

but the calculated srcAmount and the simulated calculated amount are exactly the same.
The shown difference is the exact difference between the approved and the used amount though, so decodedOutput.spentAmount may actually track the approved, not the spent, value.

@Ivan011001 Ivan011001 merged commit efdb0f7 into VeloraDEX:master Feb 16, 2026
3 checks passed
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 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

token0
token1
}
}`;
Copy link

Choose a reason for hiding this comment

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

Subgraph query lacks pagination, silently truncates pool results

High Severity

The subgraph query for poolInitializations has no first parameter. The Graph API defaults to returning at most 100 results. For an active DEX with more than 100 initialized pools, the query silently omits pools beyond this limit, causing the integration to operate with an incomplete pool set and miss potential swap routes.

Fix in Cursor Fix in Web

@die-herdplatte die-herdplatte deleted the ekubo-v3 branch February 17, 2026 13:06
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