Skip to content

Add Ekubo#27

Draft
HanzCEO wants to merge 9 commits intogluexprotocol:mainfrom
HanzCEO:ekubo
Draft

Add Ekubo#27
HanzCEO wants to merge 9 commits intogluexprotocol:mainfrom
HanzCEO:ekubo

Conversation

@HanzCEO
Copy link
Copy Markdown

@HanzCEO HanzCEO commented Sep 6, 2025

Protocol Information

  • Protocol Name: Ekubo
  • Protocol Website: https://docs.ekubo.org/
  • Indexing Smart Contract Addresses (e.g. factories):
    • Ethereum
      • 0xe0e0e08a6a4b9dc7bd67bcb7aade5cf48157d444, Core (all pools are in this single contract)
  • Execution Smart Contract Addresses (e.g. Router)
    • Ethereum
      • 0x9995855c00494d039ab6792f18e368e530dff931, Router

Summary of Integration

Provide a brief overview of your integration:

  • What does your protocol do?
    • Ekubo Protocol delivers the best pricing using super-concentrated liquidity, a singleton architecture, and extensions. The Ekubo protocol vision is to provide a balance between the best swap execution and liquidity provider returns. The contracts are relentlessly optimized to be able to provide the most capital efficient liquidity ever at the lowest cost.
  • What type of liquidity does it provide (DEX, lending, yield farming, etc.)?
    • DEX
  • Any unique features that GlueX should consider?
    • n/a

Implementation Details

Execution Functions Required

// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;

interface EkuboRouter {
  function swap(
        PoolKey memory poolKey,
        bool isToken1,
        int128 amount,
        SqrtRatio sqrtRatioLimit,
        uint256 skipAhead,
        int256 calculatedAmountThreshold,
        address recipient
    ) external payable returns (int128 delta0, int128 delta1);
}

Functions Implemented

  • get_amount_out() - Token2token swap and liquidity provision token "swap"
  • get_amount_in() - Token2token swap and liquidity provision token "swap"
  • get_apy() - Calculates dilluted 24hrs yields that is compounded for 365 days
  • get_tvl() - Assets inside Core contract

Dynamic States Required for AMM Calculations

  • ${token_address_lowercase}_balance - Obtained from token_address_lowercase.balanceOf(address(Core))

Static States Required for AMM Calculations

  • core_address - 0xe0e0e08a6a4b9dc7bd67bcb7aade5cf48157d444

Dependencies

N/A

Other Requirements

  • API Keys: n/a
  • Special Access Requirements: n/a

Test Results

Click to view test results
(venv) hanz@debian:~/Work/Bounty/liquidity-module-self-integration$ py -m pytest tests/test_ekubo_liquidity_module.py --cov -v
========================================================= test session starts =========================================================
platform linux -- Python 3.13.2, pytest-8.3.5, pluggy-1.6.0 -- /home/hanz/Work/Bounty/liquidity-module-self-integration/venv/bin/python3
cachedir: .pytest_cache
rootdir: /home/hanz/Work/Bounty/liquidity-module-self-integration
plugins: cov-6.1.1
collected 1 item                                                                                                                      

tests/test_ekubo_liquidity_module.py::test_get_tvl PASSED                                                                       [100%]

=========================================================== tests coverage ============================================================
___________________________________________ coverage: platform linux, python 3.13.2-final-0 ___________________________________________

Name                                   Stmts   Miss  Cover
----------------------------------------------------------
modules/ekubo_liquidity_module.py         19      3    84%
templates/liquidity_module.py             22      4    82%
tests/test_ekubo_liquidity_module.py      26      0   100%
----------------------------------------------------------
TOTAL                                     67      7    90%
========================================================== 1 passed in 0.07s ==========================================================

@eshu-manohare
Copy link
Copy Markdown

hello @HanzCEO sorry for the delayed response on this thread. Is it possible for you to provide get_amount_out and get_amount_in logic too? Currently it is passed.

@HanzCEO
Copy link
Copy Markdown
Author

HanzCEO commented Sep 24, 2025

hello @HanzCEO sorry for the delayed response on this thread. Is it possible for you to provide get_amount_out and get_amount_in logic too? Currently it is passed.

Hi, this integration is still in draft. I have many changes that haven't been pushed yet. This PR is not ready for review.

@HanzCEO
Copy link
Copy Markdown
Author

HanzCEO commented Sep 24, 2025

Maybe you meant to review #26 (BrownFi)? @eshu-manohare

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.

2 participants