Skip to main content

Overview

Ekubo is a concentrated liquidity AMM (Automated Market Maker) on StarkNet, similar to Uniswap V3. Sable integrates Ekubo in the Apex vault to generate LP fees from market making.
Apex vault allocates 35% of deposits to Ekubo LP positions for maximum diversified yield.

What is Ekubo?

Ekubo is a next-generation DEX on StarkNet featuring:
  • Concentrated liquidity: LPs provide liquidity in specific price ranges
  • Capital efficiency: Higher returns per dollar of liquidity
  • LP fee generation: Earn fees from every swap
  • Multiple fee tiers: 0.01%, 0.05%, 0.3%, 1% fee pools

Key Features

  • Price Range Orders: Set custom min/max prices for your LP position
  • Auto-compounding: Fees can be auto-compounded into positions
  • Non-custodial: Users retain full control of liquidity
  • ERC-721 Positions: Each LP position is an NFT

How Sable Integrates with Ekubo

Sable uses Ekubo exclusively in the Apex vault as part of its multi-strategy approach.

Apex Vault Strategy

Risk Level: 5 (High)
Allocation:
┌──────────────────────────────────────┐
│        APEX VAULT ALLOCATION        │
├──────────────────────────────────────┤
│  40%  Vesu Leverage Lending        │
│       (PRIME pool, 3-5x loop)      │
├──────────────────────────────────────┤
│  35%  Ekubo LP                     │
│       (WBTC-ETH or WBTC-USDC)     │  ◄── EKUBO INTEGRATION
├──────────────────────────────────────┤
│  25%  Endur Staking                │
│       (xWBTC liquid staking)      │
└──────────────────────────────────────┘

LP Strategy Flow

Apex Ekubo Flow:
  1. User deposits WBTC to Apex vault
  2. Vault allocates 35% to Ekubo LP
  3. Vault creates concentrated liquidity position:
     ├── Pair: WBTC-ETH or WBTC-USDC
     ├── Range: ±10% around current price
     └── Fee tier: 0.3% (standard)
  4. LP position earns fees from swaps
  5. Fees auto-compound into vault

Yield Sources

The Ekubo LP component contributes to Apex’s overall yield:
ComponentYield
Vesu Leverage (40%)~15-20% APY
Ekubo LP (35%)~8-12% APY
Endur Staking (25%)~4-6% APY
Blended Total~12-15% APY

Concentrated Liquidity Basics

Unlike traditional AMMs (constant product x × y = k), Ekubo uses concentrated liquidity:

Traditional AMM

Liquidity spread across entire price curve (0 → ∞)
──────────────────────────────────────────

       │    ┌─────────────────
       │   ┌┘ Thin liquidity everywhere
       │  ┌┘
       │ ┌┘
───────┼──────────────────────────────────
       0               Price

Concentrated Liquidity (Ekubo)

Liquidity concentrated in active price range
──────────────────────────────────────────

       │           ┏━━━━━━━━┓
       │           ┃ Thick  ┃ Deep liquidity in range
       │           ┃ liq.   ┃ = more fees earned
       │           ┗━━━━━━━━┛
───────┼───────────┼─────────┼────────────
       0            Min      Max    Price
Benefits:
  • Higher capital efficiency: Same fees with less capital
  • Better for LPs: Earn more per dollar deposited
  • Better for traders: Tighter spreads, less slippage

LP Fee Generation

Ekubo LPs earn fees from every swap that passes through their liquidity range.

Fee Structure

Fee TierUse CaseExample Pair
0.01%Stablecoin pairsUSDC-USDT
0.05%Correlated assetsETH-wstETH
0.3%Standard pairsWBTC-ETH
1%Exotic/volatile pairsLow-volume tokens
Apex vault uses the 0.3% fee tier for WBTC-ETH or WBTC-USDC pairs.

Fee Calculation Example

LP Position:   1 WBTC + 100 ETH in WBTC-ETH pool
Daily Volume:  $10,000,000 through your range
Fee Tier:      0.3%
Your Share:    0.5% of pool liquidity

