Skip to content

Architecture ​

This is the orientation doc. Read it first, then follow the links out to the deeper references: Database & schema, Data pipeline & refreshers, Metrics: how & why (every formula and the reasoning), Deployment & server ops, Operational processes, and External dependencies. The concise top-level handoff is AGENTS.md at the repo root (CLAUDE.md just re-exports it).

What creddit is ​

creddit is an institutional analytics terminal for yield-bearing collateral in onchain lending protocols. It translates DeFi risk and yield mechanics into the vocabulary a TradFi credit analyst already uses — carry spreads, Sharpe, SOFR comparison, named comparable issuers — so a credit officer at a bank, fund, or RWA desk can underwrite a DeFi position without first learning DeFi.

It is a live, data-driven product, not a mock-up. There is no rating or risk-grading framework in the surface today, and no forward references to unbuilt memo-style content. The terminal aesthetic is deliberate: tabular numerals, 1px borders, color only for meaning (gains/losses, chart series, the single amber accent), top-to-bottom memo reading over panel-jumping. All monetary and percent values pass through the formatters in src/lib/format.ts.

The end-to-end system ​

                          WRITE PATH (off-chain, cron)                          READ PATH (request-time)
  ┌────────────┐   ┌──────────────┐   ┌─────────────┐         ┌────────────────────┐   ┌──────────────┐
  │ Ethereum   │   │ DefiLlama /  │   │  Dune /     │         │ Next.js page       │   │ Browser      │
  │ RPC + arch │──▶│ NY Fed SOFR /│──▶│  Morpho /   │         │ (Server Component, │   │ (client      │
  │ (eth_call, │   │ Llama prices │   │  Euler subg │         │  per-page ISR)     │   │  components)  │
  │  storage)  │   └──────┬───────┘   └──────┬──────┘         └─────────┬──────────┘   └──────┬───────┘
  └─────┬──────┘          │                  │                          │                     │
        ▼                 ▼                  ▼                          │ query() (read-only) │ fetch()
  ┌──────────────────────────────────────────────┐                     ▼                     ▼
  │ scripts/refreshers/*  (run-cron.sh, 6h/d/wk)  │              ┌──────────────┐      ┌──────────────┐
  │  upsert into onchain_credit.* (30+ tables)    │─────────────▶│  PostgreSQL  │◀─────│ api/* routes │
  └──────────────────────────────────────────────┘              │  schema      │      │ (notify /    │
                                                                 │ onchain_credit│      │  newsletter) │
                                                                 └──────────────┘      └──────────────┘
  • Write path (off-chain, scheduled): scripts/refreshers/* read on-chain state plus a few external APIs, annualise every yield with one shared convention, and upsert snapshots into the onchain_credit Postgres schema. The app never writes time-series data. Full detail in Data pipeline.
  • Read path (request-time): pages are Server Components with per-page ISR. They read Postgres read-only through the typed query() wrapper, do any live "now" reads via RPC, and render server HTML. Client components hydrate only for interactivity (sorting, chart range, the simulator, the oracle modal).
  • Browser → API: the few interactive surfaces that need server work at request time hit src/app/api/* routes (oracle card, carry-history series, swap-cost quote, email captures).

Tech stack ​

LayerTechnologyNotes
FrameworkNext.js 16 (App Router, Turbopack)Server Components by default; "use client" only where the browser is genuinely needed. Per-page ISR (revalidate 1800 or 3600).
LanguageTypeScript (strict)npx tsc --noEmit must be clean.
StylingTailwind CSS v4@theme inline design tokens in src/app/globals.css; @tailwindcss/postcss.
UI primitivesBase UI (@base-ui/react), not RadixWrapped with project Tailwind classes in src/components/ui/*.
ChartsRecharts 3Used directly by each chart component (no shared wrapper); client-only, and next/dynamic({ ssr: false }) with a height-reserving placeholder wherever the chart is behind an interaction (a row expansion, the strategies Compare, the portfolio dashboard) so recharts stays out of that surface's first-load JS.
DatabasePostgreSQL via pgSingle typed query() wrapper, app is read-only against the data.
On-chainviem + raw eth_callRead helpers in src/lib/data/rpc.ts / rpc-batch.ts.
FontsGeist Sans (prose) + Geist Mono (numerics) + JetBrains Mono (display figures) + Archivo 700 (logo)All loaded via next/font/google in src/app/layout.tsx, self-hosted.

Security response headers (HSTS, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Permissions-Policy, and a Report-Only CSP) and poweredByHeader: false are set centrally in next.config.ts via an async headers() block over /:path*; there is no middleware.ts. See Deployment → Security response headers for the header table, the CSP rollout (Report-Only first, then flip to enforcing), and verification.

The read path in detail ​

Every section page (src/app/(app)/<section>/page.tsx) is an async Server Component:

  1. It calls one or more readers in src/lib/data/* (e.g. carries-table.ts, money-market-rates.ts, strategies-table.ts, assets-table.ts).

  2. Those readers run SQL through query() from src/lib/data/postgres.ts — a thin typed wrapper over a shared pg Pool (max PG_POOL_MAX, default 12; connection string from DATABASE_URL). The pool size is env-tunable because the deploy build prerenders across worker processes that each open their own pool: the deploy workflows lower it to 4 for the build so the workers do not collectively exhaust the role's connection cap (see Deployment §2.1). The app holds only SELECT privilege on the data tables (writes are limited to the two email-capture API routes).

  3. Where a page needs a live "now" value (e.g. a current on-chain rate the 6h snapshot cadence wouldn't show), it reads it just-in-time via RPC through src/lib/data/rpc.ts: ethCall (current-state, latest), ethCallAt / ethGetStorageAt (archive, historical block), blockByTimestamp / getBlockTimestamp. These reads are cached via the Next fetch cache (next: { revalidate }).

    A token's USD price is never fetched from a vendor at render. A page that needs one (the /carries simulator's position-size readout and its borrowable figures) reads the newest stored hourly bar through usdPricesAt (src/lib/data/usd-at.ts), the price every six-hourly job and the Portfolio's stored history state for the same token at that hour (One stored price per token per hour). A composed token (a savings wrapper, a PT) is priced through its rate at the chain head. That costs one eth_blockNumber per render to find the head, plus an archive eth_call per composed token for its rate (readRateAt) and a Pendle TWAP read per PT, at every ISR render and once more in the build's prerender. A base asset (WETH, WBTC) with no bar in 48 hours shows a dash in those readouts, never a stand-in price.

  4. The page renders server HTML. Per-page ISR re-runs the readers on the revalidate interval; the prerendered page is otherwise served as-is.

ISR windows by page:

Routerevalidate
/1800 (30 min)
/repo-lending1800 (30 min)
/carries3600 (60 min)
/money-market-funds1800 (30 min)
/multi-strategy-funds1800 (30 min)
/asset-profiles3600 (60 min)

Route loading states: the five data routes above (/repo-lending, /carries, /money-market-funds, /multi-strategy-funds, /asset-profiles) each ship a loading.tsx that renders a table-shaped skeleton (RouteLoadingSkeleton) while the Server Component awaits its readers, so a client-side navigation paints the page chrome immediately instead of a blank frame. It is a visual fallback only, with no effect on metadata/SEO. /portfolio is an instant static shell (its data loads client-side, post-hydration) and intentionally has none.

Two RPC env vars back the on-chain reads (defaults are unset-env fallbacks; prod points both at a paid provider):

  • ETHEREUM_RPC_URL — current state, default https://ethereum-rpc.publicnode.com.
  • ETHEREUM_ARCHIVE_RPC_URL — historical/archive, default https://eth.drpc.org.

ISR + prerender gotcha: pages are prerendered at build time. If a refresher writes new data after a deploy build, the page can serve stale values for up to its revalidate window. Re-running the deploy re-prerenders.

The write path at a glance ​

Off-chain refreshers populate Postgres on a cron cadence; the app only reads. Each job is invoked through scripts/run-cron.sh <script>.ts, which sources .env.local, runs the script with tsx, and logs to /tmp/onchain-credit-cron/. The canonical entry points live at scripts/refresh-*.ts and delegate into scripts/refreshers/*. Server crontab (all UTC):

ScheduleJobCadence
0 */6 * * *run-cron.sh refresh-assets.tsevery 6h
15 */6 * * *run-cron.sh refresh-vault-capacity.tsevery 6h
30 */6 * * *run-cron.sh refresh-collateral-exposure.tsevery 6h
45 */6 * * *run-cron.sh refresh-lending-positions.tsevery 6h
50 */6 * * *run-cron.sh refresh-portfolio.tsevery 6h (read-only portfolio spine + flow ledger)
* * * * *run-cron.sh drain-portfolio-backfills.tsminutely (WS5 registration-backfill queue drain; no-op when empty)
30 3 * * *run-cron.sh refresh-vault-risk.tsdaily, 03:30
30 4 * * 1run-cron.sh sync-portfolio-tokens.tsweekly, Mon 04:30 (supported-product portfolio coverage audit; detection/proposals + WS8 alert only, no registry writes)
0 5 * * 1run-cron.sh refresh-token-market.tsweekly, Mon 05:00 (the pricing categories' market limb: trading days on chain, the median daily volume the price vendor reports across exchanges and DEXes (with the on-chain median stored beside it), and the deepest single pool holding the token against an asset of its own book or against a recognised counter of that book (a dollar stable at par, or ether and its liquid wrappers); appends readings, proposes nothing)
0 13 * * 1-5run-cron.sh refresh-sofr.tsweekdays 13:00
15 2 * * *ops/backup-creddit.shdaily DB backup, 02:15
hourlydisk-usage alerthourly

backfill-*.ts and the ad-hoc sync-*.ts scripts (sync-carries.ts, sync-curator-vaults.ts, backfill-fluid-core.ts) are manual, not crons — the one exception is sync-portfolio-tokens.ts above, a weekly coverage audit that powers the WS8 proposal digest. It never applies registry changes, and its retired --approve path refuses before database access; approved changes follow the existing onboarding checklist. The full job-by-job breakdown — what each reads, what it writes, the formulas — is in Data pipeline.

One APY convention ​

Every trailing APY in the app is annualizeRatio from src/lib/data/apy.ts: the realised ratio of an on-chain compounding index between two blocks, annualised by the actual elapsed time between their timestamps. Never average per-snapshot annualised rates (that overstates the compounded return). The same convention is applied across every venue so /carries compares like-for-like. See Metrics: how & why.

One liquidation-threshold reader ​

A carry's liquidation threshold is stated in two places, the oracle card and the screener's expanded row, and both take it from one reader, readLiquidationThreshold in src/lib/data/liquidation-threshold.ts (#982): a Fluid vault's own settings (the collateral factor is the max LTV, the liquidation threshold is the next word), an Aave or Spark e-mode category's config, a Morpho market's LLTV (both at once). Two freshness levels:

  • The card reads the chain when it opens: the reader's call rides in the card's own Multicall3 batch (oracle-card-reads.ts), behind the 30-minute rpc cache.
  • The screener reads a stored copy, vault_risk_params, which refresh-vault-risk.ts writes daily for every listed carry (registry-driven, keyed by the live strategy key) and sync-carries.ts --approve writes the moment a carry lists. A carry with no stored row shows its threshold as a dash; its max LTV falls back to the registry's ltv because it sizes the leverage, and is never shown as the threshold.

The weekly check-oracle-cards.ts (Monday 04:45, after the 03:30 refresh) holds the stored copy against a live read through the same reader and prints a [warn] line where, at its run, they differ, so a failed or missed refresh does not go unnoticed. The refresh also pages on its own when a run reads nothing (every read failed, or more than the shared 10% floor). Between refreshes the two can differ for up to a day: a threshold that governance moves shows on the card at once and on the screener after the next daily refresh.

Event ledger (portfolio 100k scale) ​

Alongside the crons runs one always-on process, the event-ledger ingester (scripts/ingester/ingest-events.ts, PM2 creddit-event-ingester) — the wallet-count-independent spine that lets the portfolio serve up to 100k registered wallets. Where the per-wallet chain scans it replaced put every registered wallet into an eth_getLogs topic (which hard-fails at ~1-2k wallets), the ingester scans the tracked contracts + the Fluid chain-wide streams by contract address + event topic0 only, so nothing about it scales with wallet count. It appends every such log into onchain_credit.raw_events (range-partitioned by block) and maintains a per-contract coverage certificate in event_coverage. The scan surface is derived each cycle from the SAME registries the venue readers use (trackedContracts(reg, vaults)), so the reader universe and the event universe cannot drift. 100k-scale plan: the ingester writes the ledger; the venue readers stay the balance-of-record. The 6h cron CONSUMES that ledger and nothing else: it derives every wallet's receipts from the event store and re-reads only the wallets the store says moved, recomposing the rest. The per-venue chain scanners it replaced, the shadow-mode comparison that proved the two equivalent and the flag that switched between them are all deleted. Ops: Data pipeline → event ledger ingester

Routes ​

Pages ​

RoutePageWhat it is
/HomeSingle-viewport landing on a black ground: the curved mark and lowercase creddit wordmark above an inset divider, a centred two-line headline at a restrained responsive scale, "One terminal to navigate onchain fixed income." and a scaled-up teal Launch app button into /portfolio (the shared clipped-corner design and arrow). A horizontal four-step sequence (Source, Understand, Execute, Track; Execute tagged Coming soon) sits below, with each square centred above its step name. A steel-to-teal line starts at Source, passes through Track and ends with the same inset from the right edge as Source has from the left; a 160px highlight travels left to right over 2.8 seconds and flashes each marker as it passes. Each matching title reveals a pale mint highlight from left to right over 280ms, then fades back over 280ms, sharing its marker's timing. The line resyncs after font loading and resizing. Reduced motion leaves the line, markers and titles static. Desktop (at least 1024 × 640) fits one screen; at 900px and below the sequence becomes two columns with static markers and no line. The footer carries X, Telegram and the copyright line. Rendered outside the app shell (no sidebar, no mobile nav, no access gate); every other page lives in the (app) route group, whose layout carries the shell and the gate. The shell's brand logo returns to /.
/portfolioPortfolioRead-only position monitor gated by wallet sign-in. Prerendered PUBLIC shell (route metadata + JSON-LD, indexable); a "use client" PortfolioClient probes /api/auth/me and renders either the signed-out landing (PortfolioLanding: headline + Connect CTA, a Sign in with Ethereum note, an animated SAMPLE PnL chart, four highlights) or the signed-in portfolio view. Per-user data flows only through authenticated APIs, never the shell.
/repo-lendingRepo LendingUSDC / USDT / USDS / PYUSD / RLUSD / USDtb / GHO / ETH supply rates across Fluid, SparkLend, Aave v3, plus the Morpho Blue isolated markets a human approved for the page (processes A.8), with a two-value market-structure Type column (Pooled, Isolated). The Market column names the venue alone (an isolated market's twins add their LLTV underneath); an Exposure column after Type shows what the market lends against: an isolated market's one collateral by coin and name, a pooled market's three largest collaterals as coin marks plus a +N for the rest, with no hover breakdown since the expanded row lists every collateral with its share. The rates chart's hover readout is pinned to the top of the plot and stacks its lines in columns of ten, so it never extends past the chart. The deposit-asset set is MONEY_MARKET_ASSETS in the client-safe money-market-assets.ts, which also holds each venue's address for an asset (Fluid keys ETH as native ether, the others lend WETH), its unit (the ETH tab reads in ether) and its benchmark (SOFR on the dollar tabs, Lido staking on ETH); the venue matrix is ragged (SparkLend has no GHO or USDtb reserve, Fluid has no PYUSD or RLUSD, and Aave's GHO reserve is deliberately excluded because it compensates no third-party supplier and prices off a flat governance-set curve) and a venue whose book is empty is dropped rather than shown as a row of dashes.
/carriesCarry TradesCross-protocol carry-trade screener (Fluid T1–T4, Aave v3 / SparkLend e-mode, incl. Pendle-PT term carries with maturity-clamped simulation): collateral vs funding APY, net carry, vol, max-lev carry; expandable Trade analytics tabs with a shared date window and axes fitted to it, return leverage slider, funding utilization and collateral basis; a live executable-basis quote modal; a live PnL simulator; per-strategy oracle transparency; auto-discovery of ≥$100k Fluid vaults from a registry.
/money-market-fundsMoney Market FundsScreener of open-ended, single-asset, lend-only Morpho vaults on Ethereum mainnet, both vault generations (MetaMorpho V1 and Vaults V2). Eight columns: fund (the manager with its brand mark, over the fund's own name with the manager's words dropped and its vault generation kept), deposit asset, TVL in the asset switch's own unit, exposure (the three collaterals the fund lends most against as coin marks and a +N for the rest; hovering the coins opens a breakdown of the five largest, each with its share of the whole fund), liquidity as a share of the fund, the fee, the timelock summary, and realised APY on a 24h/7d/30d switch. Five filters (manager, asset, collateral with an include/exclude mode and a match-permitted-too switch, minimum TVL, deposit permissioning). Each row expands to the three questions a yield figure cannot answer: what the fund holds (a per-market allocation table with caps, headroom, market utilization and, on V1, public-allocator flow caps and JIT depth), whether a depositor can get out (withdrawable now split into cash and markets, what is not redeemable today, depositor concentration), and who can change either (roles, per-action notice periods, submitted changes, adapters, caps and deposit gates, branched on vault generation). Above them a chart card with three metric tabs (total return against SOFR or the Aave v3 supply index, APY, TVL) on five range pills.
/multi-strategy-fundsMulti-Strategy FundsPerformance tracker for ETH/USD yield funds whose manager runs a broad mandate (share-rate history, TVL, per-denomination benchmark spread against SOFR or wstETH), over an always-on peer chart comparing every visible fund's realised return from a common start. Each row expands to a detail zone over a chart card: a short strategy brief with its yield-source categories beside a statistics tower of rate type, drawdown, track record, fees, redemption terms and the vault platform the fund runs on, above a per-fund chart that fills and measures the gap to the benchmark.
/asset-profilesAsset ProfilesScreener of yield-bearing collateral: issuer, category, trailing APY, YTD and 1Y returns. Every listed asset has a profile record on the register and expands to the profile (classification, yield source, historical performance, loss waterfall and risks, liquidity, references; the plan); a profile that cannot be assembled shows unavailable details.

The five section rows are listed in Explore nav order, which is also the sitemap order and the JSON-LD featureList order (webApplicationLd in src/lib/seo.ts). ROUTES in src/lib/seo.ts is the single source of truth for each path and title; the sitemap, the breadcrumb JSON-LD and each page's <head> all read from it.

Route renames and the 308s ​

Three section paths were renamed in 2026-07 so the URL matches what the surface is actually called:

Old pathNew path
/asset-coverage/asset-profiles
/money-market-rates/repo-lending
/strategies/multi-strategy-funds

Each old path is a permanent (308) redirect declared in the redirects() block of next.config.ts. The destinations declare no query string, so Next carries the incoming one through: row deep-links (?asset=, ?market=, ?strategy=) survive the hop, and so does the legacy /?asset=<ticker> home-page redirect (now pointed at /asset-profiles).

A 308 is one-way. Browsers cache a permanent redirect indefinitely, so a path that has shipped here cannot be reversed: the reverse rule would put every client that already cached the first hop into a redirect loop. /carries is exactly that situation already (/carry-trades → /carries), which is why it was deliberately left un-renamed in this pass even though its nav label is "Carry Trades". Rename a surface again only by adding a NEW path, never by pointing an existing destination back the way it came.

The nav matchers in NavSections.tsx also recognise each surface's pre-rename path. The 308 rewrites the URL before the nav renders, so the legacy arms only matter for a client-side navigation that beats the redirect, but they keep the active row correct either way.

"Multi-strategy funds", not "managed strategies" ​

The category was renamed along with the route. "Managed" did not distinguish it from money market funds, whose Morpho/Euler curators are also managers. The real separator is mandate breadth: a multi-strategy fund's manager may take leverage and directional exposure, while a money market fund's curator only allocates across lending markets. Since 2026-08 that second category has its own surface, /money-market-funds, which is where the separator is visible: every fund there is single-asset, lend-only and unlevered by definition. In the portfolio taxonomy the rename is label-only: the category key managed_strategy_fund is the /api/portfolio wire format and is deliberately unchanged, as is the erc4626 role: 'managed' behind it. Only CATEGORY_LABEL moved (see Portfolio and Metrics).

Hover navigation and steel identity ​

On screens at least 1024px wide with hover support, navigation starts as a 64px icon rail and expands to 248px while the pointer is over any part of its surface, including the header and footer. It also recovers a pointer that entered the server-rendered rail before the client was ready, so moving within the rail reveals its labels without re-entering. It collapses when the pointer leaves, including after clicking a navigation link; there is no manual handle. Keyboard focus also expands it and keeps the labels visible until focus leaves the sidebar, unless the pointer is still over it. On a laptop with both mouse and touch input, the first finger tap on the compact rail reveals its labels without following a link. A later tap follows the chosen destination and closes the rail; tapping outside also closes it. Mouse hover continues to work on the same device. The content column follows its width without changing the page scale. Icons use an 18px centred glyph when compact and a 16px glyph at the 20px inset when expanded. Their inset stays fixed during the width transition; expanded rows preserve every full label. The expanded header shows the curved mark, Archivo wordmark and blinking cursor; the compact header shows only the 26×19 mark. Its home link stays mounted through expansion so keyboard focus and tab order are preserved. Both Portfolio links use the same wallet icon. The desktop rail follows the 1a Ledger design: Account heads Portfolio and Markets heads the five research destinations. The kickers retain their height when compact, showing only a full-width #1F2326 hairline. Rows are 40px tall, with JetBrains Mono 500 at 12px and .14em tracking; kickers use 11px and .16em tracking. Resting labels are #B4BCC6 and icons #8B95A1. Hover uses #0A0A0A, #E7E9EA labels and #B4BCC6 icons. Active destinations use #0D1014, #E7E9EA labels, #8BA9C9 icons and a 3px inset steel bar in both widths. Keyboard focus uses the hover tones and a 1px inset steel outline. Compact labels have a 30px tooltip at a 10px offset, with #0A0C0E fill, #2F3336 border and 6px corners. The 64px logo cell retains the mark and steel cursor; its expanded Archivo wordmark is 22px. The footer has a #1F2326 rule and monochrome X and Telegram links (#8B95A1, #E7E9EA on hover), with a filled X and Lucide send outline. Teal is reserved for data signals rather than desktop navigation. Reduced motion stops both the cursor and the width animation. Below 1024px, and on wider touchscreens without hover support, navigation uses the tap-operated mobile drawer. It remains 252px wide, keeps the full lockup and labels, and closes after choosing a destination. Its 52px top bar stays at the viewport top while the page scrolls, so the drawer trigger remains reachable on narrow and wide touchscreens alike. The outer MobileNav wrapper is sticky; the bar is not confined inside a non-sticky wrapper of its own height. Screener headers and row-scroll offsets reserve space for the bar whenever this navigation mode is visible. The closed drawer is inert, so its offscreen links stay out of the keyboard tab order. The desktop rail is hidden on those screens and the content has no left rail gap.

Segmented controls use steel fills (#3E5677) with white text; links use #C9D4E3. Soft teal (#5EEAD4) marks active indicators, tabs and filters, distinct from the classic green gains (#22C55E) and red losses (#EF4444). Benchmark pills use transparent backgrounds and signed-color borders. SparkLend's USDC chart series keeps amber (#E6B04A) as a data color; Fluid is mint and Aave coral. Screener drawers use one well (#07090B) beneath a #0D1014 open row, with a 2px steel (#8BA9C9) bar down the open row and its drawer, except Asset profiles' 3px open-row bar (see Screener tables). Active tabs use a 1px teal underline.

The readability palette uses #9AA3AD for muted text and placeholders and #B4BCC6 for secondary text. Uppercase micro-labels use 11px (screener column headers at weight 500, see Screener tables); the small secondary controls, navigation items and table sub-values use 12px. Primary ink (#E7E9EA) and 16px figures retain their sizes; every screener's primary yield, Carry Trades' MAX-LEV APY included, is 18px / 600 soft teal, with Asset profiles using 19px for its row yield. The expanded row's risk tower does not repeat max leverage, which the APY column already prints. The Position column draws no SMART COLLATERAL / SMART DEBT caption (its accessible label still states a smart leg), and the Platform column annotates only Aave and SparkLend e-mode; Morpho markets carry no Isolated subtitle. Its action row is two secondary buttons and one primary, Execute (the shared action button, see Action buttons). Collateral and fixed-rate chart series use soft teal, and debt APY uses #8BA9C9. Carry Trades uses 1.5px series lines and a horizontal grid in #232729; Money Market Funds APY charts retain 1.8px lines and grids in #2F3336. Trade analytics end-value pills use a #0A0A0A fill with a 1px border and text in the series colour (steel series text is #C9D4E3), and the chart watermark uses #0F1A19 (#1C2A28 on the borrow-capacity projection's lighter panel). These text tokens are separate from surface colors and chart-series colors. Carry Trades' APY column is a composite column in 68px rows: carry and max-lev values above an amplification bar, uppercase labels below, on a 168px content width. Its max-lev label includes the entry leverage to one decimal place. A full-height tint and an extra left margin set it apart from the risk metrics (no divider line), and its inner padding scales with the table (10 to 16px), so the max-lev value, the bar's right end and the leverage label all end that far inside the column. A column header whose label and info icon cannot sit side by side drops the icon under the label. The oracle dialog uses compact title and chip tracking so the header stays clear at phone width.

Trade analytics charts and executable basis ​

Each expanded carry row owns its date window and cumulative-return leverage. Its APYs, Carry, Cum. return, Funding utilization and Collateral price panels stay mounted when switching tabs; another expanded row keeps independent state. PTs omit Collateral price, and an unavailable entry leverage withholds Cum. return. Every panel's y axis comes from the shared pure helper components/charts/fit-axis.ts (the same one every Recharts time-series chart in the app uses, with its series-kind options and the LOG mapping symlogAxis; tick labels from components/charts/axis-format.ts; the rule is Chart axes, and components/charts/axis-guard.test.ts fails a chart that sizes its own axis): it fits the displayed series in the window, and a reading beyond the axis is drawn from a clamped copy at the edge with the shared triangle marker (components/charts/OffscaleMarker.tsx) while tooltips and end pills keep the raw value. Financial formulas and the realised, quoted and term entry-lock return methods are unchanged.

The collapsed row's two detail panels draw hand-built SVG plots rather than Recharts, and both are on the same rule: the Funding shock curve (carries/FundingCurveChart.tsx, geometry in carries/funding-curve.ts) and the Carry range plot (carries/CarryRangeChart.tsx, geometry in carries/carry-range-detail.ts) take their y axis from fitAxis and their tick labels from axis-format.ts, and the Funding shock curve's y axis fits the whole drawn curve to 100% utilization, so nothing is cut, and is re-spaced on the shared symlog scale (symlogAxis) where the curve's top rate is more than four times the higher marked rate. Its x axis is not fitted: it starts at 50% or 0% by the market's own utilization (see Metrics). axis-guard.test.ts reads <YAxis> elements and cannot see them, so their own unit tests (funding-curve.test.ts, carry-range-detail.test.ts) assert the axis equals the fitAxis result. What each panel shows is in Metrics and Carry range.

The chart layout uses title/legend strips (8px square series swatches), horizontal grid lines, the creddit watermark, signed area fills and end-value pills. The plot sits inside fixed gutters it never draws into: 56px on the left for right-aligned y labels, 28px below for the date labels, and 80px on the right (wider only when an outlier pill needs it) for the end-value pills. Each series ends in a 3px dot at its true last reading, a 5px leader and a 16px pill carrying the chart's unit: +2.9 bp on the basis chart, 88.9% on utilization, a signed percentage on Carry, a plain one on APYs, and the signed gain on $1 on Cum. return (+$0.0123, green or red by sign). Negative readings use a true minus (U+2212). Pills closer than 6px are pushed apart symmetrically and kept inside the plot's height; the dot stays put and the leader bends to reach it. Reference lines (target utilization, zero, the $1 baseline) are 1px #4A525B dashes named only in the legend, with a dashed swatch and the value in the label (Target 90.0%, Zero, $1.00 baseline). Hovering draws a dashed #4A525B crosshair with a 4px dot on each series and an opaque #0A0A0A hover card 12px right of the crosshair, centred on the hovered point, flipped to the left within 180px of the plot's right edge and clamped inside the plot. Short windows use day or intraday labels and long windows use month labels. Contributions retain the performance history's six-hour or daily cadence. The return slider reaches the exact maximum entry leverage using 0.25× steps plus a shorter final step where needed.

The live executable basis dialog is fully opaque over a rgba(0,0,0,.72) scrim that blocks the chart: a #0A0A0A body under a #0D1014 header, black input fields and collateral selector, and a #0D1014 quote block.

TradeAnalyticsPanels lazily reads the independent history endpoint on first use. Funding utilization shows one market at a time; only smart debt with multiple markets gets a MARKET selector. Collateral price is one basis plot containing every collateral constituent against its own USD, ETH or BTC reference, including when both collateral and debt are smart. Its display does not select a funding asset or require funding-price coverage. The history payload includes each constituent's market/redemption observations, estimate flags, reference and permitted executable settlement pair. Estimated and observed values share the same solid lines, legend, hover and edge-marker labels; provenance stays in the API. The plot uses the returned samples without synthetic midpoints and preserves null gaps. The legacy prices field separately reads the selected collateral's market and redemption values in selected funding-token units, preserving its original denomination and coverage rules.

ExecutableBasisModal is a Base UI dialog opened from the basis chart. It owns the collateral selector for multi-collateral carries, pay/receive direction, amount and quote result. Only GET QUOTE sends a request; editing, swapping, changing collateral or closing aborts an in-flight request and clears the result. Results expire 30 seconds after their quote timestamp. The server authorizes a fixed pair: ETH uses canonical WETH as settlement, USD uses an actual distinct funding token, and BTC is a reference with no executable swap. No arbitrary destination token can be supplied by a client. Quotes remain informational and submit no transaction. See Metrics for the reference, freshness and signed-basis rules.

Shell scale (the per-width zoom tiers) ​

The whole layout shell renders through a CSS zoom that steps with the viewport (.app-shell in globals.css). Narrow windows zoom down so the wide screeners fit without horizontal scroll; large monitors zoom up so text stays proportional. A reader never sets this: it is a property of their window width, and browser zoom reaches it the same way, since zooming to Z% in a window W wide lays the page out at an effective viewport of W/Z.

Effective widthZoom
≤7670.85
768–10230.78
1024–11960.75
1197–13590.88
1360–15351.00
1536–19191.08
≥19201.15

From the lg breakpoint up, a tier's zoom has to be affordable at the tier's narrowest width. Usable content width is viewport / zoom − chrome, where chrome is the 248px expanded sidebar plus a 26px page gutter on each side (300px, the wrapper the four screener pages share; /portfolio uses 24px under a 1300px cap and is not the binding surface). Because the zoom is constant across a tier while the viewport is not, the bottom of each tier is its tightest point, so a tier whose zoom is chosen for its top starves its bottom. The boundaries reserve room for the Ledger sidebar. They leave the widest screener enough room: /carries, whose seven tracks, with the grid's column gaps and side padding at their tightest, need 1034px. The inset focus edge consumes no layout width. The tier bottoms leave room for a 17px classic scrollbar before dividing the viewport by zoom. Collapsing the rail releases another 184 content pixels without rescaling the page. The tightest current boundary is 1197px: after a 17px scrollbar, the expanded navigation, page gutters and panel outline leave about 1038.9px, enough for the 1034px table.

Below lg the rule does not apply. The mobile shell drops the sidebar and accepts sideways scroll inside a wide table, which is why the 768 tier is not derived this way and why the sweep's scroller check starts at 1024.

Two costs are accepted rather than solved. 1024 is the first desktop width and no boundary can move it, because that is where the sidebar itself appears; it is where a classic 15–17px scrollbar costs the most, because its gutter comes off the layout width before the zoom divides it (~19–22 content px at that tier). It is the width to re-measure after any change to the chrome or the column floors, and it has to be measured with a scrollbar gutter — headless browsers and macOS use overlay scrollbars and will show it fitting when it does not. And because effective scale is browser zoom × shell zoom, zooming in one step can now render the page slightly smaller (on a 1440px window, 110% and 125% land in a tier one step down, for a net ≈0.98). The alternative was a table that scrolls sideways at those widths. A continuous clamp() scale would make the response monotonic by construction and is the natural way out if this becomes a problem.

The boundaries are deliberately not the same as the lg layout breakpoint (1024), where hover-capable screens switch to the fixed sidebar and the one-screen home column switches on. Wider screens without hover retain the mobile drawer and its top-bar clearance. Navigation mode and the column layout are separate from the scale tiers; sharing a number does not make those rules interchangeable.

The zoom sweep (docs/processes.md E.6) checks both sides of every boundary above on every registered surface, reading the tiers out of globals.css rather than from a copy, so a boundary change re-points the tests automatically.

Where a screener's column template lives ​

Each of the four screener tables hands out its grid as one call (tableGrid) that returns the class and an inline gridTemplateColumns together. The template is never a Tailwind arbitrary-value utility, and that is a correctness requirement rather than a matter of taste.

An arbitrary value puts the track widths in the selector name, so retuning any column renames the class — the caret spacer's 28 → 20 did exactly that. These grids are client-rendered (the routes server-render only their loading skeleton), so that name ships in the JS chunk while the matching rule ships in the CSS chunk: two separately hashed files, both served immutable for a year and cached at the edge. Pair a stale half with a fresh one and the selector matches nothing. display: grid still applies, the template does not, and all seven or eight cells stack into a single full-width column.

What is demonstrated, and what is inferred. The mechanism was reproduced exactly: serving the built app a complete, valid stylesheet in which only that one class name differed renders the reported screenshot, table collapsed and the rest of the page intact. Which cache serves the stale half in production — the edge, the browser's own immutable copy, or a build artifact — was not pinned down, and the note below on in-place rebuilds is the demonstrated delivery path rather than the only possible one.

The reason the rest of the page survives is narrower than "class names are stable": roughly 90 arbitrary-value selectors ship, so any of them whose value changed in the same release breaks the same way. What holds is that a release usually retunes few of them, and the screener template is the one whose loss is catastrophic rather than cosmetic — every other one degrades a width or a max-width, while this one collapses the table.

Returned as a single call so the class cannot be applied without the template: a bare class constant beside a style constant invites className={TABLE_GRID} on its own, which is a silently collapsed table and the exact defect this replaced.

tests/e2e/grid-template-provenance.spec.ts holds the invariant. It strips every grid-template-columns declaration out of the loaded stylesheets and asserts that every screener grid currently laid out resolves to the tracks it had before. It finds them by the data-screener-grid attribute each tableGrid() emits, and asserts it actually saw a header and a row, so the check cannot pass by measuring nothing.

Each surface declares whether it has a pinned open-row strip, and one that declares it must produce it or fail — no conditional is allowed to swallow its own timeout, because a skipped check reports the same green as a real pass, and that is the failure mode this spec has already hit twice. Revealing the strip walks the page down in small steps and waits on the observable outcome (the strip taking a layout box) rather than restating the component's visibility predicate, and it stops with a diagnosis of its own if the page runs out of scroll: on a viewport taller than the table, or a fixture with too few rows, the open row can never straddle the freeze line, and that is a short surface rather than a broken strip. The no-data row needs a degraded fixture and is documented as not exercised rather than claimed.

Its positive control is installed rather than found: the spec adds its own stylesheet-driven grid and requires the strip to destroy it. Searching the page for one does not work, because these tables were the last stylesheet-driven grids on these surfaces — a search finds nothing and silently disables the control, which is what an earlier version of this spec did in every run.

It fails the moment a table goes back to declaring its template in a class name.

One trap when editing this page: Tailwind scans docs/ as raw text, so writing a literal arbitrary-value class candidate in prose here mints a real rule in the production stylesheet. Describe the syntax, do not spell it.

The left nav (AppSidebar, and its mobile-drawer twin MobileNav, kept in sync via the shared NavSections) leads with Portfolio as a plain nav row (design handoff "Portfolio nav row" V1, PortfolioNav) above the Explore section — no kicker, no card. The row shares the Explore rows' box model but rests brighter, with a wallet icon and a brighter default label. Both desktop and drawer navigation use the same wallet mark. The rail carries no wallet state — no connect call-to-action, no address, no sign-out; connecting lives on the /portfolio page itself (its signed-out landing → connect flow) and disconnecting in the signed-in page's Settings popover (its session row: Connected wallet and Sign out). Below the row, all five public research pages (Repo Lending, Carry Trades, Money Market Funds, Multi-Strategy Funds, Asset Profiles, in that order) are grouped under Markets on desktop and after a divider in the drawer, in a list labelled Explore for assistive technology. Desktop rows keep their supplied icons in the compact and expanded states, reveal labels on expansion and omit trailing chevrons. The drawer's research rows keep their labels and trailing chevrons without icons. Desktop active destinations use the Ledger states described above; drawer active destinations retain light steel text (#C9D4E3) on #0B1118 with an inset 1px soft-teal left indicator. Changing the active row does not move its content. The desktop rail is 64px compact and 248px expanded; the content column follows the same width. The touch drawer stays 252px wide and reserves no left rail gap. Multi-Strategy Funds used to be withheld — out of the nav, out of the sitemap, out of the JSON-LD featureList, and a header-only "Coming soon" row on the home page. It is now promoted on all three: an Explore row, a sitemap entry and a featureList line. Keep those three in sync when a surface is added or withheld, plus public/llms.txt, which publishes its own per-page list to AI crawlers and is easy to forget because nothing in the app reads it. The foot of the nav carries two bare icons, X and then Telegram (the community group), with no pitch copy, no button and no status row; the mobile drawer closes with the same pair. They used to sit under the CredditAI launcher, which went with the assistant's UI.

The shared SIWE session still lives in AccountProvider (a client context mounted in (app)/layout.tsx, one /api/auth/me probe), consumed by the /portfolio sign-in prompt only — the rail does not read it.

Screener filter bars ​

All five screeners share one control vocabulary, defined once in src/components/ui/filter-controls.tsx: FilterBar (18px 28px padding) holding wrapping FilterRows with a 12px / 14px gap, a mono uppercase group label before each control, 1 × 24px dividers between groups, and 34px controls with 2px corners. Dropdown trigger borders lift from #2F3336 to #5B6168 on hover, while open, and off their default. Labels and trigger text do not wrap.

Every multi-select uses a #0B0D0F popover with a #2F3336 border, at least 440px wide or its trigger's width, capped at the viewport minus 32px. The header has 16px / 20px padding and a 24px gap between its title and the Select all / Clear all actions; the actions stay together with a 16px gap. All sections have 20px horizontal padding. Checkboxes are 14px, neutral when empty and #5EEAD4 with a black tick when checked. Asset rows are 36px high with a 12px gap, a #12161A hover, and their category on the right. APPLY (#115E59, #157A73 on hover, white text) commits the draft; CANCEL, Escape and outside clicks discard it.

PlatformSelect serves Platform, Manager, Category and the deposit Asset. Its trigger reads All · N platforms with everything selected, an option's name with one, a count with several, and None with an empty selection. SearchableMultiSelect adds search and category quick-select chips for Carry trades' Collateral, Repo lending's Exclude collateral and Money market funds' Collateral. Exclude collateral reads None when empty. BoxedSelect is the single-select sibling (Asset, Deposits): radio rows apply immediately. Segmented (Type, Match) has a steel active cell.

MinField reads Borrowable ≥ [ ] $M and filters live while typing. A positive value gives it a 2px teal frame: a 1px #5EEAD4 border plus a 1px inset shadow, so its size stays fixed. Empty and zero values restore the neutral frame. The background stays black, the value #E7E9EA, and its unit #8B95A1; border and shadow transition over 150ms. This applies to every minimum on the five screeners. WindowSwitch is the APY window (24H / 7 DAY / 30 DAY), labelled APY on every screener and always right of the first row; it is a metric switch and never narrows the table. ActiveFiltersLine is the N FILTER(S) ACTIVE tag (teal outline) and a CLEAR ALL link; its whole row is hidden while nothing is on. Scope controls never count: the asset or underlying selector, Match, and the APY window. The shipped default floors on Carry trades (Borrowable, Borrowed) and Money market funds (Min TVL), and Repo lending's Pooled default, do count, and Clear all removes them.

The controls are presentational; applied filter state lives in the table that owns it, because that state also drives the rows, the URL, and (on repo) the chart. Shared pure helpers live in src/lib/filters.ts (activeSubset, parseMinPct, selectionSummary, constraintSummary). The signed-in Portfolio deliberately does NOT draw from this file. Its MinValueField is a local control in v3/SettingsPopover.tsx for three concrete reasons, so nobody "unifies" the two later: the page is styled from its own .pf3 stylesheet (src/app/globals.css, mirrored in v3/tokens.ts) and imports no Tailwind-class control vocabulary; its input has to hold 0.0001 where MinField's is fixed at a narrower width; and the semantics are inverted, since a screener filter is off until you type while the portfolio floor ships already set. (Two screener exceptions, both on carries. The Borrowable min ships set at $100k since the 2026-08-03 floor loosening: the listing floors admit real-but-tight markets and the default screen filters them instead. The Borrowed min ships set at $1M, so the default screen stays on markets with real borrowing behind them, and it is the one min-field carrying an explainer, since the size figure it screens on covers the whole debt reserve on the pooled venues. Clearing either writes an explicit liqmin=0 / bormin=0 so the choice survives reload.) The strip above every filter bar is the shared PanelHeader (see Screener tables below).

Carry trades. /carries (CarriesTable) has a three-row bar: a Platform multi-select dropdown (all four platforms selected by default), a searchable multi-select of collateral assets (grouped USD / ETH / BTC, all selected by default, with the category chips described below at its top), and four typed minimums: Borrowable ≥ and Borrowed ≥ in millions of USD (the two that ship already set, per the note above) and Carry ≥ / Max-lev APY ≥ in percent (both measured over the selected APY window; the second screens the APY at maximum leverage, not the leverage multiple), plus the active-filters tag (with the list as its hover text) and a Clear all, shown while any filter is set; the two shipped floors count, so a fresh load reads "2 filters active". The applied set is mirrored to shareable URL query params (plat platform slugs, mom, col collateral tickers, liqmin, bormin, carrymin, levmin) which coexist with the row deep-link's carry param (useRowDeepLink), so a filtered screen survives reload and is copy-pasteable; all-selected collapses to "no constraint" and the param is omitted, while a deliberately-emptied selection round-trips as the plat=none sentinel. The two defaulted fields invert that presence rule: an absent param is the shipped default and the explicit 0 sentinel is the cleared state. bormin goes one step further and is written whenever a user sets that floor, even at the shipped value, because presence is what marks the threshold as asserted rather than inherited, and the two differ on a market whose size cannot be read (the default lists it, a floor somebody chose does not). The predicate is a pure, unit-tested function (itemPassesFilters in CarriesTable.tsx).

Category quick-select. Every categorized asset popover uses the same four names: Credit RWA, Pendle PTs, ETH staking, Crypto native. Only categories with members are shown. Above search, a separate section reads SELECT BY CATEGORY / Toggles every asset in it. Its 34px chips wrap as a group; the checkbox, name and count within each chip stay together.

Chip state is derived from the draft's actual asset selection: no members selected is an empty checkbox and total count; some is a teal dash, aria-checked="mixed", and n/N; all is a teal checkbox, a dark teal #0D2421 fill and the total count. Selected and partly selected chip borders are #2B6B63. Clicking an all-selected category clears its members; otherwise it selects all of them, preserving other categories. Individual asset ticks immediately update chip states. These edits remain a draft until Apply, and Cancel discards them.

The shared client-safe mapping in src/lib/collateral-groups.ts supplies both Collateral categories and Asset profiles' Category. Pendle PTs have their own category; staking assets use ETH staking. Credit RWA includes reUSD, PST, sUSDai, USD3, syrupUSDT and syrupUSDC; sUSDe, fxSAVE and wsrUSD use Crypto native. Other assets follow the registry's instrument kind, and a smart-collateral pair carries the categories of its legs. Unmapped collaterals remain individually selectable. These are display categories; the token registry's stored instrument kinds are unchanged.

Asset profiles. /asset-profiles (AssetsTable) has one CATEGORY multi-select using those same category chips and counts. It shows only categories with at least one listed asset, and the table's Category column uses the identical name. Every category is selected by default, which reads All · N categories and adds no active filter. Clear all in the filter bar restores that default; Clear all inside the popover empties its draft until Apply.

Repo lending. /repo-lending (MoneyMarketTable) has a two-row bar. Row 1 groups the Asset dropdown (a multi-select like Platform, USDC alone by default or the deep-linked market's asset; a non-empty selection never enters the filter count and Clear all leaves it alone, while an emptied one reads "Asset: none" in the filter tag and Clear all restores USDC) with the Exclude collateral searchable multi-select (empty by default; a market exposed to any excluded collateral is dropped, where exposure is an isolated market's one collateral or every named slice of a pooled market's underwritten capital that carries a balance, Fluid smart-collateral pairs split into legs, and while an exclusion is on a market with no current exposure snapshot is dropped too; the filter tag reads Excluding: …; the asset-group buttons described under Carry trades sit at its top, not persisted in the URL, like the rest of this page's filters), then a divider, then a Platform dropdown whose counts are scoped to the selected assets, a Type segment (All / Pooled / Isolated, defaulting to Pooled so the Morpho isolated markets stay an opt-in), and a right-aligned APY window switch (24h / 7 day / 30 day — a metric switch that selects which trailing window the APY column and the benchmark spread report, vs SOFR for dollar markets and vs Lido staking for ETH, so it never narrows the rows). Each row's spread uses its own asset's benchmark; the column header names it when every selected asset shares one and reads "Spread" when dollar and ETH assets are mixed. In that mixed case the rates chart draws no benchmark line and drops its Total Deposited view, since dollar and ether sizes cannot share one axis. Row 2 is the active-filters tag. Because Pooled is the default (and counts), a fresh load honestly reads "1 filter active", with Type: Pooled as the tag's hover text; Clear all returns every dimension to unconstrained (Type lands on All), not to the initial defaults. Filter state is owned by MoneyMarketSwitcher so the rates chart beneath the table renders exactly the visible markets; both sides call one pure, unit-tested predicate (marketPassesFilters in src/lib/repo-filters.ts).

Multi-strategy funds. /multi-strategy-funds (StrategiesTable) has a two-row bar. Row 1 is the Asset boxed select (ETH / USD — the table's axis for the same reason repo's is: the two denominations never share a comparison chart, so it never enters the filter count), a divider, then a Manager dropdown over the house that runs each fund, all selected by default. The option list is derived from the funds the page actually renders, not from the StrategyManager union, so it currently holds seven (Fluid, Mellow, YO, ether.fi, Treehouse, Yearn, IPOR); Morpho, Euler and Falcon are legal values of the type whose vaults are surfaced elsewhere, so they do not appear. Every manager carries a brand mark from ProtocolIcons, which MANAGER_ICON enforces at compile time (a total Record, not a Partial) and the e2e spec re-checks in the rendered control. Then the MIN kicker over a TVL field — the same grouping /carries gives its family of floors — and right-aligned over the column it governs, the APY window switch (24h / 7 day / 30 day, from the same TRAILING_WINDOW_CELLS constant /carries uses). The window switch is a metric switch, not a filter: it changes what the APY column reports and never which rows are in the table, so like the Asset axis it stays out of the filter count. The Asset select takes BoxedSelect's own 108px default width rather than a local override. Row 2 is the active-filters tag, hidden while nothing is on. The manager option list is deliberately NOT scoped to the selected asset — the applied selection has to keep its meaning when the asset switches, so only the per-option counts follow the asset (an ETH-only manager reads 0 while browsing USD). Filter state is not mirrored to the URL here; the only query param this page owns is the row deep link (?strategy=).

Columns run FUND · TVL · 1M RETURN · YTD RETURN · 1Y RETURN · APY · VS BENCHMARK: size leads, the teal APY anchor sits under the switch that labels it, and the benchmark spread closes the row in the same right-edge slot repo lending gives its Vs SOFR pill. Every column sorts (APY by whichever window is selected; the spread, the APY less one number shared by every row in the view, orders exactly as APY does). The table opens unsorted, in the page's curation order.

The benchmark follows the Asset switch, reading Vs SOFR in the USD view and Vs wstETH in the ETH view, off the same baselineByDenom pair the comparison chart benchmarks against. An ether-denominated return minus a dollar cash rate is not a spread, so the column would be meaningless fixed to SOFR; what an ether allocator is choosing between is the fund and passive staking. Both sides are annualised by windowApy over a realised-return index, measured server-side in page.tsx and handed down as benchmarkApy — windowApy lives beside the Postgres readers, so value-importing it into this client component would drag the driver into the browser bundle. (The same rule put maxDrawdown on a client-safe leaf, src/lib/data/fund-stats.ts.)

The column header row is pinned to 44px, the height /carries pins. Left to content it measured 31px, because this head carries no two-line sub-label to push it out, and it sat visibly shallower than every other table on the site.

The expanded row is a detail zone over a chart card. A 1fr / 400px strip on its own near-black fill: on the left a ▮ STRATEGY kicker and one short paragraph (two sentences, 20 to 70 words, prefixed //) over a plain run of yield-source categories separated by amber middots; on the right a ▮ AT A GLANCE tower. StrategyRow therefore carries two nodes, expansion (narrative) and an optional glance (tower), rather than one pre-composed node: the table owns the strip's grid, so it decides the split, and a row with no tower renders its narrative full width.

The tower's rows are drawn in FundBrief.tsx and are deliberately not the shared KpiHero / KpiRow pair /carries uses. Rate type now leads the tower, and a hero-sized drawdown under the row that frames it would out-shout it, so the funds' tower is a uniform eight-row rhythm and the shared primitive stays /carries'. Its rows are the terms and measurements of the holding — rate type, max drawdown, track record, performance fee, management fee, exit fee, redemption, vault infrastructure — not a description of the fund: who runs it is already the row's second identity line and what it does is the paragraph beside it. Per-fund qualifications (a fee charged on one leg of the return only, a headline "None" that hides the manager keeping the upside) ride as optional *Note fields appended to the standard tooltip rather than replacing it.

Vault infrastructure closes the tower, and it is the one row that is not a figure. It names the platform whose vault contracts hold the assets and enforce the mandate, a second counterparty the depositor takes on top of the manager and frequently a different house from the one whose name is on the fund: ether.fi Liquid ETH runs on Veda, with Seven Seas as its strategist, which is a third role again. Per-fund editorial like every other term, out of a closed set defined beside the type in FundBrief.tsx and imported by both construction sites, so the proprietary case has exactly one definition and the platform arm's name is a literal union rather than a string: naming a platform the file has not been taught is a type error, and adding one is a deliberate edit beside the type, the same closed-vocabulary rule FundRateType and the yield-source categories run on. FundInfrastructure is a discriminated union rather than a name with an optional url: a third-party platform always has both a name and a site to send the reader to, a manager on its own stack has neither, and the fourth state would render a platform the reader is told about and cannot look up. Required on FundStats, so a new fund cannot ship without an answer. A platform with a site renders as a link out marked with the app's ↗; a manager on its own stack reads Proprietary as plain text, with no affordance, because there is nowhere to send the reader.

Its label is the tower's one DeFi-leading term, against the house rule that TradFi vocabulary leads, and deliberately so: administrator, custodian and transfer agent each name a slice of what the platform does and misdescribe the rest, so the label stays the accurate one and the tooltip carries the traditional-fund analogy.

A peer chart sits below the table, always on, the way the rates chart sits below the repo-lending rows. It plots one line per VISIBLE fund (it is handed the filtered rows, so it cannot disagree with the table), each the realised return of a deposit made at the window start, every line indexed to 0% on the same date, against the denomination's dashed baseline. Timeframe pills are 3M (default) / 6M / 1Y / ALL, anchored on the newest reading rather than the wall clock. A fund whose record does not reach back to the window start is not drawn, and is named in the legend rather than vanishing. ALL is the second-earliest first reading among the funds on screen — the longest window on which a comparison is still possible, and the only reading of ALL under which the pill is never narrower than the one above it. The full rule, and why the two obvious alternatives are worse, is in Metrics.

It replaced a per-row Benchmark vs peers toggle that revealed a head-to-head panel for one fund at a time (ComparisonChart, deleted). Comparing these funds is the reason to open the page, so it is not something to click into; and that panel's window was dictated by the compared fund's peer set rather than chosen by the reader. StrategyRow.inceptionMs, which only ever fed that peer set, went with it.

Yield sources are categories, never holdings. A closed vocabulary in FundBrief.tsx (Staking, Lending, Leveraged carry, Liquidity provision, Fixed rate, Basis & funding, Incentives). The field used to list assets ("sUSDe, syrupUSDC, syrupUSDT, sUSDai"), which dates on the next rebalance under an actively managed mandate and invites the reader to diligence positions the manager is free to replace. The union makes a stray ticker a type error, and an e2e spec walks both denominations checking every rendered category against the set.

Which level a category is named at is the part worth stating, because the answer is not "the fund's own contracts" and it is not "every trade running beneath it". The line is what the mandate FIXES versus what it ROTATES. A base asset a fund is defined by earns its category: iETHv2 exists to hold staked ether, so Staking is the fund rather than a detail of it. A collateral basket the manager reshuffles does not: Fluid Lite USD buys whichever yield-bearing dollar instruments look best, pledges them and borrows against them, and what it is paid for is the spread over its borrowing cost, so it reads Lending · Leveraged carry. One of its four current instruments is a staked synthetic dollar whose own yield comes from perpetual funding; that is the issuer's trade on a line the manager can replace, and Basis & funding is reserved for a fund running the delta-neutral position itself. Tagged the other way the vocabulary stops separating anything: every fund holding an LST becomes a staking fund and every fund holding a synthetic dollar a basis fund, whatever either is doing. The same test settles the allocators: a category has to be something the mandate is built on rather than a position that happens to be open, so earnETH carries all four of the things its sub-funds do as a matter of mandate, while a single rotating line inside a collateral basket earns no category at all. Its dollar sibling Lido Earn USD is the same test applied to a different mandate and lands somewhere else: its sleeves supply money markets, borrow against those holdings and buy principal tokens held to a maturity date, so it reads Lending · Leveraged carry · Fixed rate — three chips, each of them traceable to a clause of the paragraph the reader sees. It does NOT read Liquidity provision, though the conservative sleeve is whitelisted for Balancer v3 and Aura: a whitelist is a permission, which is weaker than a position that happens to be open, which is itself below the bar this paragraph sets. And pointedly not Basis & funding either, because what it levers is a staked synthetic dollar whose funding trade belongs to its issuer, the same line Fluid Lite USD already settles. Members can sit unused (Basis & funding, Incentives today) without being dead: the set is the vocabulary, not the current inventory.

The strategy paragraph states no verdict on risk. Each fund's brief used to close by naming the exposure that was "decisive" or "distinguishing", which is the page ranking one risk above the others on the reader's behalf. The paragraph says what the fund is and what sits behind the rate it pays; the yield-source categories under it say what the money is doing, and the reader concludes. An e2e spec matches the shape of a verdict rather than the word "risk", so a manager's own screening can still be described.

TVL is denominated by the Asset switch — dollars in the USD view, ETH-equivalent in the ETH view — because that is the unit the underlying series carries (tvlDenom), and converting ETH history to dollars would need a historical eth/usd overlay that does not exist. One denomination is on screen at a time, so a column never mixes units. tvlNative on the series resolves it: the live on-chain read where the node answered, and otherwise the newest persisted total_supply x share_rate point provided that point is recent (recentSeriesTvl, ceilinged at 48h against the series' own newest entry, the same shape as dune.ts's BAR_STALE_HARD). So a brief RPC outage still shows a size rather than blanking every row, while a fund whose supply column stopped being written reads "-" instead of printing a dead number beside live returns — which matters twice over, because that number also decides whether the fund clears a Min TVL floor. The ceiling is measured against the series rather than the wall clock: what misleads is a stale size next to fresh returns. A whole-pipeline stall is not dated anywhere on the page: the screener headers carry no timestamp (removed as clutter, a deliberate trade-off). The Min TVL field is typed in that same unit ($M / k ETH) and switching denomination clears it rather than reinterpreting 10 from $10M to 10k ETH. A fund whose TVL could not be read is withheld from a Min TVL screen, never passed through.

Short APY windows on oracle-priced funds swing in BOTH directions. These funds are priced by oracles that update on their own schedule, not per block — the Mellow oracle behind earnETH can hold still for ~27 days (what flatPeriods measures), and the one behind Lido Earn USD publishes about once a day, so on the 6h grid three of every four of its snapshots repeat. A short window therefore contains a WHOLE NUMBER of price updates, and which number depends on where the publication clock happens to sit relative to the snapshot boundary:

  • zero updates → 0.00%. The window spans no new report.
  • two updates in a 24h window → roughly double the fund's actual rate. Two days of accrual annualised over one. Measured on Lido Earn USD's backfilled series, 9 of 661 stored 24h readings sit above 15% against a fund earning ~7%, topping out at 22.77%, and each one is adjacent to a 0.00% reading.

Both readings are truthful arithmetic on truthful inputs — the realised index ratio over the window, annualised once — and neither is a claim about what the fund earned. The 30-day window is the steadier read, and it is the default for that reason. The column tooltip states the zero case; a reader who wants a rate rather than an artifact should not take a single short-window print off an oracle-reported fund. windowApy in strategies-table.ts is exported and unit-tested for exactly this (strategies-table.test.ts), because the fixture database's share rates are a smooth exponential on which every window annualises identically — a browser test cannot tell a working window switch from an inert one.

Screener tables ​

All five screener tables (Repo lending, Asset profiles, Multi-strategy funds, Money market funds, Carry trades) follow one set of rules, the Tables consistency spec (2026-10-12). The React side lives in src/components/ui/terminal-table.tsx; row states, gutters and the composite column's tint live in globals.css (.tt-*), because a hover has to reach the frozen identity cell and the arrow at the far end of the row in one rule.

PartRule
Title bar (PanelHeader)60px strip, 0 28px padding, a 12px teal square, the title in 500 14px JetBrains Mono at .3em uppercase, then a 16px ⓘ (info). Every screener carries one. No result count, no timestamp.
Header rowmin-height: 48px on #0D1014. Every label (ColId and ColMetric, which differ only in default alignment) is uppercase JetBrains Mono 500 11px, .12em, #B4BCC6, and may wrap onto a second line rather than widen the table. A sub line sits under it at 10px #8B95A1 (Repo lending's UTILIZATION over CURR / TARGET). The ⓘ (14px, resting #6B737C) follows the label by 7px and appears only in headers.
SortingEvery data column sorts from its header. The sorted column is teal with ▼ / ▲ before its label. The first click opens names and tickers A→Z and figures high→low (Carry range opens steadiest first, Funding shock most sensitive first); a second click reverses. Unreadable values sink in both directions (src/lib/table-sort.ts).
Rows56px on single-line tables (Repo lending, Asset profiles, Multi-strategy funds), 68px where any cell has two lines (Money market funds, Carry trades). Bottom line #1F2326. Hover: #101418, a 2px inset bar #3A4046, 120ms, and the end arrow turns teal. Open: #0D1014, a 2px steel bar #8BA9C9 continued down the drawer, the arrow turned 90°. Asset profiles strengthens its open row's bar to 3px.
ArrowThe row's LAST column, 28px, a › in #6B737C, right-aligned. With it at the end, the first column lines up with the filter bar's 28px padding.
FitTracks are proportional (minmax(0, n fr); Carry trades keeps measured content floors, see TABLE_COLS), so tables fill the panel with no sideways scroll at desktop widths. Side padding and column gap sit on the grid and scale with the table, 14 to 28px and 8 to 14px (container units on .tt-panel, because the shell's zoom tiers make the table's CSS width saw-tooth rather than track the viewport). Text cells ellipsize; figures never do. Below each table's minimum width (a phone) the body scrolls sideways; Asset profiles, Multi-strategy funds, Money market funds and Carry trades keep their identity column frozen.
CellsEntity names Geist 400 15px #E7E9EA with a 13px #8B95A1 second line (NameStack); tickers JetBrains Mono 500 14px; figures JetBrains Mono 400 14px, tabular, right-aligned, with a 12px #8B95A1 qualifier line (NumberStack: 91.2% util, per action, +0.40%/yr). The primary yield is teal 600 18px (HeadlineMetric), with Asset profiles using 19px. Returns and carry are always signed and green / red. An empty value is an em dash in #6B737C (EmptyValue).
Composite columnA column holding several values in one cell (Carry trades' APY: carry, max-lev APY, bar, leverage) is set apart by a full-height tint (#11151A header, #0B0E11 body, #141A1F on hover, #11161B open) and an extra 6-14px left margin with 10-16px inner padding, never by a divider line.
DrawerExpandedPanel: one shared well (#07090B); each page's content inside is its own.
ⓘ placementNever on a body row: in the title bar, the column headers, the filter bar and the drawers. Money market funds' rate the vault quotes right now, which a per-row ⓘ in the APY column used to carry, is the Quoted rate line of the fund drawer's At a glance list, after the realised windows.

Gotcha. The header re-applies uppercase to the sort <button> itself. The UA stylesheet sets text-transform: none on <button> and Tailwind's preflight does not restore it, so a sortable label silently renders as authored otherwise. terminal-table.test.tsx locks this.

Expandable rows ​

All five screeners (Repo lending, Carry trades, Money market funds, Multi-strategy funds, Asset profiles) are single-open accordions driven by one hook, src/components/hooks/useRowDeepLink.ts. It owns three behaviours so the tables cannot drift apart:

  • One open row, its key mirrored to a query param (asset, carry, fund, strategy, market) via history.replaceState — shareable, no RSC refetch.
  • The open row's header is scrolled to the top of the viewport, flush under the frozen column headers, whether the row was clicked or seeded from an inbound deep link. None of the row above shows between headers and row. Opening a row collapses the previously-open one, which shifts the layout upward; without the scroll the reader lands mid-panel on a row they did not open. A click defers one frame (long enough for that collapse); the deep link waits 80ms, because on first paint the whole page is still settling. If the navigation is changing the content width, the scroll helper then waits for that specific transition before measuring the destination. Changing or closing the open row, or unmounting the table, cancels any queued scroll.
  • The scroll is applied again when the open row grows, for a bounded window after it opens (holdRowAtTop, src/lib/scroll.ts). Money market funds fetches its drawer on first expand, so the first scroll meets a page whose previous drawer has collapsed and whose new one is still empty; on a short list that page is barely taller than the window, the browser caps the scroll at its end, and the row stopped short of the headers (measured at 1140 on the four-fund fixture: the headers never froze at all). Once the contents land there is room, and the hold re-lands the row. The reader's first own gesture (wheel, touch, a press, a scroll key) ends the hold so a reader is never pulled back to the top of a drawer they have started reading; it otherwise lapses 5s after the open if the row never grows, one quiet second after it last grew, or after four re-applications. Any page scroll the app did not ask for ends it as well, which covers Tab into the drawer, find in page and a scrollbar drag. It arms with the first scroll, not before, so the open's own layout shift is not taken for the reader's. The other screeners' drawers never resize after the open, so the hold lapses unused there.
  • Scroll anchoring is suppressed while a row is open, and restored the moment it closes. Chrome anchors the scroll position to a node in view and compensates for anything inserted above it, which is right for a page filling itself in around a reader and wrong for a table that has just told the page where to sit. Money market funds fetches its drawer on first expand, so the content lands after the scroll: measured at 1140, opening a second row moved the page 1,523px, exactly the height the arriving content added, leaving the row the reader had clicked 1,453px above the top of the window and the page parked at the end of the drawer. The four screeners whose drawers render from data already on the page never showed it, because nothing arrives late to compensate for. tests/e2e/screener-freeze.spec.ts holds it.

Gotcha. That scroll must stay one effect keyed on openKey. It was briefly two — an inbound-deep-link effect keyed on the URL-derived key, and an open-scroll effect keyed on openKey — and they raced. setOpen calls history.replaceState, which re-renders useSearchParams consumers, so opening a row also flips the URL-derived key and re-fired the deep-link effect 80ms behind the other's rAF, restarting the scroll easing mid-glide. It hit only the first expand of a session (the guard armed afterwards), which is exactly the kind of thing that reads as "the first click is janky" and never gets reported.

scrollToTop (src/lib/scroll.ts) waits only while the containing .content-column has a running or pending padding-left transition, checking each animation frame. It sets one wait budget from the native animation's remaining timing, including CSS delay and playback rate, plus one second of startup grace, with a five-second maximum. Retargeting the navigation never extends that budget. Leaving the expanded navigation to open a row can unwrap filters during the rail's 180ms collapse, moving the row after an early measurement; the animation clock can also start after the scroll helper's clock. Waiting lets the helper measure the row's actual top and CSS scroll margin after that layout change, so the identity clears the frozen header. With no such transition, or with reduced motion enabled, it measures immediately. The margin is multiplied by the shell zoom before computing the page-scroll destination, and reduced motion selects an instant scroll.

The destination is the row's own frozen header, measured: the helper finds the nearest .screener-frozen-header around the row and clears its sticky top (52px under the mobile top bar, 0 on the desktop rail, times the shell zoom) plus its rendered height, so the row lands flush under it whatever height that table's header strip comes out at. The CSS margin below is the fallback for a row with no frozen header found, and the offset the browser itself uses for focus scrolling, so a row reached by Tab rather than opened still lands with the fallback's gap. useRowDeepLink cancels the helper's pending animation frame along with its own initial frame or deep-link timer when the row selection changes or the table unmounts.

Two contracts bind a table into this: rows must render id={`row-${key}`} with the same normalized key the hook stores, and must carry ROW_SCROLL_MARGIN_CLASS (exported by the hook, and resolving to the single class .screener-row-anchor in globals.css), the fallback offset described above. That class carries two values, because the freeze stacks differently by navigation mode and a single px figure cannot serve both:

  • Below lg, or at any width without hover: 112px. The 52px mobile top bar plus the frozen column-header strip and slack. 72px here lands the row under the headers.
  • At least 1024px wide with hover: 72px. The header pins to top:0, so only that strip has to be cleared.

The strip is sized per table: Carry trades fixes its header at 44px, the others are content-sized and come out shorter, so 44 is the height both values are built to clear and the rest over-clear harmlessly. Put the class on the row's <summary> as well as the <details>: scroll-margin does not inherit, and sequential focus navigation scrolls the summary. That gives the browser the offset to use; it is not a guarantee it will, since focus scrolling goes through the same scrollIntoView path src/lib/scroll.ts had to work around.

The row margin and frozen-header offset use the named .screener-row-anchor and .screener-frozen-header rules. They default to 112px and 52px respectively; one (min-width: 1024px) and (hover: hover) media query changes them to 72px and 0. This is the same condition that selects the desktop rail. The offsets are deliberately not in a scroll-mt-[112px] lg:scroll-mt-[72px] pair of Tailwind arbitrary utilities. An arbitrary value puts the number in the selector, so retuning it renames the class, and the deploy window that serves a fresh JS chunk against a stale CSS one then matches no rule and drops the offset entirely — the same stale-pairing failure the grid-template provenance spec below exists to prevent. A stable name degrades to the previous offset instead of to none. Do not replace it with an inline scrollMarginTop either (that cannot carry the breakpoint). Lowering the desktop value hides rows under their own column headers.

Frozen column headers (and the open row) ​

All five screeners use .screener-frozen-header to clear the visible navigation: 52px below the persistent mobile top bar, including on wide screens without hover, or 0 with the desktop rail. Their row-scroll margins follow the same media query, so opening a lower row keeps its identity clear of both navigation and column headers.

Carry trades, Asset profiles, Multi-Strategy Funds and Repo lending keep a unified page scroll: the column-header strip is position:sticky in the page flow (not inside a table scroller), and the body is the only horizontal scroller. The body's scrollLeft is mirrored onto the header so the sticky-left identity columns stay aligned sideways. The shared hook is useFrozenScreenerHeader in src/components/hooks/useFrozenScreenerHeader.ts.

While an open row's expansion straddles the freeze line (the summary has scrolled up past the headers, but the expansion bottom is still below them), a pinned clone of that row sits flush under the headers so the row's identity stays visible. The clone is an absolute overlay, not in flow, so showing it never shifts the body (a layout shift here would feed back into the visibility math and flicker), and it is mounted only while it shows rather than kept in the DOM at display: none — a hidden clone is a second copy of the open row's text sitting earlier in the document than the live row, and anything reading the first match for a ticker or market name gets the invisible one. Activating it jumps back to the live row: it is a real control (pinnedRowHandle, exported by the same hook — role="button", focusable, Enter/Space, aria-label), not a div with an onClick, so a reader who opened the row from the keyboard has a way back to it.

Visibility is re-measured after every paint, not only on scroll: a filter that unmounts the live row without changing the open key must not leave the pin stuck on. The same after-every-paint pass re-mirrors the body's scrollLeft onto both strips, which is what covers the horizontal positions no scroll event announces — a mount, a bfcache restore or a back-navigation hands the scroller back where it was, and a header left at 0 is then visibly a column out of step.

The table-panel wrapper must not be an overflow container: sticky resolves against the nearest scroll ancestor, and an overflow: hidden on that wrapper is what used to let a header and open row scroll away.

tests/e2e/grid-template-provenance.spec.ts declares which surfaces have the pinned strip (expectsPinned) and must actually produce it; a surface that grows one cannot leave that flag false.

Action buttons ​

Every action button in the app is one component, ActionButton (src/components/ui/ActionButton.tsx, styled by the .btn block in globals.css): the chamfered shape Connect wallet shipped with (corners cut top-left and bottom-right, no radius), in two weights and two sizes.

  • Primary: teal fill, black label; lighter teal on hover and on keyboard focus, where an inset black ring marks the focus (the clip would cut off an outline drawn outside the shape).
  • Secondary: a hairline outline round a black inner layer, light label; outline and label turn teal on hover, and keyboard focus adds a second teal ring inside the outline.
  • md is 44px tall (page heroes, row actions, modal submits); sm is 32px (an action beside a chart title).
  • One primary per area. An expanded row, a modal or a page hero holds exactly one teal-filled button; every other action there is secondary.
  • Arrows are inline SVG in the label's colour: forward (→) for a step that stays in creddit, external (↗) for one that opens a new tab.
  • Not applied to segmented controls, tabs, timeframe pills, chips, filters, text links or icon-only controls (the ✕ close, the round swap button), which keep their own styles.

Where it is used: Launch app (home), Connect wallet (signed-out /portfolio), the expanded carry row's action row (below), Get live executable basis (small secondary, with the pulsing square) beside the Collateral basis chart title, and Get quote across the full width of the live-quote modal. tests/e2e/button-system.spec.ts pins the shape, weights, hover, focus and the one-primary rule on each of those areas.

Carry-row modals ​

An expanded Carry trades row ends in one action row, read left to right as a workflow: Check oracles → Simulate PnL → Execute. The first two are secondary buttons that open a dialog (oracle transparency, omitted for a pair with no approved oracle card, and the PnL simulator); Execute is always last, the row's one primary, and opens the venue in a new tab (its visible label is just "Execute"; its accessible name is "Execute on {venue} (opens in new tab)"). Below a 760px row width the buttons stretch and Execute takes a full line. The row's layout lives in globals.css (.carry-actions); the buttons are the shared ActionButton above. Both dialogs sit in one shell, CarryRowModal (src/components/carries/CarryRowModal.tsx): same width, frame, header, close control, scroll behaviour and phone layout. Each dialog supplies only its title, its title icon, an optional meta slot and a body that has no border, title bar or outer padding of its own.

The frame is two boxes, and which is which is the whole point:

  • A fixed header: a 28×28 icon tile, the uppercase title (PNL SIMULATOR, ORACLE TRANSPARENCY; 700 12px, 0.22em tracking), an optional meta slot, and the close ✕. The oracle dialog's meta slot names the pair and venue (sUSDe → USDT · Aave v3) from its first frame and adds its fact chip ("Upgradable" / "Immutable") once the card lands; the slot wraps under the title when the header runs out of width. The simulator leaves it empty: the row it opened from is the context. The header is a sibling of the scroller, never its first child, so it stays on screen for the entire scroll. The title is a real DialogTitle, which gives the dialog its accessible name; the close control's accessible name is "Close".
  • A body, the only thing that scrolls. It holds overscroll-contain as belt-and-braces: Base UI already locks the page while a dialog is open; it earns its place on iOS, where the page rubber-bands behind a modal regardless.

Title icons come from one library in one style: Lucide, outline, a 1.5px stroke at 15px (absoluteStrokeWidth), square caps and miter joins, drawn in currentColor (teal in the tile). The simulator wears calculator, the oracle dialog radio-tower. Any future modal title icon uses the same library and style (titleIcon in CarryRowModal.tsx).

Size. 800px wide from sm up and full width on a phone, and no taller than min(720px, 100svh - 48px). The ceiling is the half that matters: sized in viewport units alone a dialog keeps growing with the screen and stops reading as something laid over the page. The height is bounded in svh, not vh or dvh: svh is the small viewport height, so it does not change when mobile browser chrome collapses mid-scroll (a centred box that resizes moves both edges at once, which reads as the modal jumping). The frame is an inline-size container, so the gutters (clamp(16px, 4cqw, 24px)) and the simulator's column split follow the dialog's own width. Under prefers-reduced-motion the open and close animation is off, backdrop included.

Inside the oracle card, the two pricing boxes are flex: 1 1 260px with a 12px gap, so at 800 they share a row and on a phone they stack. Nothing in the card has a fixed width except its small marks (the 3px accent tick, the 7px side dots, the 22px and 32px coins and tiles): a token symbol may break anywhere, the value column is capped at 60% of its box so the mark and "how it is marked" label wrap inside it instead of dropping below the token, and the vault oracle row wraps its address and Copy onto a line of their own.

Gotcha. Never put Tailwind's relative on the popup. It beats the fixed Base UI centres it with, and the modal drops into page flow at the bottom of the document.

Covered by tests/e2e/carries.spec.ts:

  • the chrome holds its viewport position while the body scrolls;
  • the frame honours both px ceilings on a 1200px-tall viewport;
  • the two dialogs' headers and frames measure identically.

PnL simulator ​

src/components/carries/PnlSimulator.tsx, opened by the action row's "Simulate PnL", in the shared shell above. The body is two columns, 272px | minmax(0, 1fr) (inputs | results), stacking into one below a 640px dialog width (a container query on the shell).

Inputs, top to bottom: Equity capital (thousands commas as typed, the caret kept after the same digit; ↑/↓ step 1,000, Shift 10,000, snapped to the step; ETH and BTC steps scale down), Leverage (a custom slider, 1.0× to the market's maximum in 0.1 steps; it opens at the maximum), Holding period (7d | 30d | Maturity | Custom for a term carry, defaulting to Maturity; 1Y in place of Maturity for a perpetual carry, defaulting to 30d; Custom turns its own cell into a day field clamped to the days left; the field sits beside the Custom radio, which stays the group's one tab stop, and Escape hands focus back to it), the Rates panel (the fixed rate locked at entry, read-only, and the editable Borrow APY, 0–40%, or down to a negative trailing rate, with a "Reset to 30d trailing" link once it differs from the trailing rate) and the Costs panel (Execution, read-only).

Results: Resulting position (collateral and debt in units, USD and the LTV; the leverage is not repeated), the hero Est. PnL after costs · Nd hold, the Holding-period return and Annualised two-up, and the Net APY vs borrow rate chart (a fixed 368×170 viewBox scaled to the panel; formulas and axes in PnL simulator). The chart's y domain eases to a new value over ~250ms instead of snapping, and snaps under reduced motion.

It is live: there is no Simulate button. Every figure is derived on render from the inputs by the pure functions in src/lib/sim/pnl-simulator.ts. Only the execution cost crosses the network: /api/sim/swap-cost is asked 500ms after the reader stops on a new size, each distinct size (equity, leverage to 0.01×, to-maturity or not) is quoted once per open dialog. On open and while a new size is being quoted, Execution shows a small teal spinner beside "Fetching quotes", including the debounce and any rate-limit retry wait. The spinner stays still under reduced motion. A completed unavailable quote shows a dash; a swap-free position shows zero immediately. Until the current quote lands, the hero reads "before costs" (a quote for another size is never subtracted), and a rate-limited answer is asked again after the route's Retry-After. The to-maturity flag follows the route's own one-day tolerance, so a quote is never cached under the wrong exit.

Covered by tests/e2e/pnl-simulator.spec.ts and the zoom sweep's "simulator modal open" surface state (registered once, per the gotcha below: the simulator quotes on open).

Gotcha. Register a dialog that FETCHES as mode: "once", never perWidth. perWidth re-navigates and refetches at each of the ~26 sweep widths, the simulator quotes /api/sim/swap-cost on open, and the oracle panel reads /api/carry-oracle, which is budgeted at 30 requests per IP per minute. The sweep trips that limiter partway through and the panel renders its "Oracle data unavailable right now" state, so the run fails on a rate limit dressed as a layout defect. once costs one fetch and loses nothing: perWidth exists for popups that a resize dismisses, and a Base UI dialog is not one.

Token coins vs curator marks vs issuer marks ​

Four different questions, four different resolvers. Mixing them up is the usual bug:

QuestionResolverExample
What coin is this?components/icons/token-markssUSDe → the sUSDe coin
Who runs this fund?components/icons/curator-marksSentora PYUSD USDC → Sentora's mark
Whose app is it on?components/icons/ProtocolIconsthat same fund → Euler's mark
Who issues this token?components/assets/IssuerIcon, via carries/AssetMarksUSDe → Ethena's logo

A curator fund is three of those at once — a Sentora-run vault holding PYUSD, deployed on Euler — so which mark leads depends on what the cell NAMES. The /portfolio holdings row and the /money-market Fund column both name the fund, so both lead with the curator's mark from curator-marks; the Platform / Execution platform cell beside it names the venue and keeps the protocol mark. Euler's own Prime / Yield vaults are the one case where curator and venue are the same firm. curator-marks.test.tsx fails if a manager in a live vault registry has no mark, or if a curator fund on Euler resolves to Euler's mark.

token-marks is the token-coin registry: one map, every surface (Asset Profiles' TokenIcon, the carries Position column, both Collateral filter dropdowns). It used to be three parallel maps, which is why a newly-listed asset would show its coin on one page and a grey monogram on the others. Add a coin once, here, and every surface lights up. AssetMark stays the issuer resolver and is used only where the issuer is the point (the oracle + simulator panels).

Rules the registry encodes, so callers don't re-implement them:

  • Keys are UPPER-CASE — registry labels drift in casing.
  • A Pendle PT wears its underlying's coin (PT-srUSDe-22OCT2026 → srUSDe), so a maturity roll needs no code change.
  • Wrappers alias their underlying (stETH → wstETH, eETH → weETH). WETH is the exception: it is the one wrapper with a registered coin of its own (CoinGecko 2518 / CMC 2396, the pink-ring wordmark), so it keeps that mark rather than borrowing the ETH diamond — a holdings row or a wstETH/WETH loop has to tell the two apart.
  • Idle CDO tranches match by PREFIX (AA_ / BB_) and wear Idle's issuer mark: the token is minted per borrower and has no coin of its own. This is the documented last resort before a monogram, not a licence to use issuer marks generally. A tranche with a coin of its own is keyed exactly and wins over the prefix (AA_FalconXUSDC wears FalconX's coin, as Morpho draws it).
  • Every coin is a disc, no exceptions. TokenMark clips whatever it draws to a circle and paints a faint rim over it (an outline, the one decoration drawn above an image), so a square tile renders round and a black coin on a black row still reads as a disc. A clip cannot give a bare glyph a disc to sit on, so a file must be a disc or a full-bleed tile; bare glyphs are not accepted.
  • coinsOf() splits a Fluid smart-collateral pair (wstETH/ETH) into legs.

Adding an asset. Prefer the official CoinGecko token image (verbatim, downscaled to 64px). For a collateral a Money Market Fund lends against, take the logoURI the Morpho Blue API returns for that exact contract address (cdn.morpho.org, the coin Morpho's own app draws; an SVG that only wraps an embedded raster, or a very heavy vector, is rendered to a 64px PNG), and where Morpho carries none, the icon on Pendle's asset registry entry for the same token, or the underlying's coin for a wrapper or tranche. Whatever the source, the file must survive the disc clip whole: a badge on the rim gets cut. The icons that used to be bare glyphs or a square tile (wstETH, tETH, osETH, XAUt, LINK, PYUSD, FRAX, crvUSD, USDT) now ship as the issuer's round coin from those sources. Fall back to web3icons (0xa3k5/web3icons) only when none of these is usable, and record the reason next to the entry. For the idle-stablecoin set, prefer an address-keyed registry — Trust Wallet (trustwallet/assets) or Curve (curvefi/curve-assets) — because tickers collide: several live tokens call themselves eUSD or rUSD, and only the contract tells them apart. Never redraw a brand mark by hand; if no registry carries the coin, leave the monogram and say so next to the entry (rUSD is the one such gap today). token-marks.test.tsx fails if a live collateral symbol (including every collateral and deposit asset of a listed Money Market Fund) falls back to the monogram, if a map entry points at a file that isn't in public/, or if a coin renders without its circular clip and rim; symbols.test.ts fails if an asset gains a book without gaining a ticker, which would print a bare 0x1234…cdef in the portfolio's Holdings panel.

Motion ​

The brief is minimal animation: motion exists to prevent a jarring change or to show where something came from, never for decoration. A terminal is scanned, so anything the analyst touches dozens of times an hour stays instant.

Tokens. Three easing curves live in @theme in src/app/globals.css. Defining --ease-out there deliberately overrides Tailwind's built-in curve for the ease-out utility, which is too soft for deliberate motion.

TokenValueUse
--ease-outcubic-bezier(0.23, 1, 0.32, 1)Entrances and exits (tooltips, modals, dropdowns, row panels).
--ease-in-outcubic-bezier(0.77, 0, 0.175, 1)Movement across the screen.
--ease-drawercubic-bezier(0.32, 0.72, 0, 1)Sliding panels: the mobile drawer.

Hover and color changes keep the plain ease keyword at 150ms, the app's one hover duration.

Rules the code follows.

  • Transitions, not keyframes, for anything reversible. A transition retargets from wherever the motion currently is; a keyframe restarts from zero. Tooltips (ui/tooltip.tsx) and the @starting-style entrance in globals.css (.popup-enter) are transitions for this reason. .expanded-panel-enter is the deliberate exception: it is a keyframe keyed off details[open], not @starting-style. @starting-style fires only when an element is first inserted, and three of the screener tables latch their panel mounted after the first expand (hasOpened, so the heavy charts are not rebuilt on every toggle), so the entrance ran exactly once per row and then silently stopped playing. Matching the selector replays it on every open. A one-shot entrance has nothing to interrupt, so a keyframe is safe there.
  • Transform and opacity only. Never animate height, width, or width-driven fills: they cost layout and paint.
  • A popover scales from its trigger, on BOTH axes. .popup-enter sets transform-origin: top, which is top centre, so it is only half the rule: a panel pinned right: 0 to its button grows from a point half its own width away from that button, and the one edge the reader is watching (the edge touching the trigger) is the one that drifts. Add .popup-enter-right wherever the panel is right-anchored. Carried today by the portfolio's settings and wallets popovers. Known gap: the three left-0 dropdowns in ui/filter-controls.tsx still run on the bare class and have the same defect mirrored, drifting by half their scale-up on the left edge; they want a matching .popup-enter-left.
  • Name the property Tailwind v4 actually emits. scale-95, rotate-90 and translate-y-px compile to the standalone scale, rotate and translate properties, not to transform. An explicit transition list that names only transform therefore fails to animate any of them, silently and with no build error. Name the real property (scale, rotate, translate), or use the plain transition utility, whose property list covers all three and still excludes the layout properties that transition-all would drag in.
  • Exits are faster than entrances. Opening is the deliberate act; dismissing is the system responding. Modals run 200ms in / 120ms out; the mobile drawer 250ms / 180ms; the row-expansion and dropdown entrances have no exit at all.
  • Durations. Tooltips 150ms, dropdowns and row panels 150-180ms, modals and drawers 200-280ms. UI motion stays under 300ms. The one exception is the screener row-expand scroll (scrollToTop): scrollIntoView takes no duration, and the browser scales its own animation by distance, so opening a row far down a long table runs past 300ms. The alternative is a hand-written scroll tween, which is more moving parts than the jump is worth.
  • Charts never animate. Every Recharts series and <Tooltip> sets isAnimationActive={false} — the default 400ms tooltip tween makes the readout trail the crosshair, and a re-drawing line on every filter change is noise.
  • JS hover must be touch-gated. Tailwind's hover: utilities compile inside @media (hover: hover) and are safe. JS hover state is not: a touch browser fires mouseenter on tap and never fires the matching mouseleave, so the highlight sticks. Gate onMouseEnter on useCanHover() (src/lib/use-can-hover.ts) and leave onMouseLeave ungated. The 2026-07 motion pass gated the highest-traffic sites; ungated onMouseEnter handlers remain (filter-controls, PortfolioClient, CapacityTightPanel, AppSidebar) — apply the gate when touching those files.
  • Reduced motion keeps the fades, drops the movement. tw-animate-css ships no prefers-reduced-motion handling, so every moving surface carries an explicit motion-reduce: override or a media query in globals.css. A programmatic scroll needs the preference read in JS: a behavior passed to scrollIntoView overrides the CSS scroll-behavior property, so a media query alone cannot quiet it. Route every programmatic scroll through scrollToTop (src/lib/scroll.ts), which reads the query itself. Note its still branch passes "instant", not "auto": per CSSOM-View "auto" defers to the computed scroll-behavior, so it would start gliding again the day anything sets that property.
  • A transition that must be quietable does not belong inline. An inline transition outranks every normal stylesheet declaration, so the plain transition: none in the shared reduced-motion block cannot reach it and the motion plays at full strength under prefers-reduced-motion: reduce. It is not unreachable: per CSS Cascade, an important author declaration beats a normal inline one, so transition: none !important does win (that is exactly what transform: none !important does for .popup-enter in the same block). Prefer a class anyway — it keeps the rule and its override in one place instead of scattering !important through the sheet. Two exist for this reason: .mobile-scrim (nav scrim fade) and .disclosure-chevron (portfolio wallet-card + position-row chevrons). The state stays inline in both — the chevron's transform: rotate(...) is state, not motion.

API routes (src/app/api/) ​

All are dynamic = "force-dynamic" (no ISR).

RouteMethodPurpose
/api/carry-oracle?key=<strategyKey>[&view=card]GETTwo readers, neither able to take the other down. view=card: the oracle card for one carry (src/lib/data/oracle-card.ts), approved copy assembled with live on-chain reads (oracle-card-reads.ts); a card that cannot be served in full (a failed read, a verified fact that no longer holds, no approved blocks) is a 502 with the reason logged server side, and the panel shows its error line. Default: the retained secondary-market basis fields available to existing consumers (basis, debtBasis, basisLegs, debtBasisLegs, basisNote, ptDepth, debtBasisNote, from src/lib/data/basis.ts), which never wait on the chain. The oracle card is fetched lazily when its dialog opens. The former Market depth modal is no longer offered on the carry page; Trade analytics uses its own history endpoint.
/api/carry-analytics?key=<strategyKey>&view=utilization|prices[&collateral=<address>&funding=<address>]GETLazy Trade analytics history. Resolves only listed carries, with server-owned collateral/funding constituents. Utilization reads existing per-venue snapshots. Prices return basisSeries for every collateral constituent against its own USD/ETH/BTC reference, with aligned six-hour samples, share rates, gaps, estimate flags, pricing classifications and permitted quote-settlement metadata. Optional legacy pair selections are validated; prices retains the selected collateral's market/redemption values in selected funding-token units, while basisSeries remains independent of funding-price coverage. PTs have utilization only. Cache-Control: public, s-maxage=1800, stale-while-revalidate=3600; 30 requests/minute/IP. No database writes.
/api/carry-basis-quotePOSTDirectional basis at an entered size. Body {key, collateral, funding, side: "buy" | "sell", amount: string}; funding names the server-authorized settlement token, buy amount is settlement spent, sell amount is collateral sold. ETH-base collateral may settle in canonical WETH outside the debt constituents; USD-base collateral uses a distinct actual funding token; BTC reference pairs are rejected before any DEX request. Validates the pair, decimals and amount, then uses a fresh exact-input quote and current redemption reference. Returns average execution, redemption, signed basis in bps and settlement units, input/output amounts and timestamps. The modal clears results after 30 seconds. Gas excluded, no transaction submitted. no-store, 10 requests/minute/IP.
/api/carry-history?key=<strategyKey>GETOne carry strategy's full 6h-cadence CarryHistoryPoint[] series (the array getCarryHistory produces). Fetched lazily by the row's expansion chart (CarryChart) on first expand, so the prerendered /carries RSC payload no longer ships every strategy's series up front. The key is resolved through resolveShownStrategies (src/lib/data/carry-strategies.ts) — the same resolver /carries uses to build its rows — so it can only resolve the exact StrategyCore the row was built from; a key that is not shown is a 404. Cached s-maxage=1800, stale-while-revalidate=3600 (mirrors carry-oracle; the series only moves on the 6h cron).
/api/series-quality/statusGETUp to when the stored rate history carries a data-quality verdict: { judgedThrough }, the latest six-hourly judge tick in epoch ms once the one-time re-judge has run, null before that or when the database cannot say (never an error). Read once per page load by the charts' edge-marker label (src/components/charts/judged-through.ts), which calls a marked reading of a judged rate "a real reading" only up to that moment. One answer for every visitor: s-maxage=300, stale-while-revalidate=600; 30 requests/minute/IP.
/api/money-market-fund-history?slug=<slug>&range=<1m|3m|6m|1y|max>GETOne money market fund's share-rate, TVL and benchmark series over the requested window. Fetched lazily by the expanded row's chart card (FundPerformanceChart) on first expand, so the prerendered /money-market-funds payload ships its rows and nothing else. Same shape and the same reasons as carry-history above: the slug resolves through the reader the page builds its rows from, so a fund the tab does not list is a plain 404; a malformed slug or an unknown range is a 400 before any query runs; per-IP damping at 30 requests a minute. Cached s-maxage=1800, stale-while-revalidate=3600 (the series only moves on the 6h cron).
/api/money-market-fund-detail?slug=<slug>GETOne money market fund's drawer: its brief, statistics tower, per-market allocation table, exit panel and control panel. Fetched by the row on first expand, for the same reason the chart's series is: measured on the fixture, a drawer is roughly seven times the weight of the row it sits under, so prerendering all of them tied the page's transfer to how many funds an administrator has approved rather than to what a reader opens. Same guards as the history route beside it: an anchored slug pattern, a plain 404 for a fund the tab does not list, per-IP damping at 30 requests a minute, s-maxage=1800, stale-while-revalidate=3600.
/api/repo-marketsGETThe repo-lending market universe with the two facts a LENDER's position row cannot carry about the book it supplies: the collateral underwriting that book (largest exposures first, plus the total count) and its current utilization. Same figures /repo-lending publishes, read market-side by src/lib/data/repo-market-context.ts — one latest row per market, deliberately not getMoneyMarketRates(), whose per-market history scans answer a different question. Public and account-free by construction (every wallet supplying USDC on Aave v3 lends into the one market), which is what makes it edge-cacheable and usable by an agent querying the same analytics. Fetched by /portfolio once per page load, when the selection first holds a Repo lending, Smart repo lending or Money market funds row and never for a past day, for the Repo lending rows' Collateral exposure and Utilization and the Smart repo lending rows' market links; cached s-maxage=1800, stale-while-revalidate=3600. Beside the markets it serves funds: each money market fund the screener lists, with the share of it withdrawable now (the screener's own Exit liquidity) and its deep link, for the Money market funds rows' Exit liquidity and View fund; held in process for 5 minutes (a failed refresh serves the last good answer), and left off the response when no answer has been read yet.
/api/sim/swap-costPOSTReal execution-cost quote for the leveraged-carry simulator via the shared Fynd-first, Kyber-second service. Reciprocal round-trip method; returns { ok: false } rather than an estimated-bps fallback when a leg is unquotable. Both legs are sized at the entry borrow (roundTripNotionals), so the figure is the price of the round trip at today's depth and does not drift with the holding period — see Execution costs for what that knowingly omits. Also returns maturityExit: true when a PT exit was priced as redeem-at-par plus the proceeds swap rather than as a market sale. No UI in this app reads that flag; it is part of the response for API consumers pricing their own exits, and it reports what was priced rather than which branch was attempted.
/api/portfolio/pt-exit-cost?position=pendle:pt:<pt>[&wallets=<a>,<b>]GETSigned in. What selling a directly held PT would cost right now, for the Exit execution cost of an expanded Fixed rate assets row's Exit now scenario, fetched when the reader presses Get live execution cost (src/lib/portfolio/pt-exit-cost.ts): ONE sell quote for the account's whole holding (summed over the named wallets, each tracked by the session's account, 403 otherwise; the size is read server-side, never taken from the caller) through the shared Fynd/Kyber service with an authorized Pendle venue fallback (src/lib/data/swap-quotes.ts), against the position's value at the moment of the quote (the PT rate by the one rate method at the chain's current block, carried into the row's book by the row's own converter; the row's reading stands in only if under ten minutes old). Returns { ok, cost, costPct, proceeds, reference, referenceSource, quotedAt, book }, the cost SIGNED (negative when the quote is above the current price), or { ok: false, reason }. no-store; identical in-flight requests share work; each new request quotes afresh.
/api/notify-capacityPOSTCapacity-alert email capture → capacity_notifications (honeypot + partial-unique-index dedupe; the send pipeline is not wired yet, this only captures).
/api/newsletter/subscribePOSTNewsletter signup → newsletter_subscribers (ON CONFLICT DO NOTHING).

Abuse damping (per-IP rate limits). The public, unauthenticated routes carry a small in-memory per-IP fixed-window limiter (src/lib/rate-limit.ts) so one caller cannot burn external quote quota (Fynd/Kyber/Pendle) or hammer the on-chain/DB writers. Budgets, per IP per minute: sim/swap-cost 20 (the PnL simulator re-quotes live as the reader settles on a size), portfolio/pt-exit-cost 10 (signed in, but it spends the same Pendle quote quota), carry-oracle 30, carry-history 30, repo-markets 60, auth/verify 10, auth/nonce 30, newsletter/subscribe 5, notify-capacity 5 (on notify-capacity the honeypot check runs first, so a bot still gets the lying 200, never a 429). Over-limit returns HTTP 429 with a Retry-After header. The client key is the visitor IP from cf-connecting-ip first (Cloudflare fronts the origin and nginx sets X-Real-IP to $remote_addr, which is the Cloudflare edge IP, not the visitor, so keying on it would collapse many visitors into one bucket), falling back to x-real-ip then the first x-forwarded-for hop; this is best-effort damping, not a security boundary; the real guards stay with each feature (the SIWE session, the chat token budget). health and the session-gated portfolio/chat routes are never IP-limited: chat has its own per-user token budget, and the live portfolio read has its own per-wallet cooldown in src/lib/portfolio/live.ts (five minutes, PORTFOLIO_LIVE_COOLDOWN_MS), which a page load and the Synchronize button are answered by alike. State is a single per-process Map (the app runs as one PM2 process); a restart only resets windows, which forgives, and an nginx-level limit_req remains a recommended second layer for launch.

Repo map ​

src/
  app/
    page.tsx                    # Home (landing, outside the app shell)
    not-found.tsx               # 404, in the landing's frame, links into the app
    (app)/                      # route group: every page in it renders inside the app shell
      layout.tsx                # app shell: access gate, AccountProvider, sidebar, mobile nav
      portfolio/page.tsx          # Portfolio (prerendered public shell + PortfolioClient)
      repo-lending/page.tsx       # Repo Lending
      carries/page.tsx            # Carry Trades
      money-market-funds/page.tsx # Money Market Funds
      multi-strategy-funds/page.tsx # Multi-Strategy Funds
      asset-profiles/page.tsx     # Asset Profiles
      {repo-lending,carries,money-market-funds,multi-strategy-funds,asset-profiles}/loading.tsx # route loading skeletons
    api/                        # auth/*, carry-oracle, carry-history, carry-analytics, carry-basis-quote,
                                #   sim/swap-cost, notify-capacity, newsletter/subscribe
    layout.tsx, globals.css     # root layout (fonts, metadata), Tailwind v4 tokens
    sitemap.ts, robots.ts, manifest.ts
  components/
    assets/                     # AssetsTable, AssetProfilePanel, TokenIcon, IssuerIcon
    charts/                     # ChartWatermark (the mark and wordmark behind the charts), fit-axis (the
                                #   shared y-axis rule for the Recharts charts and the two hand-built
                                #   /carries detail-panel plots), axis-format (shared
                                #   tick labels), OffscaleMarker (the edge marker), axis-guard.test (the
                                #   check that no chart sizes its own y axis)
    auth/                       # AccountProvider (shared SIWE session context)
    portfolio/                  # PortfolioClient (auth-gated /portfolio region)
    carries/                    # CarriesTable, CarryChart, CarryContributionChart, TradeAnalyticsPanels,
                                #   ExecutableBasisModal,
                                #   OraclePanel (the oracle card), CarryRowModal (the shell both row dialogs share),
                                #   PnlSimulator (the PnL simulator dialog), capacity charts,
                                #   FundingShockPanel (the Funding shock cell and its detail panel),
                                #   CarryRangePanel (the Carry range cell and its detail panel),
                                #   DetailGlyph (the mark both panels open from, and their shared geometry),
                                #   carries-tokens (the table's palette and cell class, shared with the panels),
                                #   FundingCurveChart + funding-curve (the Funding shock detail's curve),
                                #   CarryRangeChart + carry-range-detail (the Carry range detail's plot)
    strategies/                # (serves /multi-strategy-funds) StrategiesTable, PeerReturnsChart, StrategyChart, FundBrief, UsdVaultRows
    funds/                     # (serves /money-market-funds) MoneyMarketFundsTable, FundDrawer, FundGlanceTower,
                               #   FundAllocationPanel, FundExitSection, FundControlSection, FundPerformanceChart
    money-market/              # (serves /repo-lending) MoneyMarketTable, MoneyMarketRatesChart, UnderwrittenCapital
    icons/                     # ProtocolIcons (venue marks), TokenIcons,
                               #   token-marks (THE token-coin registry),
                               #   curator-marks (THE fund-manager registry)
    layout/                    # AppSidebar, MobileNav, NavSections
    ui/                        # Base UI wrappers (Button, Dialog, Tooltip, ...)
                               # + terminal-table.tsx (shared table primitives:
                               #   PanelHeader, ColId / ColMetric headers,
                               #   TableRow, Cell, HeadlineMetric,
                               #   ExpandedPanel, SofrPill)
    hooks/                     # useRowDeepLink
    loading/                    # RouteLoadingSkeleton (route-level loading.tsx fallback)
    seo/                       # JsonLd
  lib/
    data/
      apy.ts                   # canonical annualisation + index-ratio math
      postgres.ts              # pg Pool + typed query()
      rpc.ts / rpc-batch.ts    # eth_call / archive / storage / block-by-ts; batched Multicall3 + getLogs
      adapters/                # fluid-ll.ts, fluid-dex.ts (per-venue on-chain decode)
      carries-table.ts         # carry strategy readers + distributional stats
      carry-analytics*.ts      # listed-carry constituents, utilization and per-collateral base-unit histories
      market-price-history.ts # aligned historical prices, reference/share-rate conversion and provenance
      carry-basis-quote.ts     # authorized exact-input pair and fresh directional redemption basis
      strategies-table.ts      # multi-strategy fund share-rate readers
      assets-table.ts          # asset profiles table reader
      money-market-rates.ts    # repo-lending supply-rate reader
      morpho-markets.ts        # Morpho Blue isolated-market registry + reader
      oracle-card*.ts          # the oracle card: approved copy, verified facts, assembly, live reads
      oracles.ts               # pricing-mode taxonomy for the basis reader
      basis.ts                 # secondary-market basis legs (token_basis)
      vault-capacity.ts        # Fluid / Aave borrow-cap reader
      liquidation-threshold.ts # the one liquidation-threshold reader (oracle card + the screener's stored copy)
      vault-risk.ts            # the screener's stored max-LTV / liquidation-threshold copy
      cap-exposure.ts          # max-potential-exposure / underwritten capital
      sofr.ts                  # SOFR index reader
      usd-at.ts                # a token's USD price at a moment, from the stored hourly bars
      llama-prices.ts          # DefiLlama client: bar-table writers, live-tip backup, listing jobs
    sim/
      leveraged-position.ts    # buy-and-hold leveraged carry simulator model
    auth/                      # session.ts (server SIWE machinery), accounts.ts (accounts writer),
                               #   siwe-client.ts (shared injected-wallet client flow), address.ts (truncate)
    format.ts                  # fmtUsd / fmtPct / fmtBps / fmtNumber
    seo.ts                     # canonical URLs, structured data
  data/
    asset-profiles.ts          # the asset profile record: seed, register-derived chips, validation
    curator-vaults.ts          # auto-generated curator-fund registry (portfolio + assistant)
    money-market-fund-narratives.ts # per-manager house line + per-fund mandate (/money-market-funds)
scripts/
  refresh-*.ts                 # cron entry points (assets, vault-capacity, collateral-exposure, ...)
  refreshers/                  # the actual ingestion jobs + shared.ts
  backfill-*.ts                # one-off history backfills
  sync-carries.ts, fluid-discovery.ts, sync-curator-vaults.ts  # ad-hoc
  check-oracle-cards.ts        # weekly oracle card completeness + drift check
  run-cron.sh                  # cron wrapper (sources .env.local, runs via tsx)
  sql/                         # 001..043-*.sql schema migrations (DDL for every table)
docs/                          # this VitePress site (also served at docs.creddit.xyz)

Database ​

PostgreSQL, schema onchain_credit. Time-series tables are written only by the refreshers; the app reads them and writes only the two email-capture tables. The DDL for every table lives in scripts/sql/001..043-*.sql — read those for exact columns. The market-data core is these ~23 tables; the neutral accounts, the chat-assistant tables, and the three read-only-portfolio tables (migrations 042/043) are covered in Database & schema:

Table~rowsTable~rows
aave_v3_reserve_apy~12.3kmorpho_market_apy~11.1k
assets~11newsletter_subscribers~2
capacity_notifications~1schema_migrations—
chain_scan_cursors~4sofr_rates~2.1k
curator_vault_state~35sparklend_reserve_apy~8.2k
fluid_dex_apy~55.2ktoken_basis~36k
fluid_ll_apy~54.4ktoken_yield_apy~112k
carry_registry~130vault_capacity~28
lending_borrowers~77.5kvault_risk_params~57
lending_positions_current~2.1kmarket_collateral_exposure~18.6k
lending_reserves~85market_risk_current~6
pendle_markets~55pendle_market_state~4.7k

New tables follow agent-grade conventions (canonical chain_id + lower-cased address keys, block-anchored rows, *_current split from snapshot history, an explicit basis column on derived rows). See Database & schema.

Deployment topology ​

The app runs on a Hetzner box (ssh root@dexhq.io, key ~/.ssh/hetzner_ed25519).

ConcernProductionStaging
Repo/opt/onchain-credit (tracks origin/main)/opt/onchain-credit-staging
Processpm2 onchain-credit on localhost:3001pm2 onchain-credit-staging on :3002
Edgenginx → https://creddit.xyz (Cloudflare in front)nginx vhost https://staging.creddit.xyz (Let's Encrypt, HTTP basic-auth .htpasswd-staging, noindex)
Databasecreddit (role onchain_credit, schema onchain_credit)separate DB creddit_staging (role onchain_credit_staging)
DeployCI on every push to main (deploy.yml, see below)CI on every push to staging (deploy-staging.yml); data is a nightly PII-scrubbed reseed of prod — see Deployment §3

Other pm2 processes co-located on the box: rindexer, dexhq, creddit-indexer. The prod DB is backed up daily at 02:15 UTC via scripts/ops/backup-creddit.sh.

Production deploy (.github/workflows/deploy.yml) ​

Triggers on every push to main (concurrency group deploy-production, one at a time). A GitHub runner SSHes to root@dexhq.io (pinned host key; key from the DEPLOY_SSH_KEY secret) and runs:

bash
git fetch <https + ephemeral GITHUB_TOKEN> && git reset --hard FETCH_HEAD
npm ci
npm run build
pm2 restart onchain-credit --update-env
bash scripts/ops/restart-ingester.sh   # the event ingester, then the ledger worker; leaves a stopped one alone

.env.local and node_modules are gitignored, so reset --hard preserves secrets and deps. On build failure it rolls back to the previous commit, rebuilds, and restarts the ingester and the worker onto that build.

The deploy ships code only. It does not run DB migrations, backfills, or data refreshers — those are manual server steps after a deploy. And because pages are prerendered at build time, if a refresher ran after the build, re-run the deploy to re-prerender or the data stays stale up to the revalidate window.

Known gaps ​

  • Branch protection is advisory, not enforced: a free-plan private repo, so GitHub cannot require PR-only main or green checks. ci.yml and the pre-push guard report but cannot block; the fix is GitHub Pro (see Deployment §2).
  • Prod migrations stay a gated manual step (migrate.sh by hand after a release); staging auto-applies additive migrations on deploy.
  • Deploys rebuild in place, over the previous build's output. deploy.yml runs npm ci && npm run build on the box with no .next cleanup and restarts pm2 only afterwards, so the old process serves while .next/static is being replaced underneath it. Rebuilding into a dirty .next was observed to produce two distinct failures: page HTML referencing the previous build's CSS chunk, which then 404s into a completely unstyled page, and an outright build failure on stale next/font modules. A clean build produced neither. This is the demonstrated delivery path for the stale-stylesheet collapse described under Where a screener's column template lives; the fix is to clear .next before building (and, separately, deploymentId for real skew protection).

The full staging → prod pipeline (auto-deploy on push to staging, the staging → main release PR, the nightly reseed) is live and documented in Deployment.

External dependencies ​

DependencyUsed forWhere
Ethereum RPC (ETHEREUM_RPC_URL)current on-chain statesrc/lib/data/rpc.ts
Ethereum archive RPC (ETHEREUM_ARCHIVE_RPC_URL)historical / archive readssrc/lib/data/rpc.ts
DefiLlama Coins APIa bar-table writer (aggregate feed, hole fill), the live tip's backup, the listing jobs' prices, block-by-timestampllama-prices.ts, rpc.ts
NY FedSOFR ratesrefreshers/sofr-rates.ts
Dune APIthe hourly price bars every USD figure is read from, plus analytics (scarce credits)refreshers/price-bars.ts, backfills
Morpho Blue GraphQL APIMorpho market + curator datarefreshers/morpho.ts, morpho-markets.ts
Euler Goldsky subgraphcurator/market datarefreshers/curator-vault-state.ts
Fynd → Kyber → authorized Pendle venueall live user-requested swap quotessrc/lib/data/swap-quotes.ts

Running locally ​

bash
npm install
npm run dev        # http://localhost:3000
npx tsc --noEmit   # type check (must be clean)
npm run build      # production build
npm test           # node --test over the listed test files; the golden gate needs Postgres 16

cd docs && npm install && npm run dev   # this docs site

npm test is an explicit file list in package.json, not a glob. A *.test.ts added but not listed never executes and never fails, so every change that adds a test file edits that list in the same commit. CI runs the list as two jobs (Processes, E.5): npm run test:fixture is the suites that build a fixture database, a second list that a new such suite joins as well (run on the release PR), and npm run test:unit is the rest, computed by scripts/ci/test-halves.mjs (run whole on the release PR, and on a feature PR narrowed to the tests that can see the change by scripts/ci/affected-tests.mjs).

Engine-v2 scenario harness ​

src/lib/portfolio/v2/fixtures/ holds the deterministic fixture harness the portfolio engine rebuild is specified against, and src/lib/portfolio/v2/scenarios/ holds the cells that use it. It exists because two failure modes are already recorded against this repo's fixtures and both are invisible in a green suite: fixture rates that are perfectly exponential make windowing bugs impossible to see, and assertions against non-unique magnitudes pass without matching their own case.

The pieces, and the discipline each one enforces:

modulewhat it gives a test
allocator.tsevery principal, receipt, growth factor and price wedge, derived from one ordinal so any number in a failing assertion traces back to the case that owns it. Growth paths are irregular and non-monotone, with one flat interval and one negative one. ETH cases are scaled so they never collide with USD magnitudes.
grid.tssnapshot points and block-ranged intervals: a receipt belongs to (b0, b1] by its own block, never by wall clock. Carries a 24h interval, a 6h interval, a missed cron window and a page-load read at a non-aligned second.
rows.tsflow-ledger rows with every CHECK constraint from migration 082 mirrored in TypeScript, so a case cannot assert behaviour over a row the database would reject. The enumerations are cross-checked against the migration file itself. It also carries the identities the data contract states across a leg's rows rather than within one — the running-balance recurrence and the quantity self-audit, both with no tolerance — because a corpus that breaks one is a corpus no real ledger could hold.
reference.tsthe expected number, computed by a five-line reducer written on the test side. Expectations are never produced by calling the code under test.
withholds.tsthe assertion that a case books the right number for the right reason: the withheld magnitudes, the alarm list and their counts, not only the figure. A case that books correctly by suppressing an alarm is still a defect.
mutation.tsthe tolerances, and the rig that reverts the rule a case exists for and requires the number to move by more than ten times that tolerance. A case whose expectation survives its own mutation is not a spec.
matrix.tsthe registry of every case, each declaring whether its inputs are a tracked wallet's own history, a decoded public transaction with no tracked wallet in it, or constructed. That declaration is what tells a reader what a passing case actually proves.
history.tsgenerated histories for the property tests, each with positions that close and sit out an absence — most reopening at a different size, one in five closing for good, because a full close that never returns is the worst incident the matrix records and a population without one lets a property about it pass over an empty set.

scenarios/harness-worked-example.test.ts is the end-to-end demonstration: it reverts to the pre-fix wall-clock convention and shows the booked figure moving by the whole receipt per interval while the total over the whole history is unchanged, which is why that defect survived in a shipped engine.

scenarios/prod.ts is the counterpart for the cases whose inputs are a tracked wallet's own history: it turns transcribed snapshot rows and ledger rows into the engine's input shape, and it may not generate a magnitude. The two columns the retired ledger did not carry — the quantity a movement left behind, and whether it emptied the position — are supplied only where snapshot presence itself is the witness, and that rule is written at the top of the file so a reader can tell a transcription from an assumption.

The matrix, and what "complete" means ​

matrix.ts registers 103 cases across five blocks, and every one of them is now written. The registry and the cases check each other in both directions: a case marked written with no test naming it fails, and a test naming a case still marked unwritten fails too, so the registry cannot drift from what the suite actually covers.

blockcaseswhat it covers
A31every attribution class against every event, with both endpoints read and priced
B15the coverage conditions: read gaps, missing receipts, unpriced marks, uncertified scopes, ambiguous pairings, ghost rows
C38the eighteen named situations — rewards, costs, escrowed exits, credit losses, migrations, cross-wallet movement, router hops, exits into unlisted assets
D8the seizure algebra, plus two guards a number-only case would pass while broken
E6properties over generated histories rather than over one built case
anchors5the five verified production incidents, each asserted as a defective-versus-corrected pair

The five anchors are the ones worth knowing about: +36.87, +23.17, +51.76 and +57.14 of return booked across stretches of time the positions were not held at all, and a −0.113 ETH closing settlement reported as roughly +0.001. Every one is reproduced from the wallet's own stored rows by the formula that produced it, so the corrected figure is measured against the incident rather than against a description of it.

Block E's six properties are the ones a case-by-case suite cannot make. Three matter most: no interval ever spans an absence, with a provable zero in between; an exit and a re-entry whose amounts are identical on both sides still books zero, which is the case any size-based rule passes while getting it wrong; and a scan that fails if any of the deleted size thresholds reappears anywhere under src/. It cannot pass vacuously: it asserts it found sources to scan and that reverting the rule turns it red, and it reads code rather than prose, so naming a threshold in a comment does not trip it.

Golden portfolio harness ​

scripts/ops/golden-portfolio.ts freezes what the portfolio API serves over the fixture database into tests/golden/, one JSON file per wallet and surface, so a change that is meant to move no served number can show that it moved none. scripts/ops/golden-portfolio.test.ts is its gate, and it runs inside npm test.

What it captures. For every tracked wallet in scripts/fixture/seed.sql: the summary, the positions (live and at two past days), the history (every view, both grids), the activity statement (live and dated, with and without the held-back costs, plus one filtered read per position, venue and action the statement offers), the events ledger and the coverage notes. For every account that tracks more than one wallet: the ?wallet=all summary, positions, history and events. It calls the served builders directly, with the arguments their routes pass. /risk, /prices and /pt-exit-cost are live reads with nothing stored behind them and are not captured.

How it stays deterministic.

  • The clock. The process clock and the fixture's build clock are both pinned to 2026-07-01 00:00 UTC, and a served statement that reads the database's clock fails the run.
  • The network. Nothing leaves the process. The two on-chain reads the fixture's served GETs make have test seams: a block-pinned rate read answers "unreadable" and must not happen at all over the fixture, and the Fluid vault-to-pool read answers from pools the harness declares. Each seam's call count is pinned. Any other on-chain or network read (a PT's rate or redemption factor, a token's decimals(), a vendor price) has no seam: it reaches fetch or a socket, and fails the run. The guard is in place for the whole process, from before any served module loads: it is the harness's first import, and installs itself when the harness is the process's entry point.
  • The database. A served statement that writes, reads a volatile source, or fails (even when the served code catches the failure) fails the run. The fixture server must be Postgres 16 collating as C.
  • The query plan. The gate reads the fixture twice, the second time from a copy that has been ANALYZEd and has index scans and hash aggregation turned off, so a served order that depends on the plan fails the gate instead of flaking later.
  • The stored values. The goldens are read from the fixture's stored portfolio values, which scripts/fixture/generate-values.ts computes with the writers' own valuation. Beside its two reads the gate re-runs that generator with --check on a facts database of its own, so a writer change that moves a stored value fails the gate until seed-values.sql is regenerated, rather than leaving goldens that still match stale values.
bash
npm test                                                        # includes the gate
node --import tsx --test scripts/ops/golden-portfolio.test.ts   # the gate alone, about five minutes
npx tsx scripts/ops/golden-portfolio.ts --check                 # build, generate, diff; exit 1 on any difference
npx tsx scripts/ops/golden-portfolio.ts                         # regenerate tests/golden

The gate is bounded (ten minutes on CI, an hour elsewhere, GOLDEN_GATE_TIMEOUT_MS to set it), and kills every process it started when it runs out, so a hung child fails the gate by name rather than holding the run. Every golden fixture build (buildGoldenFixture, not a plain build.sh build) first drops the databases a killed run left behind on the shared fixture server: those named for a process (creddit_<family>_<pid>, and their _<suffix> copies) whose process no longer exists and that nobody is connected to. It goes by the name alone, so a hand-made clone takes a name under creddit_fixture_* (creddit_pr_960 would read as process 960's).

A PR that moves a served number regenerates tests/golden, and the golden diff states what moved. A PR that changes the fixture's inputs (the seed and its generated value file seed-values.sql, a migration, bootstrap.sql, build.sh) regenerates too: manifest.json records the hash of each, and if it is the only file that changes, no served number moved.

Another database (the ledger-first comparator). To snapshot another database, such as staging, pass --db-url with --wallets (the instant defaults to the capture hour and the days to the two full UTC days before it; --now and --asof override them) and --out: a capture always writes a tree of its own, never tests/golden, and into a directory that is new, empty or a previous capture's tree, because writing a tree deletes every JSON file there that the new tree does not hold. The sessions are read-only. The manifest records each wallet's newest reading and derive cursor, the ingested tip and the input marks: the price bars, share rates, fund states and PT factors, the token registry, the held funds' registry rows, and per wallet how many readings and ledger rows it has, with an md5 over each set (every column, in primary-key order, read in UTC), so a row rewritten in place shows. A second capture passes --pin-from with the first one's manifest.json: it reads at the same instant, days, wallets and surfaces, refuses when a wallet's newest reading moved (--override captures anyway and records it), and reports every mark that moved. It digests the rows over the columns the first capture digested, so a column added since is reported by name and moves no digest. --perturb-plan reads under the gate's planner settings, so a second capture that comes out byte-identical shows the served output does not depend on those plan choices.

Accounts + sign-in (SIWE) ​

Identity is Sign-In with Ethereum (SIWE, EIP-4361): the user signs a nonce-bound message with an injected wallet, the server verifies it, and issues a short HMAC-signed httpOnly session cookie carrying the lowercased wallet address. That wallet address IS the one creddit account (uid), and the same account gates every signed-in surface: the portfolio, and the assistant API still wired up behind its removed UI. The auth layer is deliberately account-neutral; feature config (chat model gating, budgets) lives next to each feature.

  • Neutral machinery (src/lib/auth/session.ts): issueNonce / consumeNonce (single-use, in-memory, 5-min TTL), verifySiwe (nonce + domain binding; a mainnet public client so ERC-1271 / ERC-6492 smart-wallet signatures verify too, EOAs verify offline), cookieValueFor / cookieOptions / expectedDomain, and verifySessionCookie (constant-time HMAC; the address is only ever read from this verified cookie, never from a request body). Server-only (node:crypto + viem); never imported from a client component.
  • Cookie: creddit_session. The read path also accepts the legacy creddit_chat cookie so sessions predating the rename stay authenticated; the write path only ever issues creddit_session. Secret: SESSION_SECRET, falling back to CHAT_SESSION_SECRET. SIWE domain pin: SIWE_DOMAIN (required in production), falling back to CHAT_SIWE_DOMAIN.
  • Host allowlist (SIWE domain binding). expectedDomain resolves the domain a SIWE message is verified against with a fixed precedence: the SIWE_DOMAIN / CHAT_SIWE_DOMAIN pin wins (operator override); if unset, the request Host is accepted only when it is in a built-in allowlist of known creddit hosts (creddit.xyz, staging.creddit.xyz, and localhost / 127.0.0.1 on the dev ports), matched case-insensitively; anything else resolves to null and verifySiwe fails closed. The request Host is no longer blindly trusted: the production nginx is a catch-all vhost that forwards whatever Host a client sends (proxy_set_header Host $host), so echoing it into the SIWE domain would let a phishing relay bind a victim's signature to an attacker origin and mint a session for the victim's address. Operators must still pin SIWE_DOMAIN in prod; the allowlist is a safety net, not the primary control. See the Origin & SIWE hardening runbook.
  • Routes (src/app/api/auth/): GET /nonce (mint a nonce), POST /verify (verify the signed message, set the cookie, upsert the account), GET /me ({ address } from the cookie, else 401), POST /signout (expire both cookie names). The injected-wallet client flow lives in the neutral auth layer (src/lib/auth/siwe-client.ts); the /portfolio sign-in prompt drives it through the shared AccountProvider context.
  • Account creation (src/lib/auth/accounts.ts, migration 042): a successful /verify upserts onchain_credit.accounts — insert on first sign-in (created_at is the portfolio "tracked since" anchor, created_block = eth_blockNumber at verify time, best-effort/nullable), bump last_seen_at thereafter. The upsert is best-effort: a DB or RPC failure is logged and never blocks issuing the session cookie.
  • Feature config stays with its feature. src/lib/agent/session.ts keeps only chat config (getChatConfig: enablement, model gating, daily token budgets) and imports the session secret from the neutral layer. Chat API routes authenticate with verifySessionCookie; there is no chat-specific session route.

AI assistant (Creddit Agent) — held back, no UI ​

An in-app AI research assistant ("Creddit Agent") that answers questions over creddit's live data via a read-only tool layer, streamed with the Vercel AI SDK and Claude. Its release is deferred: every UI surface has been removed and no route, nav entry or dock renders it. The server side is intact so it can be picked up later — restoring the interface is a revert of the removal commit, not a rebuild.

  • What was removed. The /agent route and its AgentClient (history rail + full-density answer), the /chat legacy redirect, the always-mounted AgentDock (minimized bar + expanded sheet, Cmd-K), the NavAgentLauncher tile in the sidebar and mobile drawer, the AgentProvider / ChatEngine hoisted-thread machinery, and the ChatMessage answer renderer — the whole of src/components/chat/ — plus the CSS those surfaces owned and the client-only dependencies they pulled (@ai-sdk/react, react-markdown, remark-gfm).
  • What stayed. The API (POST /api/chat stream, GET /api/chat/conversations[/id] history), the whole src/lib/agent/ module set, the prompt sources in prompts/, the conversation/usage tables, and the retention cron. Nothing in the app links to any of it.
  • Keeping it dark in a deployment. POST /api/chat gates on CHAT_ENABLED (and a present ANTHROPIC_API_KEY): with the flag unset it answers 503 before any model call. The two GET /api/chat/conversations* routes do not read the flag; they are session-gated (401 signed out) and only ever return the caller's own stored history, so they spend nothing. Leave the flag unset wherever the assistant is not meant to be reachable — with the UI gone it is the only thing standing between a hand-rolled POST and real token spend.
  • Agent module map (src/lib/agent/): session.ts (chat config only: enablement, model gating, daily token budgets; the SIWE + session-cookie machinery is the neutral src/lib/auth/session.ts), budget.ts (per-user + global daily token caps), carry-catalog.ts (assembles the same registry -> getCarryRow -> stats the /carries page does), tools.ts (the read-only tool set, a factory over the signed-in address), system-prompt.ts (assembles the cached prompt from three editable markdown sources: prompts/assistant-rules.md persona + house rules, prompts/assistant-metrics.md methodology KB (a condensed derivative of docs/metrics.md), prompts/assistant-tools.md tool guidance; regenerate the full readable snapshot with node --import tsx scripts/dump-assistant-context.ts -> prompts/assistant-context.md), persistence.ts (conversations/messages), profile.ts (stage-2 intake), wallet-positions.ts (live Aave v3 read for the signed-in wallet).
  • Tools wrap existing readers (carries-table, vault-capacity, vault-risk, oracles, basis, money-market-rates, curator-funds, assets-table, sofr, leveraged-position) so the assistant's numbers can never disagree with the pages. Every tool is strictly read-only; the only write is a user's own profile.
  • Grounding: the system prompt requires every number to come from a tool result, cited with its metric + as-of; the model never states a figure from memory. Not financial advice; no transaction construction or execution.
  • Data model + env + ops: see database and deployment §6.

App identity ​

The app uses the steel palette on its existing black surfaces: steel control fills with white text, soft teal for active indicators and carry headline yields, lighter steel for links, classic green for gains, and red for losses. Warnings use steel; independent chart-series colors include SparkLend amber. The repo-lending chart keeps each market distinct across filter combinations.

The supplied curved mark and lowercase Archivo wordmark appear on the landing, sidebar, mobile navigation, app icons, and social previews. The app's charts carry the same mark and wordmark as a faint watermark centred behind their plot (smaller on the compact borrow-capacity projection): the screener charts, the asset profile's Performance and Basis charts, and the Trade analytics charts. The Portfolio chart card, the signed-out Portfolio landing's sample chart, the PnL simulator's chart and the Funding shock curve carry none. Navigation logos return to the landing; Launch app opens Portfolio. The wordmark cursor stops blinking when reduced motion is enabled. The documentation site's branding is maintained separately.

Favicons and the link preview are static files in public/, linked from the root layout's metadata: favicon.svg (transparent curve mark), favicon-32.png (fallback for browsers without SVG favicons), favicon-180.png (Apple touch icon), favicon-512.png (the manifest's install icon and the JSON-LD logo) and og-image.png, one 1200×630 card for every URL with no per-page variants. The site title is "creddit · navigate onchain fixed income" and the description "One terminal to navigate onchain fixed income." (both in src/lib/seo.ts). /og-image.png is served with a long Cache-Control, and /favicon.ico redirects (temporarily) to /favicon-32.png for clients that ignore the icon links.

Private documentation. creddit.xyz