fix(defi-portfolio-scanner): correct HODLMM pool detection for current API shape#614
Open
gregoryford963-sys wants to merge 1 commit into
Conversation
…t API shape
The Bitflow /pools endpoint returns { data: [...] } but scanBitflow read
pools?.results, which is always undefined, so poolList was always empty
and the per-pool bins query never ran.
Three additional field-name mismatches with the current API response:
- Pool ID is poolId (camelCase), not id or pool_id
- Token symbols live at pool.tokens.tokenX/Y.symbol, not token_a/b_symbol
- DLMM pool token contracts contain "dlmm" in the contract name, not
"bitflow" or "hodlmm", so the Hiro fallback filter silently skipped them
Fixes BitflowFinance#613
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
✅ Validation PassedSkill: All checks passed. This submission is ready for review. |
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #613.
What broke and why
scanBitflow()never detected any HODLMM positions due to four field-name mismatches between the scanner code and the current Bitflow API response shape.Changes
1. Pools response key:
results→dataThe
/api/app/v1/poolsendpoint returns{ data: [...], hasMore, nextCursor }. The scanner readpools?.results, which isundefined, sopoolListwas always[]and the per-pool bins query never executed.2. Pool ID field:
poolId(camelCase)Each pool object uses
poolId, notidorpool_id.3. Token symbols:
pool.tokens.tokenX/Y.symbolCurrent API nests symbols under
tokens.tokenX.symbol/tokens.tokenY.symbol.4. Hiro fallback filter: add
"dlmm"DLMM pool token contracts (
SM1FKXGNZJWSTWDWXQZJNF7B5TV5ZB235JTCXYXKD.dlmm-pool-stx-usdcx-v-1-bps-10::pool-token) contain"dlmm"but not"bitflow"or"hodlmm", so the safety-net fallback silently skipped them.Test plan
scan --address <address-with-dlmm-lp>and confirmprotocols.bitflow.positionsis non-emptytokenA/tokenBshow correct symbols (e.g.STX/USDCx) instead of"?"positions: []still returned cleanlysummary— confirmprotocolBreakdown.Bitflow HODLMMshows non-zeroestimatedUsdfor active LP holders🤖 Generated with Claude Code