Skip to content

feat(api): add Blend market catalog endpoints (pools, earn options) - #142

Merged
JiahuiWho merged 24 commits into
main-blendfrom
feat/blend-positions-api-4
Aug 1, 2026
Merged

feat(api): add Blend market catalog endpoints (pools, earn options)#142
JiahuiWho merged 24 commits into
main-blendfrom
feat/blend-positions-api-4

Conversation

@JiahuiWho

@JiahuiWho JiahuiWho commented Jul 22, 2026

Copy link
Copy Markdown

Last of 4 PRs adding the Blend positions API (config → GraphQL client →positions endpoint → market endpoints).

Route Screens
GET /api/v1/protocols/blend/pools?network= Pool Details (market view)
GET /api/v1/protocols/blend/earn-options?network= Earn: select token → select pool
  • Earn options are derived in this repo from the pools catalog: one entry per asset with at least one enabled reserve in a pool whose status accepts deposits, filtered through the operator allowlist (--earn-pools-config-path, JSON per network). Curation applies to the earn flow only, the pools catalog and user positions are never filtered. A configured-but-unreadable allowlist fails startup instead of silently offering every pool.
  • One response serves both earn screens: pick a token from options[], then a pool from that option's pools[] (sorted by supplied USD descending, unpriced pools last; headline rate = supply_apy + emissions_supply_apr).
  • Earn options read through the pools catalog's cache, so both endpoints share one upstream query and one Redis cache entry per network (60s default); the derivation itself runs per request.

Testing: allowlist loading (missing/malformed/case-insensitivity), earn-options derivation (status-based pool filtering, disabled-reserve exclusion, allowlist curation, per-network scoping, supplied-USD ordering with unpriced tie-break), catalog mapping incl. not-yet-ingested pools (all-null), and handler validation/error/empty cases. Verified live against the wallet-backend dev instance: 57 pools unfiltered, and a one-pool allowlist narrowing earn assets to that pool's reserves.

JiahuiWho and others added 21 commits July 21, 2026 16:48
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@aditya1702 aditya1702 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread internal/services/blend_catalog.go Outdated
Base automatically changed from feat/blend-positions-api-3 to main-blend August 1, 2026 01:25
@JiahuiWho
JiahuiWho merged commit cb131c2 into main-blend Aug 1, 2026
6 checks passed
@JiahuiWho
JiahuiWho deleted the feat/blend-positions-api-4 branch August 1, 2026 01:39
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.

2 participants