Skip to content

built-with-deviations Built, with deviations. This is a decision record, not documentation; the body is annotated where the build diverged.

What is still current: The signed-in /portfolio page is the v3 terminal design built to the rulings below, and the previous dashboard and its activity feed are deleted. Deviations: (1) a PT pledged on Aave or SparkLend from before tracking began opens its starting lot at its first reading that carries the reserve index, so its accrual line and statement are stated for such a holding too, further than R4's pledged case planned; (2) Manage on Pendle lands on Pendle's markets list, because the holdings wire names the PT and not its market; (3) a directly held PT whose statement is not served does not expand at all (no chevron) rather than opening onto No coverage; (4) multi-strategy funds read as plain wallet balances (Lido Earn, ether.fi Liquid, Treehouse) have no Manage button, because the app has no verified URL for them; (5) the basis table's At entry prices are dashes, because the wire carries no entry prices, and the entry basis is the entered gap over today's redemption value; (6) a note about getting out that is not a settlement stays a muted line outside the lifecycle tags: 'Redemption credential-gated' under a Variable rate asset's name, and a Fluid vault's 'Wound down', 'Below floor' or 'Blocked' under the platform name on a carry, cross-currency or smart repo lending row; (7) the Utilization, Exit liquidity, Redeemable and cross-currency Value column headers carry info tips the spec does not draw; (8) no Balance cell carries a dollar line: in the All view the Value column beside it already states the dollars, so the line under a balance would restate them (R2's balance case is unused); (9) section 2.1's reuse of HeroFigure.tsx and deletion of signed-in-theme.ts went the other way: HeroFigure.tsx reached no page and is deleted, signed-in-theme.ts stays because the building state's chart and the platform marks still read it.

Landed: PR #1153 (pending release)

Header updated 2026-10-15. The body below is frozen history. All plans.

Portfolio page redesign v3 — decision record and build plan ​

The redesign of the signed-in /portfolio page follows the design handoff "Portfolio Redesign v3" (a README, one HTML page and one reference module per position category, with screenshots; the bundle is a design reference with hard-coded sample data and is not committed). Its page shell, panels, table grammar, column tracks, tokens, typography and states are final; the latitude is adapting to the data creddit actually has.

Every ruling below was settled with Fred on 2026-10-15 after the spec was read against the app's logic and data. They are not open questions. Where the spec and this record disagree, this record wins; where neither says anything, docs/portfolio.md (the current behaviour) wins, restyled.

1. Rulings ​

R1. Views, categories and order ​

  • Carry trades render in All and in the currency view of their book (a wstETH/ETH loop is an ETH-book carry). Cross-currency borrowing renders in All only, as today: no currency can state its return. The spec's "both hidden in the ETH view" does not apply.
  • Category order: Idle assets first, always. Then every other category by the dollar value held in it, largest first, in every view (an ETH category sorts by the dollar value of its ETH total). Not covered last: its values are withheld, nothing to sort by. Rows inside a category stay sorted by value, largest first.
  • Default view is All; the last choice is remembered per account in localStorage (spec key creddit-pf-view, scoped per account like the other portfolio keys).
  • The Positions count on the Net asset value card keeps today's rule: idle balances are holdings, not positions. The Idle assets group header therefore counts "N holdings"; every other group header counts "N positions".

R2. Units and the dollar line ​

  • All view: each row prints its native unit (ETH rows in ETH), with the server's reading-struck dollar figure (PositionRow.valueUsd) beneath values and balances. Group totals and the Net asset value figure are in dollars, summed from those served figures, so the dollar lines foot to the subtotal exactly, live and on a past day.
  • ETH view: ETH primary with a dollar line beneath values, at the current price served by GET /api/portfolio/prices (the hero's own rule), withheld when there is no price.
  • Returns never get a dollar line: Lifetime accruals, Lifetime PnL, MTM, dislocation. Restating a months-long ETH return at today's price is the blend M22 forbids. The hero's existing dollar restatement of MTM PnL, with its "at today's price" tooltip, stays.

R3. Lifetime PnL and Lifetime accruals ​

  • Lifetime accruals (every band that has the column) is the accrual attribution, yieldRedemption, exactly today's "Yield earned".
  • Carry trades, Lifetime PnL = net accruals of the legs plus dislocation PnL where it applies. Dislocation applies to a leg whose asset is market-priced with a redemption value (sUSDe, wstETH, PST and the like). It never applies to: a smart collateral or smart debt side, a redemption-priced asset (its two marks agree by construction), or a stablecoin (instrument kind stablecoin; its wobble around par is ignored). A PT pledged inside the carry contributes its mark-to-market, which is the same arithmetic (a PT enters at zero basis, so its current gap is its MTM since entry).
  • Fixed rate assets, Lifetime PnL = accrued to date plus mark-to-market, which is the served PT statement's total (PtDetail.total); a dash with "Not measurable" where it is null.
  • Which rule a leg falls under needs the leg's pricing category and instrument kind on the wire (§2.2).

R4. Fixed rate scenarios (Hold to maturity / Exit now) ​

  • The prototype subtracts an "Entry execution cost" from totals that are already net of what the lots cost. That double counts. Hold to maturity total = redemption at par minus what the open lots cost (PtDetail.profitToMaturity). Exit now total = accrued to date plus mark-to-market minus the live exit cost (carry + markToMarket − cost from /api/portfolio/pt-exit-cost). Rows: Hold shows Accruals (projected to maturity) and Mark-to-market PnL $0.00; Exit shows Accruals, Mark-to-market PnL, Exit execution cost.
  • No "Entry execution cost" row and no "your price vs the market then" split. The Locked-in rate carries a tooltip saying the rate is net of entry execution: price impact and Pendle's own swap fee are in the price paid, and so is the conversion when the purchase was paid in another token; gas is not.
  • KPI strip: Locked-in rate · Accrued to date (carry) · Rate now (marketApy, "Matured" after maturity) · Mark-to-market PnL (markToMarket). Comparison line under the cards: hold total minus exit total. Payout box names the payout asset and the delivery token where it differs (ptRedemption). Rows expand only when ptDetail is served; otherwise the expansion shows No coverage · Contact support.
  • Days to maturity come from the served daysToMaturity (the reading's), never the browser clock, so a past day reads right.

R5. Cross-currency borrowing expansion ​

  • Columns per leg: Leg · Asset · Qty · 24h APY (the leg's own venue rate, in its own currency) · Lifetime accruals (the leg's own accrual in its own currency, which the engine already books and the API already serves for every based leg) · Price PnL since entry (dollars) · Value (own unit, dollars beneath). Smart sides use the carry tree treatment with share rings.
  • Price PnL since entry is served for legs of Fluid vault positions and Morpho isolated markets only, and only for a leg with a single base (a plain token leg, or a smart side whose two tokens share a base, wstETH/ETH). A smart side spanning two bases (ETH/USDC) gets no price PnL and keeps its accrual dash. Aave and SparkLend legs get a dash (pooled accounts; a later change).
  • Definition (new metric, written into docs/metrics.md): the move of the leg's unit currency against the dollar applied to the leg's unit value since entry, with average-entry accounting (an increase raises the quantity at that movement's price, a decrease reduces the quantity at the running average), each movement valued at the price bar of its own block, a holding older than the wallet's history anchored at its opening reading and flagged "since tracking started". It is never the token's own dollar price: wstETH's dollar price also rises with the staking growth the accrual column counts, so using it would count that growth twice. For a leg with no currency book (cbBTC) the unit is the token and the accrual is nothing, so the price line is the whole story. A USD-book leg's price PnL is nil by construction.
  • Net value row: equity in dollars, total price PnL in dollars, accruals per currency side by side (never summed across currencies).
  • Aave and SparkLend cross-currency entries keep a read-only Account risk strip (leverage, LTV, distance to liquidation, health factor, track with the Liq marker; no slider, no Max marker), because the entry is the whole account. Isolated venues show the same strip from their own params. No risk data → the dashed "not available" notice.

R6. Leverage section on carry trades ​

  • Simulator on Morpho and Fluid (isolated positions). Math as the spec: selected LTV and net APY from the leverage delta; borrow cap marker at 1/(1−maxLtv), hatched rail beyond it; liquidation at 1/(1−LLTV); step 0.01; Reset. The handle's ceiling is min(cap, liquidation) extended to the current leverage when the position already sits past the cap, so the handle can always rest on the truth. Fluid's tick-padded LTV (tickDebtMultiple) stays the LTV figure, as today.
  • Aave and SparkLend: read-only strip (Account leverage · LTV · Net APY) and a static track with the current dot and the Liq marker only.
  • Euler is covered as funds, not borrow markets: no simulator case exists for it.
  • Actions: Check oracle → the carry's row on /carries (its oracle card); Manage on <platform> → the venue's app (§2.4).

R7. Basis sections ​

  • Collateral basis to redemption on carries whose collateral is market-priced with a redemption value (not PT, not smart): At entry / Current rows (collateral price in the debt asset, redemption, basis %), Dislocation PnL with bp change, ~ and "since first observation" flags carried from basisEntered*, Get live executable basis button opening the dialog (§R8).
  • Market basis to redemption on Variable rate assets: only for market-priced assets with a redemption value (pricing category on the wire, §2.2); the row expands only then. Actions: View asset profile (profileHref), Redeem on <issuer> (§2.4).

R8. Live executable basis dialog ​

  • As the spec: Pay / flip / Receive / Get quote, result block with executable price, basis vs redemption in bp and a sentence comparing it to the market basis. Backed by POST /api/carry-basis-quote (carries) and POST /api/asset-basis-quote (variable rate assets), which take the amount and the side; the pair is the server's. A PT-collateral carry has no quotable collateral, so the basis section is omitted there anyway.

R9. Lifecycle tags (under the asset name, Variable rate rows) ​

From PositionRow.settlement (served today, never rendered until now):

  • Waiting: "Redemption requested · ~Nd to claim" (estimate) or the exact time; no time statable → "Redemption requested" alone. A request the issuer pays without a claim: "Redemption requested · paid automatically". A paused queue: "Redemption requested · paused by issuer".
  • Ready and the holder must act: "Claimable", teal with the pulsing dot; a deadline under a week: "Claimable · N days left". The Claimable tooltip names the early-claim fee and the free date where one applies (Apyx).
  • PTs: the Matured badge and the Redeem link (matured only). Nothing else.

R10. Not covered ​

Only two shapes ever reach it: a borrowing with no priceable collateral behind it ("Debt without matched collateral") and a pledged PT whose payout asset is not tracked ("Payout asset not tracked"). Rows keep the served reasonLabel as the coverage line above Contact support; a debt prints negative in red. Uncovered protocols and chains never appear anywhere in creddit, so the prototype's Uniswap, Solana and Arbitrum rows have no equivalent. Excluded from the total and the chart as today, with the captions.

R11. Activity ​

  • Economic action names, product vocabulary. The line names what the reader did, with the venue (brand + name) beneath. Vocabulary (final; the classifier's rule table generates both the TypeScript and the SQL facets, so the pill and the rows agree): Deposited into <venue or fund name, with "money market fund" / "multi-strategy fund" / "smart lending" / "lending" where the role is known> · Withdrew from … · Borrowed on <venue> · Repaid on <venue> · Opened carry trade · <collateral> / <debt> when the legs share a currency, Opened cross-currency borrow · <collateral> / <debt> when they do not · Closed carry trade · Swapped <A> for <B> · Bought PT-<x> <maturity> / Sold PT-<x><maturity> (a swap whose incoming or outgoing asset is a PT) · Wrapped ETH / Unwrapped WETH · Transferred out to <0x…> / Received transfer from <0x…> · Liquidated · <venue> · Received <token> rewards · the redemption family (Requested redemption of <asset>, Redemption paid, partly paid, cancelled, suspended, moved to collection, paid in an asset creddit does not track) · Moved between your wallets · Moved through a wrapper · Balance adjustment (as today, with the folded summary line) · the matured-PT line (as today: no amount, no explorer link) · "Multiple movements" fallback keeps the plain composition.
  • No enrichment: no leverage at open, no fixed rate on a PT buy, no dollar figure under any movement. Token amounts only, signed, with coin and ticker.
  • Expansion: a transaction with two or more movements opens onto its sub-actions with verbs (Supplied, Borrowed, Swapped, Repaid, Received, Sent, Seized …); a single-movement line does not open. The spec's inline movement list is replaced by this.
  • Fees: the gas of any transaction the statement can name is never shown. A fee line remains only where the fee is the whole story, hidden behind the toggle with the FEE tag: a failed transaction ("Gas paid (failed transaction)"), an action at a contract creddit does not cover that moved nothing but ether ("Gas paid (action not covered by creddit)"), and an owner wallet paying gas for its Safe's transaction ("Gas fee paid", on the owner's statement). A fee paid in a token through a paymaster is treated exactly like gas.
  • Unsolicited = spam dust from look-alike addresses (counterpartyClass: "spam"), hidden behind the same toggle with the UNSOLICITED tag. The toggle names the hidden count. An airdrop of a tracked token still reads "Received transfer" (known gap, unchanged).
  • Kept: the Confirming tag, the keyset paging and the multi-wallet union frontier, the matured-PT lines, ?view=activity / ?position= + ?wallet= narrowing, the venue and action pills that only offer what the ledger holds. The feed is not scoped by the denomination view (a transaction is shown whole). The Wallet column shows only with more than one wallet selected. Rows: time + UTC, wallet, action + venue, movements, explorer link; month and day headers.

R12. Money market funds ​

No fund-level utilization exists. The column is Exit liquidity: the share of the fund withdrawable now, which the Money market funds screener already publishes, one decimal, served to the portfolio by one fetch keyed on the vault address (§2.2). Row: Platform · Fund (manager icon, fund name, manager beneath) · Exit liquidity · 24h APY · Lifetime accruals · Value. Expansion: View fund, Manage on <platform>.

R13. Repo lending, smart repo lending, multi-strategy funds, idle ​

As the spec, on the served data: collateral exposure stack from /api/repo-markets, utilization, the APY tooltip split (lending rate vs the token's own yield, §2.2), View market / Manage on actions; smart repo rows with both tokens, quantities and share rings from composition, 24h APY, Lifetime accruals, Value; multi-strategy rows with Fund (link where fundHref), Manager / issuer, Redeemable (fundRedemption), 24h APY, Lifetime accruals, Value; idle rows Asset · Balance · Value, no chevron. Smart legs' Position details show the trading-fee APY and the lending rate beside the total where the parts are served.

R14. Chart and NAV panel ​

  • Historical NAV (All): teal line, flat teal-tinted area, unsplit: a level, never coloured by sign. Historical PnL (USD, ETH): split at zero, green above, red below, dashed zero line, MTM PnL headline, Accrual only PnL dashed. End-value pill, hover crosshair, keyboard operation, live-tip marker, gap bridging, the as-of-date click with its banner and Back to Now: all kept.
  • Net asset value panel as the spec; allocation legend's "Other" becomes Cross-currency borrowing in its own colour; the captions for unpriced or not-covered positions stay.

R15. Kept from today, restyled ​

The settings popover behind the gear (minimum value floor, Sign out; the gear lit while a floor hides rows), the five-minute refresh cooldown and the served UPDATED stamp, the building state, the retained-yield panel, the empty states, the signed-out landing (untouched), like-for-like merging across wallets with the wallet picker, the min-value floor per view.

  • JetBrains Mono everywhere on the page (the landing and screeners already use it), Archivo only for the wordmark; the spec's palette and category colours; no help cursor; no em-dashes in copy; copy explains economic relevance, never implementation.
  • New small registries: Manage on links (Aave, SparkLend, Morpho market page by id, Fluid vault page, Pendle market page), Redeem on links per queued issuer, Check oracle to the carry's /carries row; N/A chips and Contact support go to the Telegram group (SUPPORT_URL).

2. Build plan ​

2.1 Architecture ​

  • New component tree src/components/portfolio/v3/: Dashboard.tsx (root), NavPanel, ChartPanel (wrapping TerminalChart), HoldingsPanel (tabs, category order, blocks), primitives/ (panel, segmented control, table grammar with tracks A and B, expansion panel and section band, buttons, chips and lifecycle tags, coin and platform icon wrappers over the existing registries, tooltip, share ring), categories/ (one block per category, the expansion sections), activity/, links.ts, tokens.ts, format.ts, model.ts (pure v3 view-model extensions over signed-in-model.ts, unit-tested).
  • Reused as is: signed-in-model.ts (grouping, carry merge, All holdings and total, aggregation, risk math, formatters), useSignedInPortfolio.ts, portfolio-cache.ts, TerminalChart and terminal-chart-model.ts, HeroFigure, v2/activity.ts (the shared activity model), platform-brand.tsx, the icon registries.
  • Deleted at integration: PortfolioDashboard.tsx, ActivityFeed.tsx, RebuiltActivityLine.tsx, signed-in-theme.ts, their tests, and every browser spec that asserts the old DOM; replaced by the v3 tests and specs.

2.2 Wire additions (all optional, additive; src/lib/portfolio/api-types.ts) ​

  • PositionRow.quotedApyParts: the components of quotedApy where it is a composition (venue rate, the asset's own yield, the DEX trading-fee APY on a smart side).
  • PositionRow.pricing: the asset's pricing category (market / redemption) and instrument kind, from the token registry.
  • PositionRow.ptDetail served for a PT pledged as collateral too (Aave, SparkLend, Morpho), not only a bare Pendle leg.
  • PositionRow.priceSinceEntry: the cross-currency leg's average entry, current price and price PnL in dollars (R5), with the sinceTracking and incomplete flags.
  • RepoMarketsResponse.funds: per-vault exit liquidity share for money market funds (R12).
  • Activity: the vocabulary and rules of R11 in v2/activity-actions.ts / v2/activity.ts, fee suppression on the read, the open_cross_currency_borrow action.

2.3 Tests and docs ​

  • Unit tests for every pure module added or changed; the v3 view-model pinned like signed-in-model.test.ts is.
  • Browser specs under tests/e2e/ for the new page, run by their authors at --project=desktop-1360 against the fixture (scripts/fixture/build.sh), seen failing with the change reverted and passing with it; portfolio-column-alignment re-pinned on the new tracks.
  • docs/portfolio.md "What the user sees" and "Activity" rewritten for the v3 page in the same PR; docs/metrics.md gains the price-PnL-since-entry definition; this file's header moves to built (or built-with-deviations) when the PR merges; docs/plans/index.md regenerated.

2.4 Shipping ​

Feature branch feat/portfolio-v3 → draft PR into staging → check green on every push → independent review by a separate agent, fix, re-review until no blockers → ready for review (CI zoom sweep on the page) → Fred validates on staging.creddit.xyz → release PR.

3. Out of scope (follow-ups, if ever) ​

Dollar figures under activity movements; leverage and fixed-rate enrichments on activity lines; price PnL since entry on Aave and SparkLend cross-currency accounts; an airdrop class on the activity feed.

Private documentation. creddit.xyz