Skip to content

feat(earn): scaffold Solana Earn module (SDP Markets V1) - WIP - #831

Draft
keeganthomp wants to merge 7 commits into
mainfrom
earn-initial
Draft

feat(earn): scaffold Solana Earn module (SDP Markets V1) - WIP#831
keeganthomp wants to merge 7 commits into
mainfrom
earn-initial

Conversation

@keeganthomp

Copy link
Copy Markdown

Exploratory scaffold of the Earn deposit facility for ideation — shape review, not production wiring:

  • @sdp/earn domain package: EarnVaultProvider contract, fail-closed provider registry (Veda/Upshift/Perena/Ground stubs), NAV fixed-point math with unit tests
  • @sdp/types: earn wire DTOs + registries (source kinds, APY types, liquidity terms), earn provider family + entitlements, earn:read/ earn:write permissions, curator label registry
  • sdp-api: /v1/earn route family behind EARN_ENABLED (strategy catalogue, positions, movements, deposit/withdraw quotes), migration 0034 (earn_strategies/positions/movements/nav_snapshots), earn repository, provider-availability wiring incl. exit-safe withdrawal gating (assertEarnProviderConfigured)
  • sdp-web: /dashboard/earn behind NEXT_PUBLIC_EARN_ENABLED (default-on in local dev) — mock-data overview, 4-step deposit wizard (risk profile, strategy + curator filter, amount + yield preview, review), withdraw modal with instant vs T+n redemption semantics, pending redemptions strip; mock fixtures are the single data seam for the later swap to live /v1/earn data
  • docs: ADR 0002 — provider/curator pluggability, enable/disable layers, and the money-out-beats-money-off invariant

Deliberately deferred: deposit/withdraw execution endpoints, webhook processors, NAV cron, OpenAPI/public-docs registration, real provider HTTP clients.

@vercel

vercel Bot commented Jul 21, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
sdp-docs Ready Ready Preview Jul 31, 2026 8:35pm
sdp-web Ready Ready Preview Jul 31, 2026 8:35pm

Request Review

Exploratory scaffold of the Earn deposit facility for ideation — shape
review, not production wiring:

- @sdp/earn domain package: EarnVaultProvider contract, fail-closed
  provider registry (Veda/Upshift/Perena/Ground stubs), NAV fixed-point
  math with unit tests
- @sdp/types: earn wire DTOs + registries (source kinds, APY types,
  liquidity terms), earn provider family + entitlements, earn:read/
  earn:write permissions, curator label registry
- sdp-api: /v1/earn route family behind EARN_ENABLED (strategy
  catalogue, positions, movements, deposit/withdraw quotes), migration
  0034 (earn_strategies/positions/movements/nav_snapshots), earn
  repository, provider-availability wiring incl. exit-safe withdrawal
  gating (assertEarnProviderConfigured)
- sdp-web: /dashboard/earn behind NEXT_PUBLIC_EARN_ENABLED (default-on
  in local dev) — mock-data overview, 4-step deposit wizard (risk
  profile, strategy + curator filter, amount + yield preview, review),
  withdraw modal with instant vs T+n redemption semantics, pending
  redemptions strip; mock fixtures are the single data seam for the
  later swap to live /v1/earn data
- docs: ADR 0002 — provider/curator pluggability, enable/disable
  layers, and the money-out-beats-money-off invariant

Deliberately deferred: deposit/withdraw execution endpoints, webhook
processors, NAV cron, OpenAPI/public-docs registration, real provider
HTTP clients.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ecture doc

Coverage-audit follow-ups against the updated Earn product doc
(partner-call notes):

- Mock catalogue: add Figure PRIME (the doc's own display example),
  Galaxy Sweep Intraday (PYUSD deposits), and BAGEY Credit with the
  mixed-liquidity shape rendered as "10% intraday / rest T+2"
- Known-sources registry: figure-prime, bagey, usde, aaa-clo
- Withdraw modal: disclose the full-utilization edge case on instant
  DeFi redemptions (doc's T&C caveat) instead of overpromising
- EN + FR catalogs for the new liquidity/caveat copy
- docs/architecture/earn-v1-data-flow.md: mermaid system-context +
  deposit-sequence diagrams, source-of-truth table per surface
  (catalogue/NAV/positions/movements), the existing-SDP reuse map
  (auth, custody signing, Kora fees, RPC relay, Helius DAS, webhooks,
  cron, idempotency, compliance, policies, audit), net-new component
  list, and the no-new-indexer call for V1

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…feedback)

- Rename dashboard nav to Markets with Earn nested under it (Payments-style
  group); move routes /dashboard/earn/* → /dashboard/markets/earn/* (+ BFF,
  nav-loading map, shell page config/skeletons/viewport, feature gate, EN/FR).
  API family stays /v1/earn (public-family rename remains the open decision).
- Deposit wizard: Single strategy / Split allocation toggle (Ground-style) —
  multi-select strategies with per-leg %, auto even-split, 100% validation,
  Distribute-evenly; confirm creates one position per leg with blended yield.
- Deposit wizard: SDP wallet / BYOK funding-source toggle — BYOK takes an
  external Solana address (validated) with the sign-and-return helper copy;
  no balance ceiling, address flows through as the funding wallet.
- Confirm USDC/USDG/USDT as day-one deposit stablecoins (drop USDT "?").
- Refactor wizard into deriveDeposit() + WizardStepBody to keep complexity
  under the biome limit.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Generalize the sidebar's sub-nav disclosure from a hardwired payments
special case to keyed groups (SUBNAV_IDS + NavItem.subnavKey): chevron
toggle, per-group open state with localStorage persistence, and
aria-expanded/aria-controls wiring now apply to any group. Markets opts
in with its single Earn child; Payments behavior is unchanged (same
storage key). Replace the Payments-specific expand/collapse aria copy
with a parameterized "{section} menu" pair in EN + FR.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
# Conflicts:
#	apps/sdp-web/.env.local.example
#	apps/sdp-web/src/components/dashboard-shell.tsx
#	docs/architecture/module-map.md
#	packages/sdp-types/src/provider-access.ts
#	scripts/render-wrangler-config.test.mjs
#	scripts/secret-keys.mjs
#	turbo.json
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