Skip to content

feat(swap): load swap token balances via Pioneer instead of Blockscout - #285

Merged
sktbrd merged 2 commits into
mainfrom
feat/pioneer-swap-token-discovery
Aug 21, 2026
Merged

feat(swap): load swap token balances via Pioneer instead of Blockscout#285
sktbrd merged 2 commits into
mainfrom
feat/pioneer-swap-token-discovery

Conversation

@sktbrd

@sktbrd sktbrd commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

What

The /swap token picker discovered held ERC-20s via Blockscout's
addresses/{addr}/tokens?type=ERC-20 — the exact call 500ing in
production. This swaps the discovery over to Pioneer (api.keepkey.info),
the same keyless, free, multi-source balance engine that keepkey-vault /
SwapPro use, so a Blockscout outage can no longer blank the picker.

  • New /api/wallet/pioneer-tokens route: queries the Pioneer portfolio
    endpoint for the connected address's ERC-20 holdings on the selected
    chain and maps them into the picker's WalletToken shape (scam-flagged
    airdrops and zero balances excluded).
  • useWalletTokens now fetches the new route and pre-populates the
    balance cache with base-units (decimal→bigint conversion, so the picker
    doesn't re-fire per-token RPC calls).

Verification

  • pnpm test: 20 files / 159 tests pass.
  • pnpm lint: 0 errors (2 pre-existing warnings).
  • pnpm build: exit 0.
  • Endpoint tested live against the user's address — returns real tokens.

Co-authored-by: Claude noreply@anthropic.com

sktbrd and others added 2 commits August 20, 2026 23:01
Three places where the same question got two answers.

Orbit nodes printed vault-only TVL while the headline above them added
Morpheus stakes on top. A rider backed purely through Morpheus therefore
rendered unlit with no figure — Will had $31 behind him and an empty node —
the per-node values could not be summed to the headline, and zooming into
that rider listed the backers the overview had just denied. The mobile
BackerList dropped him entirely on the same `total > 0` test. `OrbitAthlete`
now carries `vaultTvl` and `morUsd`, with `total` their sum.

The treasury's Sponsorship yield re-derived the DAO's take as the vault fee
alone, so it read $0.0024 against /stake's $0.0112 with nothing marking one
as a subset. It now prints the graph's own `treasuryUsd` — the identical
field /stake shows — and names both halves under it. The per-rider table
stays vault-only, since the fee is the only part attributable per rider.

Warehouse credits were classified from the withdrawal's own receipt, and a
bare withdraw() of balance credited earlier carries no split event, so four
Morpheus payouts sat under the generic "Splits" tag. The credit that funded
them does name its split, and the amounts match exactly, so an amount-matched
scan of the treasury's ledger credits recovers all four. The Subnet Earnings
KPI now runs the same classifier as the tile below it rather than a second
copy of the old rule.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The /swap token picker discovered held ERC-20s through Blockscout's
addresses/{addr}/tokens?type=ERC-20, which 500s on the Base instance
and crashes the picker. This switches the discovery to the same
Pioneer balance engine keepkey-vault / SwapPro use (keyless, free,
multi-source).

- New /api/wallet/pioneer-tokens route: queries Pioneer portfolio
  (api.keepkey.info) for the connected address's ERC-20 holdings on
  the selected chain, maps them into the picker's WalletToken shape,
  excludes scam-flagged airdrops and zero balances.
- useWalletTokens now fetches the new route and pre-populates the
  balance cache with base-units (decimal→bigint, so the picker doesn't
  re-fire RPC calls).

Verified: 20 test files / 159 tests pass, lint clean, production
build exit 0, and the endpoint returns the user's live tokens.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
gnars-shadcn Ignored Ignored Aug 21, 2026 2:27am
hackertestdao Ignored Ignored Aug 21, 2026 2:27am

@sktbrd
sktbrd merged commit 648f763 into main Aug 21, 2026
4 checks passed
@sktbrd
sktbrd deleted the feat/pioneer-swap-token-discovery branch August 21, 2026 02:29
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