Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Liquidity

Who it's for: Passive investors and active market makers who want to earn fees from cGHS trading activity without managing individual trades. Why it matters: Providing liquidity to the GHS pair generates fee income while directly supporting price stability and trade execution for every user on the platform.

Two types of liquidity provision in the JIT system:

TypeMechanismWho uses it
Standard LPPersistent range positions via PositionManagerPassive LPs
JIT RebalancerShared pool — fallback for large swaps with no matching offerMarket makers

Standard LP Positions

POST /liquidity/add

Mint a new LP range position.

Request
{
  "lpAddressId": "wallet-uuid",
  "lpAddress": "0xabc...",
  "token0": "0x3126627A607E730E3eCF9BbfFD67fa18Deaab846",
  "token1": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
  "tickLower": -27360,
  "tickUpper": -27120,
  "amount0Desired": "5000000000",
  "amount1Desired": "325000000",
  "amount0Min": "4900000000",
  "amount1Min": "320000000"
}

Ticks must be multiples of 10 (tick spacing). Service computes liquidityDelta from current pool price.

Transaction batch: [approve(positionManager, amount0), approve(positionManager, amount1), mintPosition(...)]

Response: { "id": "uuid", "status": "pending", "liquidity": "..." } (202)

On confirmation the workflow decodes the Transfer event from PositionManager to record the tokenId.


POST /liquidity/remove

Decrease liquidity from an existing position.

{
  "lpAddressId": "wallet-uuid",
  "lpAddress": "0xabc...",
  "tokenId": "42",
  "liquidity": "1000000000000000000",
  "amount0Min": "0",
  "amount1Min": "0"
}

GET /liquidity/positions/:address

All active LP positions with live on-chain state.

GET /liquidity/position/:tokenId

{
  "tracking": { "id": "uuid", "status": "active", "tokenId": "42" },
  "onchain": {
    "tickLower": -27360,
    "tickUpper": -27120,
    "liquidity": "1000000000000000000"
  }
}

JIT Rebalancer Pool

The JITRebalancer at 0x64b7DeD624377Dc0eE5050b3B457814b2b94C5d5 holds shared liquidity used as a flash-JIT fallback. Depositors earn fees from large swaps that route through it.

POST /rebalancer/:rebalancerAddress/deposit

{
  "depositorAddressId": "wallet-uuid",
  "depositorAddress": "0xabc...",
  "amount0": "10000000000",
  "amount1": "650000000"
}

Default rebalancer: 0x64b7DeD624377Dc0eE5050b3B457814b2b94C5d5

POST /rebalancer/:rebalancerAddress/withdraw

{
  "depositorAddressId": "wallet-uuid",
  "depositorAddress": "0xabc...",
  "shareAmount": "1000000"
}

GET /rebalancer/:rebalancerAddress

{
  "token0": "0x3126...",
  "token1": "0x833...",
  "totalDepositedToken0": "100000000000",
  "totalDepositedToken1": "6500000000",
  "totalShares": "50000000",
  "currentPrice": "0.065",
  "priceFeed": "0xaa1..."
}