Skip to content

feat(clmm): bin_count on get_pool_info (1.5.8) - #25

Open
fengtality wants to merge 1 commit into
mainfrom
feat/clmm-bin-count
Open

feat(clmm): bin_count on get_pool_info (1.5.8)#25
fengtality wants to merge 1 commit into
mainfrom
feat/clmm-bin-count

Conversation

@fengtality

@fengtality fengtality commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds bin_count to gateway_clmm.get_pool_info so callers can request a pool's per-tick liquidity distribution, and bumps the package to 1.5.8.

Until now the method could not ask for bins at all. Meteora returns its own bins unconditionally, so it appeared to work — but every other CLMM connector computes them only on request, and there was no way to make that request through the client. Callers who wanted bins had to bypass the typed method and hit the endpoint directly.

pool_info = await client.gateway_clmm.get_pool_info(
    connector="orca",
    network="solana-mainnet-beta",
    pool_address="Czfq3xZZDmsdGdUyrNLtRhGc47cXcZtLG4crryfu44zE",
    bin_count=61,      # 0 (default) skips the extra on-chain reads
)

The parameter is only sent when non-zero, so existing calls are byte-identical on the wire.

Also drops a stale note in the docstring claiming Raydium returns 400 for Standard AMM pools — that behaviour came from hummingbot-api's direct-Raydium-API path, which hummingbot/hummingbot-api#217 removes in favour of routing every CLMM connector through Gateway.

Requires

bin_count is forwarded by hummingbot/hummingbot-api#217 to Gateway's unified /trading/clmm/pool-info, which learns binCount in hummingbot/gateway#679. Against an older API server the parameter is ignored, not an error.

Companion PRs

Validation

Verified against a live mainnet stack (Gateway + hummingbot-api deployed from the companion branches): bin_count=61 returns 61 populated bins for orca, raydium, uniswap and pancakeswap, while Meteora keeps returning its own 141 and ignores the parameter. bin_count=0 returns none for all of them.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Mt84XBEMVxbbyMG8fDxDKj

get_pool_info could not request the per-tick liquidity distribution, so
callers wanting bins had to bypass the client and hit the endpoint directly.
It now forwards bin_count, which hummingbot-api passes to Gateway. Meteora
always returns its bins and ignores it; orca, raydium, uniswap and
pancakeswap compute them on request, so the default of 0 keeps pool-info
cheap.

Also drops the stale note about Raydium rejecting Standard AMM pools — that
came from hummingbot-api's direct-Raydium-API path, which has been removed in
favour of routing every CLMM connector through Gateway.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant