AMM Integration

To integrate your AMM:

Requirements

  • Factory contract address

  • Fee info

  • Pool type (V2, V3, custom)

Data structure

V2:

json{
  "pool": "0x...",
  "token0": "0x...",
  "token1": "0x...",
  "reserve0": "...",
  "reserve1": "...",
  "feeBps": 30
}

V3:

json{
  "pool": "0x...",
  "token0": "0x...",
  "token1": "0x...",
  "sqrtPriceX96": "...",
  "liquidity": "...",
  "tick": 0,
  "feeBps": 30
}

Integration steps

  1. Provide DEX details

  2. Compatibility check

  3. Add to system

  4. Route testing

Performance requirements

  • API response < 500 ms

  • Data freshness < 1 min

  • Min liquidity > $10,000

  • Stable contracts

Technical Details

Algorithms:

  • Bellman-Ford

  • Dynamic Programming

  • Weighted Distribution

Metrics:

  • Build time: ~200 ms

  • Accuracy: ±0.1%

  • Max routes: 5

  • Max hops: 4

Caching:

  • Pool states: 15–30 s refresh

  • Swap results: 10 s cache

  • Token symbols: persistent

Last updated