Daily Fees = $10M × 0.3% × 0.5% = $150/day
Annual Fees = $150 × 365 = $54,750/year

Position Value:  $200,000
LP APY:          $54,750 / $200,000 = 27.4% APY
Actual APY depends on trading volume, pool utilization, and how much of the volume passes through your specific price range.

Impermanent Loss Considerations

Concentrated liquidity positions are exposed to impermanent loss (IL) when prices move outside the range.

What is Impermanent Loss?

Scenario:
  LP deposits:  1 WBTC ($100k) + 100 ETH ($100k)
  Total value:  $200k
  
  BTC doubles in price:
    LP position rebalances to ~0.7 WBTC + 141 ETH
    Value: $210k (would be $220k if you just held)
    IL: -$10k (-4.5%)

IL is "impermanent" because it disappears if price returns to original level.

Apex Vault IL Mitigation

  1. Tight price ranges: ±10% reduces IL exposure
  2. Fee income offsets IL: High volume pairs generate fees faster than IL accrues
  3. Correlated pairs: WBTC-ETH moves relatively in sync, reducing IL
  4. Diversification: Only 35% of Apex is exposed to IL risk

Contract Integration

Apex vault interacts with Ekubo to manage LP positions.
// Simplified Cairo pseudocode

#[external(v0)]
fn deploy_to_ekubo(wbtc_amount: u256) {
    // Calculate pair amounts (e.g., 50/50 WBTC-ETH)
    let eth_amount = calculate_pair_amount(wbtc_amount);
    
    // Approve tokens to Ekubo pool
    wbtc.approve(ekubo_pool, wbtc_amount);
    eth.approve(ekubo_pool, eth_amount);
    
    // Create concentrated liquidity position
    let position_nft = ekubo_pool.mint(
        wbtc_address,
        eth_address,
        fee_tier: 3000,        // 0.3% fee
        tick_lower: -2000,     // Min price
        tick_upper: 2000,      // Max price
        amount0: wbtc_amount,
        amount1: eth_amount
    );
    
    // Store position NFT ID
    self.ekubo_position.write(position_nft);
}

#[external(v0)]
fn withdraw_from_ekubo() {
    let position_nft = self.ekubo_position.read();
    
    // Collect accrued fees
    ekubo_pool.collect(position_nft);
    
    // Remove liquidity
    let (wbtc_out, eth_out) = ekubo_pool.burn(
        position_nft,
        liquidity: full_amount
    );
}

Which Sable Features Use Ekubo?

Apex Vault

35% Ekubo LP AllocationApex is the only Sable vault that uses Ekubo.
  • Pair: WBTC-ETH or WBTC-USDC
  • Fee tier: 0.3%
  • Range: ±10% around current price
  • Yield: ~8-12% APY from LP fees
  • Risk: Impermanent loss exposure

Frontend Integration

Sable displays Ekubo LP yield in the Apex vault APY breakdown.
// From: ~/workspace/source/src/lib/api/vaults.ts

const apexApy = {
  vesuvLeverage: 18.5,  // 40% allocation
  ekuboLP: 10.2,        // 35% allocation
  endurStaking: 4.8,    // 25% allocation
  
  // Weighted average
  total: (18.5 * 0.4) + (10.2 * 0.35) + (4.8 * 0.25),
  // = 7.4 + 3.57 + 1.2 = 12.17% APY
};

Risk Considerations

Benefits

  • High APY: LP fees can exceed base staking/lending yields
  • Diversification: Reduces correlation risk with pure lending strategies
  • Market making revenue: Earn from trading volume

Risks

  • Impermanent Loss: Price divergence reduces returns
  • Smart contract risk: Ekubo protocol vulnerabilities
  • Range management: If price moves out of range, no fees earned
  • Complexity: Multi-asset LP positions harder to unwind

External Resources

Ekubo Documentation

Official Ekubo protocol documentation

Ekubo App

Ekubo DEX and LP interface

Concentrated Liquidity Guide

Learn more about concentrated liquidity mechanics

Integration Source Code: ~/workspace/source/contracts/src/apex.cairo

Build docs developers (and LLMs) love