Listed from the MCP registry; nobody on Odel publishes it.
Is this yours? Claim itChecked trade plans, baskets and loan health for Coinbase tokenized stocks on Base. You sign.
One address for any MCP client. No sign-in needed on this server.
4 read3 other
Grouped by tool name. At most: moves money, runs code or commands, deletes data, or sends messages for you.
Odel charges nothing per call. The publisher may charge for its own service.
Live at afterbook.app.
Cash close vs the Aero book, in shares, for the Coinbase tokenized stocks on Base. The tape, Lot Lab and My Lots are read-only — no wallet ever signs anything there. Three places ask your wallet to sign; Afterbook holds no funds or keys in any of them (for Baskets, Glider's agent holds a permission on the account, see below): Portfolio's Revoke (it only ever sets a leftover router approval to zero, see Approvals), Buy / Sell in the Execute panel (an in-app swap from your own wallet through KyberSwap's router, see "In-app swaps" below) and Baskets (/baskets), run on Glider, where you sign an enrollment (new enrollments paused since 2026-11-19) and withdrawals and send USDC from your own wallet. See "Baskets (Basis Tilt)" below.
Pages: / and /[symbol] (the tape for a stock), /today ("Today's gap"), /borrow, /build (basket builder), /baskets, /baskets/risks.
Tape: cash-market last price vs Aerodrome's on-chain mid price for the 39 Coinbase tokenized stocks Afterbook tracks (NVDAc, AAPLc, METAc, GOOGLc, AMZNc, MSFTc, MSTRc, SNDKc, SPCXc, TSLAc, PLTRc and MUc, plus the 26 Base announced as live on 2026-10-27: NFLXc, SKHYc, HIMSc, ORCLc, AMDc, AVGOc, LLYc, MRVLc and 18 non-US companies' ADRs such as SONYc, SAPc and NVOc, and ANTc, Anthropic, added 2026-11-20, the day after its Nasdaq IPO), basis in bp, plus real pool depth. Each stock is read from its deepest USDC pool: Aero's (Aerodrome's successor) for 21 of them, the older Aerodrome factory for the 18 seeded on 2026-10-27 (see "Contract addresses"). Each row is a card with the token's icon, a 24h change and a past-N-days chart (see "UI architecture"). During pre-market and after-hours, "cash" is the live extended-hours print, not the frozen 4pm close (Yahoo's preMarketPrice/postMarketPrice meta fields when present; since about October 2026 Yahoo stopped sending them, so the tape reads today's one-minute bars with includePrePost=true during those hours and takes the newest trade after the close from the last 4 hours, lastBarAfter in lib/market/tape.ts; on 2026-10-28 that turned GOOGLc's −1,025 bp "gap" against the 4pm close into +23 bp against its $290 after-hours trade) — comparing on-chain against a stale close would misreport a real overnight tradfi move as basis. Overnight and at weekends (cash fully closed) the hero's gap number and sentence (and /today) are anchored to the regular-session close; in pre-market and after-hours both use the row's live extended-hours trade when it has one (todayReference in lib/market/todaySnapshot.ts, the same rule as heroGapBp), so the home page, /today, its card and its share text never disagree about the same instant. In pre-market/after-hours the hero labels the cash price by the row's real cashPriceType: only when Yahoo has an extended-hours print does it say "cash pre-market/after-hours price"; with no print the cash price is still the last close, so it says "Friday's close" and the card says "Cash close". The tape's cash column header and the note under "Tape" follow the same rule, computed from all rows: no row on a print → "Cash close" and "No pre-market trades yet, so the basis is measured against the last regular-session close"; every row on a print → "Cash pre-market/after-hours"; a mix → "Cash (latest)" and a note saying it is a live print where there is one and the last close otherwise. Link-preview, share-card and footer copy use plain language, not the "Aero book" jargon. A symbol reporting earnings within 5 days gets a small "Earnings in Nd" flag in the tape and a caveat in Lot Lab — a widened spread near earnings is expected, not a sign the tape's basis math is broken. A line under the Tape heading says how fresh the numbers are (TapeFreshness in app/components/markets/Tape.tsx, with the tape table, phone cards and sort helpers; moved out of HomeClient.tsx on 2026-10-29): "Live · updated 15s ago · refreshes every 20s", or, in amber, "Delayed · last updated 3 min ago" when the tape is over 90 s old, the server is serving last known values (error), or this page's last refresh failed; it also names the stocks whose cash price is a carried-forward last good value (cashStale, the STALE tag). Only the Live/Delayed word is a live region. The column headers are sort buttons (keyboard and screen readers: aria-sort, "Sort by Gap, now highest first"), rows can be picked with Enter, and "What the columns mean" opens a short legend (Gap, Onchain price, Pool liquidity, 24h, Trend). On phones each card shows the gap, cash → onchain price and pool liquidity; its Details button opens the 24h move, shares in the pool and the 30-day line with its change in words (sparkSummary, also every small chart's label). Earnings warnings stay on the card.
Liquid vs thin split: pools with real depth (≥ $1M; at the time of writing NVDAc/AAPLc/METAc/GOOGLc/AMZNc/MSTRc/SNDKc/SPCXc — MSFTc, TSLAc, PLTRc and MUc are thin) lead the tape and hero grid; everything thinner collapses behind a "Show N thin books" toggle at reduced size. A $10k pool's basis swings hundreds of bp on noise alone — giving it the same visual weight as a $2M pool made the tape read as broken. $100k used to be the bar, but depthUsd is a pool's total real token balance, not liquidity active near the current tick — a pool can clear $100k on stale/off-range positions while still swinging hundreds of bp (MSTRc did, at ~$965k depth and +257bp), so the bar moved to where the pools actually separate into a calm tier and a still-noisy one. The split is driven by live depth, not a hardcoded symbol list, so a thin pool graduates automatically once it actually has liquidity. Landing directly on a thin symbol (URL or dropdown) gets a small "thin book · $Xk depth" chip under the sticky bar, since the hero/tape's own thin-tier demotion is otherwise the only clue.
Every tokenized stock (/stocks): all of Coinbase's tokenized stocks (173 on 2026-10-18) as a table, searchable, filterable, sortable (24h volume, value on Base, 24h move, memes) and paged 25 at a time. Each row has price on Base, 24h move and 24h volume from the token's deepest pool on any Base exchange, "On Base" (that price × tokens in circulation on Base, not the company's market cap; Dexscreener's batch token endpoint, cached 5 minutes), the verified memes priced in it (logos and a count, linking to /memes?stock=…), its icon, contract (BaseScan link) and Aerodrome USDC pool status: Tracked (the STOCKS list, linking to its page, with the tape's live depth), Small pool (an Aerodrome USDC pool too shallow to track, with its depth, the three-hour low for any pool over $250k; 46 on 2026-10-18. LLYc reads up to ~$250k, but about $200k of that is a bot's liquidity that comes and goes; its three-hour low was $29k on 2026-10-20), No pool yet, or Not checked yet (listed by Coinbase after the last daily check). Untracked tokens get no gap, no alerts and no swaps: in a pool that small one trade moves the price, so the gap is noise. The pool column comes from the daily discover-tokens job, which already measures every untracked token and saves one snapshot (directory:pools, saveDirectoryPools in lib/stocks/stockDirectory.ts); the page reads it through Next's data cache (an hour) and Coinbase's list (cached an hour), so a page view costs no chain reads for untracked tokens and at most one Redis request an hour. Listed in the sitemap; in the header nav (desktop) and the phone menu.
Memestocks (/memes, /memes/<address>): Base meme tokens whose pool is quoted in one of the tracked stock tokens (BLUECHIP/NVDAc, IPOD/AAPLc…), each with its 1h/6h/24h move next to its stock's, price, 24h volume, liquidity, the stock held in the pool, market cap and pool age. A not-dismissable warning sits above the numbers ("Any memecoin can go to zero; the stock token in the pool does not make the meme safer"), the list is sorted by volume or by move, never by our pick, and pools under $10k of liquidity sit under "thin". The list is its own allowlist (memes:pools in Redis, lib/memes/memestocks.ts), written by the daily discover-memes job; it never touches STOCKS or BASKET_SYMBOLS. The job reads Dexscreener's pairs for every tracked stock, drops majors, staked ETH (rETH, wstETH, cbETH, weETH), AAVE, AERO and stablecoins (by address, and any symbol containing USD/EUR) and other Coinbase stock tokens, and lists a pool only if it is proven on the chain: Aerodrome Slipstream and Uniswap v3 through their factories' getPool; Uniswap v4 (most of this market, 2026-10-18) through PositionManager's poolKeys hashing to the pool id ("proven"), or, for pools created outside PositionManager (launchpads), the pool existing in StateView with liquidity and a price within 3% of the pair ("price-matched"; public RPCs refuse the old logs that would prove the key). A meme must also have a KyberSwap route back to USDC (a basic can-it-be-sold check). Memes are identified by contract address: several tokens share names (three "GPU"s on 2026-10-18). Live numbers come from Dexscreener (cached 2 minutes) and the allowlist through Next's data cache (an hour), so a view costs no chain reads. Each meme page has its own share card (/card?page=meme&addr=…). Meme logos are Dexscreener's (info.imageUrl, only https on cdn.dexscreener.com, the one meme image host in the CSP's img-src), requested at 128 px: that CDN serves only some sizes and answers 96 px with a 422. /memes?stock=NVDAc opens filtered to one stock. Prices are written out in full, never as "1.554e-7"; on a meme page a price under $0.001 shows its zeros as a count, "$0.0₆1554" (six zeros after the point), the way Dexscreener does, with the full number on hover.
Home page (Trade) (2026-11-03, from an external review; app/page.tsx, TradeHome.tsx): one heading and sentence ("Buy, borrow and earn with tokenized stocks on Base 24/7"), the US market's state, the five stocks with the biggest pools (Base price, the real stock's price, the gap as a percent, a Buy button that fills the card) and one action card with three tabs. Swap is the in-app swap below, behind the eligibility checkbox (ticked for every trade). Borrow links to the in-app Aave loan on /borrow#borrow-here (see Borrow; Afterbook sends Aave's own calls for the wallet to sign and never holds the loan) and to Morpho's site; Lend quotes the lenders' current rate (Aave's reads, cached a minute and dropped after 1.5 s) and links to the in-app USDC deposit on /borrow#lend-here (see Borrow) and to Aave's site; Borrow's "Open on Morpho ↗" is a link under its note, so each tab has two buttons. Under the stocks, Plan before you buy (2026-11-17, for the Stocks Maxxing quest: most visitors landed here and never found these) links to the trade plan (/plan), Describe a basket (/plan#basket, which opens that tab) and stock rules (/rules), one sentence each. Two columns on desktop with the card sticky beside the list, one column at 900px and narrower. The navigation is five tabs (Trade, Markets, Borrow, Portfolio, More): in the header on desktop, in a bar fixed to the bottom of the screen at 900px and narrower. Markets (/markets) is the tape page described below, which was the home page until then; Portfolio (/portfolio) holds the wallet's positions (My Lots, headed "Your positions" there); More (/more) lists baskets, the basket builder, memestocks, Telegram, the README and the API.
Hero card + compact bar: the first thing on the tape page (/markets). It opens on the day's biggest liquid gap (the same pick /today uses, chosen on the server in app/markets/page.tsx; /NVDAc etc. still open on that stock). It holds the stock chooser, the market-session pill, the big gap number with one plain sentence ("On Base, Strategy (MSTR) is trading 2.7% (268.2 bp) above Friday's close. Cash reopens Mon 9:30 AM ET.": where the onchain price is leads, so "on Base" never reads as where the cash price is; the sentence says Base, not the exchange (owner, 2026-11-08); percent first, because strangers read it faster, bp in brackets; under 5 bp only the bp is shown, since the percent would round to 0.00% and look like a mistake: gapSizeText in lib/format.ts, also used for the share text), cash and Aero price cards, a primary "Size a SYMBOL trade" button (scrolls to Lot Lab, where the eligibility check lives; it never opens Aerodrome directly), a Telegram alerts link (to t.me/afterbook_bot; the bot's display name is "AfterbookAlertsBot", which is not its username), and a one-time note defining Aero and "100 bp = 1%". While cash is closed the number is anchored to the actual close (same as /today), not a live extended-hours print. A compact bar with the same number sticks to the top once the hero scrolls away. A visible <h1> sits above it (2026-10-28). /today and the share cards lead with the same percent-plus-bp figure and the same sentence (2026-10-29); the cards write prices as "Cash $1,323.55 Aero $1,325.65".
No tile grid: an earlier version repeated every liquid stock as a clickable tile under the hero (the same numbers as the ticker and the table). It was removed; the tape rows below are the way to switch stock, and clicking one still jumps to Lot Lab.
Basis since close: a sparkline of the selected symbol's basis from the last cash close to now, sampled into Redis every 5 minutes by the alerts cron (recordTapeSamples in lib/market/tape.ts, one write per stock per tick however many serverless instances are warm; until 2026-10-18 each instance sampled off its own traffic, which helped use up the Upstash plan's monthly request cap), and it works with zero setup (just renders empty) if no Redis store is configured. Recorded for every tracked stock regardless of the liquid/thin split above — it briefly reused that same $1M gate and silently stopped recording six symbols' history until that got decoupled; a thin pool's basis history is at least as useful to someone deciding whether to trade it. The same 30-day retained history also powers two one-line stats underneath, once there's enough sampled history: mean/max basis while the cash market was closed, and an open-snap convergence stat (getOpenSnapStats, lib/market/history.ts) — for each trading day, compares the last sample before that day's 9:30am NY open against samples ~30/90 min after, and reports how often |basis| shrank rather than widened ("basis moved toward $0 within 30 min in X% of the last N sessions"). Requires at least 8 valid trading days in the window before showing anything, same "collecting data" honesty as the sparkline itself rather than a percentage computed off too few days.
NY session clock: cash-open / pre-market / after-hours / weekend / holiday state, so the 24/7-onchain-vs-24/5-cash gap is explicit, not implied.
Plain labels (owner, 2026-10-19): the price on Aerodrome is the "Onchain price" everywhere a person reads it (hero, tape column, /today, /build, cards), the hero's big number is "Onchain price vs cash price", and its Onchain price card is the stronger of the two (firmer edge, heavier number, "Pool liquidity" under it) because it is the price you can trade at. /borrow keeps "Aero exit" / "Aero vs oracle", which that page defines.
First screen for newcomers (2026-10-28, from an external review): a visible heading ("Stock prices on Base 24/7 next to the real market") and one plain sentence above the hero; the gap as a percent with bp beside it; a visible three-step strip (see the gap, check the pool, trade from your wallet); the "since close" chart panel hidden until it has data; the tape listing every pool of at least $250k with smaller ones behind "Show N smaller pools"; and a plain line in the trade panel when trading is off for a US or unknown region. "What the words mean" (bottom of the Tape hero, closed by default, nothing remembered between visits; "New here?" until 2026-10-28): five short definitions (tokenized stocks, with the stock on screen as the example; cash price; onchain price; the gap in bp; when a wallet is needed) and the US line. It shares its look with the tape's "What the columns mean" (.explain / .tape-legend).
Trade calculator (called Lot Lab in the code, lotLabTab; shown as "Trade calculator" since 2026-10-19): type a USDC amount (or pick a size preset — $250 / $1k / $5k / 1% of the pool), see shares out, execution price, and a price-impact curve across a log-spaced range of trade sizes ($500–$1M) — computed from the pool's live slot0()/liquidity(), not a cached reserve snapshot. The panel is split into Trade / LP / Carry tabs (Trade is the default) rather than stacking trade sizing, the depth chart, and the carry math into one long card — keeps the primary execution flow front and center and makes the tool readable on mobile. While cash is closed and the basis spread exceeds 20bp, also shows a cash-and-carry edge calculator (lib/market/arb.ts) in its own Carry tab: gross basis, pool fee, price impact, and a flat gas estimate netted out, then annualized over the actual time remaining until the cash market reopens — the tab itself is hidden outside that window rather than shown with nothing worth acting on. Still buy-only in the sense that this app never shorts or borrows, but the Carry tab now has both directions: a buy basis side (on-chain priced below cash — the classic setup) and a short basis / inventory-unwind side (on-chain priced above cash — for someone who already holds spot shares and wants to sell into that premium now, then rebuy the same notional in cash pre-market once it reopens). computeCashAndCarryEdge (lib/market/arb.ts) takes a direction param that mirrors the sign; the toggle defaults to whichever side actually has an edge for the active symbol's current basis. A delta-neutral hedge note below the calculator explains pairing either side with a same-notional perp position to strip out the stock's own price risk — links to real, individually-verified venues (Hyperliquid, Avantis, Synthetix) for checking live funding, not a live integration this app computes itself (no third-party price/data API, on purpose — see "Why the math is done the way it is"). Also shows the same amount priced as a full-range LP position (≈50/50 by value — exact for full-range concentrated liquidity, with a caveat that Aerodrome defaults new deposits to a narrower range). Below that, a liquidity-depth chart (lib/market/depth.ts) reconstructs active liquidity across a ±25% price window from the pool's own tick-bitmap/ticks() data — no subgraph, no indexer. Slipstream's ticks() returns 10 fields, not upstream V3's 8; until 2026-10-12 it was decoded with the V3 layout, every read failed, and the chart showed the current tick's liquidity flat across the window. The fix was checked by summing the USDC the reconstruction puts below the price against each pool's real USDC balance (within ~2% for all twelve). The chart doubles as an interactive LP range selector: drag its two handles to size a candidate range and see, live, its capital efficiency (lib/lp/lpRange.ts — derived from the same virtual-reserve equations as the impact curve, not a recalled formula), an estimated fee APR for the range (the APR a full-range unstaked position earned, read from the pool's own feeGrowthGlobal counters, times that multiplier; rangeAprPct in lib/lp/lpRange.ts), the probability the range is still in range at the same 7-day horizon My Lots uses for real positions, and a divergence-loss-at-boundary figure (computeDivergenceLossAtBoundary, lib/lp/lpRange.ts) — the standard concentrated-liquidity impermanent-loss benchmark if price reaches exactly the low or high edge, verified against the classic Uniswap V2 IL formula in the full-range limit before trusting it. Dragging itself is gated behind an explicit "Adjust range" toggle, off by default — the range stays visible either way, but a finger landing on the chart on mobile scrolls the page instead of getting captured as a drag unless that toggle is on. Handles clamp to each other and to the current price, so a dragged range always brackets it — the underlying math assumes that. Below the range metrics, an auto-recenter note explains what re-centering an out-of-range position actually involves and links to Gelato Web3 Functions and Bankr for building that automation yourself — Afterbook doesn't run it, for the same reason it doesn't construct swap calldata (see "Why the math is done the way it is" above). A "Copy trade" button copies the sized trade as plain text. When a symbol has real earnings-move history (see below), Lot Lab also shows an earnings volatility spread: how many days of the stock's realized volatility the pool's own liquidity concentration (lib/lp/lpRange.ts's highest-density-region construction) would justify, compared to the actual days until the next report and the historical average size of this stock's post-earnings moves (lib/stocks/earningsHistory.ts). Not implied volatility in the options-market sense — there's no options market on these pools — a liquidity-concentration proxy translated into a comparable "days" unit via the same realized-vol model used elsewhere, not a fabricated number.
My Lots: a wallet chip, summary cards (total / spot / Aerodrome LP value) and one card per holding (spot as icon, USD value and share of holdings; LP with an in-range badge and range bar). Connect a wallet — a RainbowKit picker showing every installed browser-extension wallet (Rabby, Coinbase Wallet, etc., detected live via EIP-6963) plus a manual fallback, read-only — the connection only reveals your public address, nothing is ever signed — to see spot share balances and Aerodrome LP positions across the tracked stocks, priced live. Shows your Basename instead of the raw address when one's set, resolved directly against Base's own L2Resolver — no separate mainnet RPC, no extra dependency. LP position data comes from each CL factory's own NFT position manager (Aero's 0x4857…C60b; the older factory's 0xe1f8…8b53, not the publicly documented 0x8279… one, which is bound to a different factory), plus positions staked in each pool's gauge (stakedValues); amounts and uncollected fees are computed from the pool's ticks (lib/lp/lots.ts). Until 2026-10-27 this used Aerodrome's "Sugar" helper (positionsByFactory), which stopped returning live positions after the Aero upgrade, and Aero has none. Positions in the 12 original stocks' old pools (before the Aero move) still show, marked as in the older pool. Each LP position also shows its price range with in-range/out-of-range status, and uncollected fees (emissions and lock expiry were Sugar fields and are no longer read). The range is now also a visual bar marking where the current price sits, plus two estimates: fee APR for the position's own range while it is in range (from daily on-chain snapshots of the pool's own feeGrowthGlobal0X128/feeGrowthGlobal1X128 counters, which are fees per unit of unstaked in-range liquidity, already net of Slipstream's 10% unstakedFee cut; turned into a full-range APR and multiplied by the range's capital efficiency, not a third-party volume API). Until 2026-10-12 this was "fees x one snapshot's active liquidity / pool value", which swung with whatever liquidity the snapshot caught, counted staked liquidity (up to 96% of a pool) that earns no fees, and then got multiplied by capital efficiency on top of already-concentrated LPs: Lot Lab showed 6,093% for an NVDAc range that earns about 12% and the odds the price is still in range 7 days out (from realized volatility of recently-sampled on-chain price, via a standard lognormal estimate). Both are on-chain-only by design — no third-party price/volume API. In-range odds still start as "collecting data" until enough samples exist, but fee APR no longer does: computeFeeAprWithFallback (lib/lp/feeApr.ts) falls back to summing real Swap-event volume over the last hour, found by block timestamp (blockAtOrBefore in lib/market/blocks.ts) and read in 2,000-block chunks, mainnet.base.org's eth_getLogs cap (until Base's Denim upgrade on 2026-11-05 it read a fixed ~1,900 blocks, an hour at 2 s blocks, which at 200 ms would have been 6 minutes; the estimate costs about 20 RPC calls, so each pool's is kept in memory for 5 minutes, a null for 1) and annualizing that window's fee per unit of liquidity (fee on each swap's input, less the unstaked cut, over the swap's liquidity), whenever there isn't yet enough feeGrowthGlobal snapshot history — verified end-to-end against real chain data for three live pools before trusting it. Labeled "prelim." in the UI so it doesn't read as the same-confidence real figure. My Lots also shows a gauge-vs-fee yield comparison (lib/lp/gaugeYield.ts): the AERO staking APR for the same range (rewardRate per unit of staked liquidity, on the same full-range-times-capital-efficiency basis as the fee APR) next to the unstaked fee APR above, so the panel says outright which currently earns more. Out-of-range positions say they earn neither. AERO's own USD price is read from a real on-chain Aerodrome pool (found via the CL factory's getPool, not hardcoded) — this app previously had no AERO price source at all and showed emissions as a raw token amount for exactly that reason; that gap's closed now. Staked liquidity's USD value can't use the same virtual-reserve math the impact curve does (that describes trade-impact behavior, not actual holdings, and overstates a concentrated position's real value) — instead it scales the pool's real, balance-based depth by the staked/total liquidity ratio, an approximation that assumes staked and unstaked positions are concentrated similarly on average. A position also gets flagged when the most recent epoch's veAERO voting incentives (bribes, from Aerodrome's RewardsSugar.epochsByAddress) outpaid real trading fees for that same pool/epoch — a signal that a pool's gauge APR may be governance-subsidized rather than earned from organic volume.
Approvals (/portfolio#approvals, RouterApprovals.tsx, 2026-11-03): what KyberSwap's router (the only contract Afterbook's swaps approve) may still spend from the connected wallet, read for USDC and every tracked stock token in one multicall and shown as an amount or "unlimited". Each row has Revoke, which asks the wallet for approve(router, 0) with the Builder Code (revokeRouter in useSwapWallet.ts). Afterbook's own approvals are exact and used up by the swap, so a row means a basket run stopped part way or the wallet approved the router elsewhere (KyberSwap's own site uses the same router); the basket panels' "still approved" notes link here. Approvals to other contracts are not listed.
Visitor counts (app/layout.tsx): Vercel Web Analytics (@vercel/analytics, the <Analytics /> tag, switched on in the Vercel project's Analytics tab). It is cookieless, stores no personal data and counts page views and visitors per page and referrer; it knows nothing about wallets. The script is served from the site's own /_vercel/insights/ path, so the CSP needed no change ('strict-dynamic' covers it), and it 404s under next start/next dev locally, which is expected: only the live site can confirm it. Outbound clicks are logged separately (lib/server/clicks.ts).
Deposit visibility (BasketPanel.tsx): the USDC held in the user's Basis Tilt smart account is read straight from the chain every 15 seconds (balanceOf on the deposit address), so a deposit is visible as soon as it confirms. If Glider's positions still say $0.00 the panel explains that the money is the user's, only they can withdraw it, and Withdraw stays off until Glider counts it; after a send it links the transaction on Basescan. Measured 2026-10-08: a 2 USDC deposit showed on-chain at once and Glider counted it in about an hour (not at the daily run, whose nextDueAt is shown by the API but is not what triggers the count).
Base Builder Code (ERC-8021, lib/wallet/builderCode.ts): bc_hebg61t4, registered at base.dev, is appended to the calldata of every transaction the app asks a wallet to send, so Base can attribute that activity to Afterbook (the dashboard is Settings → Project Settings → Builder Code; it tracks transactions, not website visitors). The app sends four kinds: the USDC deposit on the Baskets panel; the exact-amount approval and the swap in the Execute panel's Buy / Sell, a /build basket buy or sell and a meme buy ("In-app swaps"; all four go through useSwapWallet.ts); Portfolio's Revoke, an approval of zero (see Approvals); and the in-app Aave loan's approvals, multicall, repay and withdraw (see Borrow). Liquidity still happens on Aerodrome's own site and cannot carry the code. It is passed per call as dataSuffix (the swap, sent with sendTransaction, has it appended to its calldata with concat): a code set in createConfig is ignored by useWriteContract (wevm/wagmi #5248, open in 2026-10). Check any transaction by its calldata ending in 80218021802180218021802180218021.
Wallets (2026-11-03): Base Account (RainbowKit's base wallet: a passkey sign-in in a Coinbase window, no seed phrase) is first in the list everywhere. It was left out until then because its SDK pulls in a Solana package that isn't installed; serverExternalPackages in next.config.js already keeps the build out of that path. On a phone in a normal browser (no injected provider) the list is just Base Account and WalletConnect, whose entry opens WalletConnect's own "All Wallets" window (a search box over hundreds of wallets, with MetaMask, Rabby, Base, Trust, Rainbow, OKX and Zerion first: explorerRecommendedWalletIds in lib/wallet/wagmiConfig.ts); from 2026-10-05 until 2026-11-03 Connect opened that window directly on phones. The ids come from WalletConnect's registry: curl 'https://api.web3modal.org/getWallets?projectId=<id>&st=appkit&sv=html-core-1.7.8&page=1&entries=5&search=<name>&chains=eip155%3A8453', with curl, not Python urllib which gets a 403. In that window you pick a wallet, tap Open, and the wallet app opens, approves and returns. Desktop, and a phone inside a wallet app's own browser (injected provider present), get the full RainbowKit list; modalSize="compact" removes the "What is a Wallet?" panel on desktop (a small "New to Ethereum wallets? Learn More" footer remains). MetaMask is not in the RainbowKit list: its entry uses MetaMask's own SDK relay and did nothing when tapped on a phone, while MetaMask works through WalletConnect's list; on desktop it also clashes with Rabby (see below). The project id is public (inlined in the browser bundle, so env changes need a redeploy) and afterbook.app is on the Reown Cloud project's allowlist. The CSP (middleware.ts) allows blob: images (the wallet icons) and verify.walletconnect.org/.com frames; Google Fonts for that window stay blocked on purpose (system fonts are used).
Wallet connect mechanics: app/providers.tsx/lib/wallet/wagmiConfig.ts (wagmi + RainbowKit), with a second always-visible "Connect wallet" entry point in the header (app/components/layout/WalletConnectButton.tsx) alongside My Lots' own — both read the same global wagmi account state, so connecting or disconnecting from either stays in sync. Disconnect calls wallet_revokePermissions (MetaMask's real revoke) before clearing local state — clearing local state alone leaves the wallet extension still considering the site authorized, so the next Connect would silently reuse the same account with no way to switch. No metaMaskWallet entry, deliberately: RainbowKit's per-wallet detection is flag-based (window.ethereum.isMetaMask), not EIP-6963/rdns, and several alternative wallets (Rabby included) set that same compatibility flag for dapp-compat purposes — with both installed, whichever wallet currently holds window.ethereum answers to "MetaMask" regardless of which one is real, and confirmed in practice (Error: MetaMask extension not found, thrown from inside the click) rather than just connecting to the wrong wallet silently. rabbyWallet's own entry checks isRabby specifically, which only Rabby sets, so it doesn't have this ambiguity; the generic "Browser Wallet" entry remains the correct fallback for a real MetaMask-only setup with no other flag-setting wallet installed. WalletConnect/mobile-wallet options (and Trust/OKX/Zerion/Rainbow, whose desktop connectors fall back to WalletConnect when their own extension isn't installed) only appear when NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID (a free Reown Cloud project id) is set — without one, that connector eagerly opens a relay socket at page load and, observed directly, spins a Chrome renderer's CPU into a runaway climb rather than failing quietly, so it's left out entirely rather than shipped half-working. Every extension-based wallet (Coinbase Wallet, Rabby, plus any other EIP-6963-announced extension via the generic "Browser Wallet" entry) works with no env var at all. The base/"Base Account" wallet is first in the list since 2026-11-03 (see Wallets above for why it was left out before). It is RainbowKit's base wallet wrapped in lib/wallet/baseAccountWallet.ts (2026-11-19): wagmi 2's Base Account connector answered every page reload's reconnect with wallet_connect, which needs a Coinbase window, so each reload opened one (or, with the window blocked, showed "Afterbook wants to continue in Base Account → Try again") and dropped to "Connect wallet" until the person signed in again. The wrapper reconnects with eth_accounts from the SDK's saved session, which never opens a window, as wagmi 3's connector does; a real click on Base still goes through the original connector. Base Account is a smart wallet, which has two known gaps: its swaps reach the chain as a bundled transaction (to the EntryPoint, from a bundler), which the swap log reads inside the user operation since 2026-11-18 (it refused them before, so /api/swap/stats undercounted Base Account trades until then); and whether Glider accepts its passkey (ERC-1271) signatures for a basket enroll or withdrawal has not been tested. Whether Base credits the Builder Code inside a bundled call is also unconfirmed.
Execute: Buy / Sell the stock in-app from the connected wallet (SwapPanel.tsx, see "In-app swaps"), plus Aerodrome's own swap and add-liquidity UIs under "Or trade on Aerodrome's own site", all gated behind a non-US geo check and an eligibility checkbox. /today links to the biggest gap's Execute panel (/<SYMBOL>#execute). A one-line trade summary ("AMZNc · $2,500 · ~9.67 sh · pool 0xd03B…") sits above the eligibility checkbox, visible regardless of whether it's checked — a user shouldn't have to affirm a legal checkbox just to see what they'd be trading — with its own "Copy lot" button that copies the whole line as plain text (AMZNc $2500 ~9.67 0xd03Bc8..., full untruncated pool address) for pasting into a chat/ticket/agent prompt. Aerodrome's swap URL only accepts from/to/chain params — no amount (verified live: typing into the Sell field updates the page but never the URL, and an &amount= param is silently ignored) — so inside "Or trade on Aerodrome's own site" a "Copy $X" button copies just the bare numeric amount for Aerodrome's own amount field, and a 3-step checklist (copy → open → paste and sign) spells out the sequence. Those Aerodrome links are secondary buttons now; the panel's one primary action is the swap's Review / Buy. Below the token/pool addresses, a backing & issuer note shows the token's live totalSupply() (real, on-chain, confirmed via a direct contract read) next to the custodian claim (Alpaca Securities, ADGM-supervised, 1:1, per Coinbase's own published docs) — explicitly labeled as the issuer's stated claim, not something this app verified, since there's no on-chain reserve-attestation contract for B20 tokens the way there is for some wrapped assets (checked directly: owner()/paused() both revert on the token contract, so there's no standard admin/pause interface to read either).
Log: a session-local, timestamped feed of notable events (starting with "cash just closed" plus each liquid symbol's basis at that instant).
Telegram alerts: /alert STOCK BP (NVDA or NVDAc, any case) pings when a stock's |basis| crosses a threshold, then re-arms only once the gap is back to 80% of the level or lower (REARM_RATIO and nextBasisState in lib/alerts/alerts.ts; before 2026-10-08 it re-armed the instant the gap touched the line and a gap hovering near 50 bp sent about 14 messages in a day and a half, visible in a user's public screenshot), and a missing tape reading keeps the state so a data blip can't re-arm it; /close pings once with every liquid name's basis the moment the cash market closes.
/watch 0xADDRESS [HEALTH] watches a wallet's stock-backed USDC loans on Base, Aave V4's MAG7 spoke and every listed Morpho stock market (lib/lending/loanPositions.ts, on-chain reads; Morpho Blue 0xBBBB…EFFCb).
nextLoanState, LOAN_REARM_FACTOR in lib/lending/loanHealth.ts).MAX_LOAN_RULES_PER_CHAT); a second /watch replaces the first. More wallets and custom thresholds are the planned paid tier./loans shows the watched wallet's loans now (loansReplyText, 2026-11-25): each loan's health at the oracle and at Aero's price, against the person's own alert line. Near it (the lowest of the two under the line × 1.25, the weekend heads-up's rule), an Aave loan gets the warning's rescue links (rescueLinks: the planner's fall and target only, never an amount or a wallet; the panel fills Repay or Add from the wallet that connects, and the person checks and signs); a Morpho loan gets a pointer to Morpho's site; otherwise a calm "Nothing urgent" line and no links. Read-only. The weekend heads-up decides per loan the same way, through the same function (loanNearness, so the two can't drift; 2026-11-25): the Aave links only when the Aave loan itself is near, a sentence for a near Morpho loan; a loan with no debt reads "no debt", never "Infinity". Tests: tests/rescueLink.test.ts./plan STOCK [STOCK…] USD (2026-11-22, lib/alerts/telegramPlan.ts): e.g. /plan NVDA 100, up to 4 stocks. The same checked plan as /plan and the MCP make_plan (runPlan, fixed words, never Claude, the page's default limits), one line per stock from the code's verdicts and sizes, and, when there is a buy, a saved plan link (via: 'telegram', see "Plan links") that opens on afterbook.app, where the person connects their own wallet and signs each buy after the checks run again. 10 a minute per chat (mcpPlanLimiter only, key tg:<chat>; no in-memory limit as on the MCP route) and the same 300 saved links a day site-wide (planLinkDailyLimiter). The plan has 25 s, a reply send 10 s, and each Telegram update is answered once (tgupd:<update_id>, an hour), so a resent update doesn't plan, save or reply twice. A stock on AUTO_PICK_HOLD says the link won't offer it. The bot itself never asks for a wallet or a signature./plan opens t.me/afterbook_bot?start=plan; the bot answers /start plan with a short welcome for /plan and /basket (a plain /start still gets the full help). The start value only picks the welcome text./basket [THEME] USD [STOCKS] (2026-11-25, lib/alerts/telegramBasket.ts): e.g. /basket 100, /basket tech 100, /basket chips 250 2. The same code-picked basket as the plan page's "Describe a basket" tab and the MCP make_basket (runBrief, fixed words, never Claude, the page's default limits): the deepest steady pools that pass, equal amounts, 3 to 4 stocks (a last number of 2 to 4 sets the fewest). The theme is a fixed word (any, chips, memory, software, internet, consumer, ev, health, china, global, bitcoin, space; tech is the Information Technology sector), never free text. The reply lists each pick's weight, amount and cost, any cash kept, and a saved basket link (via: 'telegram') offered whole or not at all after the checks run again; with no basket, the code's own reason and, when fewer stocks would pass, the exact command to send. Same per-chat limit, daily cap, timeout and once-per-update rule as /plan. Tests: tests/telegramBasket.test.ts.sendTelegramMessageStatus, stateAfterSend); otherwise the rule keeps its state and the next run tries again; one run sends at a time (alerts:lock, 120 s, over the run's 60 s limit), since Vercel can double-invoke a cron. Rules are read in a few MGETs and chats are checked 8 at a time within a 30 s budget (each loan read and Telegram send limited to 10 s, so a run ends inside its 60 s; if the re-read before a write fails, the run's own state is saved), from a random starting chat each run; a chat whose state changed is re-read just before its write and only active/failedReads are carried onto its current rules by id, so a /stop or a rule changed in the bot meanwhile isn't undone; one chat's error is counted and the run goes on; each run logs and returns how many chats it checked, couldn't read, or skipped for time (2026-11-22). After 30 minutes of failed reads of a watched wallet (LOAN_READ_FAIL_NOTICE, kept per rule as failedReads) the chat gets one heads-up that warnings are paused until it can be read (the count stops there, so an unreadable wallet doesn't rewrite the rules every tick). Weekend and holiday heads-up (2026-11-22, longBreakClose in lib/market/marketClock.ts, longBreakText in lib/lending/loanHealth.ts): once after-hours trading has ended (8 pm ET, 5 pm after a 1 pm early close) after a close that starts a weekend or a holiday (the next trading day isn't the next calendar day), each watched wallet with a loan gets one message with, per loan, its health if the next open matches Base's price. Far from the person's line it leads with "Market break check…: nothing urgent" and has no links; with the lower of health now and at Base's price under 1.25x their alert threshold (HEADS_UP_URGENT_FACTOR, owner 2026-11-22) it is a heads-up with an Aave loan's repay/add links. Once per such close per rule (breakSent, carried by the re-read like active; a /watch made during the break starts with it set, since its reply already shows the loan; the holiday list covers 2026 and 2027, and past it no heads-up is sent), only after a good read, only once Telegram accepts it; a warning due on the same tick goes first. Not built: a staleness check on the oracle price (only a missing price is a failed read) and a second, "critical" warning level.lib/lending/rescueLink.ts): a warning about an Aave loan ends with two links to /borrow?rescue=repay|add&fall=…&target=…#borrow-here. They preset the rescue planner (the fall the oracle would take to reach Aero's price, rounded up to the planner's next choice, and its first target above the alert's line) and fill the panel's own Repay or Add field once, from the connected wallet's live loan (only if the wallet holds the USDC or one of the stocks). The link carries no amount and no wallet, a value that isn't one of the planner's own choices is ignored, and the person checks it and signs with the panel's usual button and exact approval, with the Builder Code. Morpho loans get no link (no in-app Morpho panel)./stop. Addresses are public, and the bot never asks anyone to connect a wallet or sign anything.getUserAccountData and Morpho's API to 4 decimals (checked 2026-10-14 on real borrowers).t.me/afterbook_bot, linked from the tape hero); its display name, "AfterbookAlertsBot", is not a username and t.me/AfterbookAlertsBot does not exist.Live ticker strip under the header on every page: each stock's on-chain price with a coloured ▲/▼ for its live basis, as a slow marquee. Each item links to that stock's page (/NVDAc etc.). It pauses while a mouse hovers it (only on devices that really hover — see the note in app/styles/layout.css), runs again on leave and right after a tap, and never pauses on focus or press. prefers-reduced-motion stops it.
Today's gap (/today, "Biggest gap" until 2026-10-19): the single biggest cash-vs-chain gap right now as a hero card (icon, gap, cash and onchain prices, and what it takes to trade it: price impact of a $25k clip and the size needed to move the price 50/100 bp), liquidity-behind-the-tape stat cards, and a "who mean-reverts at the open" card per stock. The mean-revert stats are cached 10 minutes (unstable_cache) because they read thousands of history samples per symbol.
Borrow (/borrow): every USDC lending market on Base that takes a tracked stock as collateral, from two lenders, in one shape (lib/lending/lendingMarket.ts):
lib/lending/morpho.ts): listed markets only; the market list, rates and totals come from Morpho's public GraphQL API, and the oracle price is read on-chain from each market's oracle.lib/lending/aave.ts, since 2026-10-14): read straight from the contracts, with no API or key. The hub 0xa4d5…864E is one shared USDC pool; the "MAG7" spoke 0x1790…7B8D takes 7 stock tokens. Addresses are from Aave's address book (bgd-labs/aave-address-book, AaveV4Base.sol).
getAssetDrawnRate, RAY per year) and the borrow cap belong to the shared pool, so an Aave market's borrowUsd is null and the page shows the pool once.1 + (maxBonus − 1) × liquidationBonusFactor × (1 − liquidationFee), the smallest bonus, about 4.46% today (aaveV4LiquidationIncentiveFactor).#borrow-here, since 2026-11-03; AaveBorrowSection.tsx, AaveBorrowPanel.tsx, lib/lending/aaveBorrow.ts): an in-app USDC loan on Aave's MAG7 spoke, from the visitor's own wallet, behind the same region check and eligibility box as trading. While the cash market is fully shut (overnight, a weekend or a holiday; not pre-market or after-hours), the loan's summary adds "If Monday opens at Base's price: health X" (2026-11-22): Aave's own health scaled by the collateral's value at Base's per-token price (from /api/tape, hidden when the tape is carried over or over 90 s old) over its value at the oracle (healthAtPrices). Display only, never an amount or a limit. With a wallet that runs batches atomically on Base (Base Account), each action is one signature (2026-11-24, lib/lending/aaveBatch.ts): the exact approval of what the spoke pulls (only if the allowance is short) and the spoke call (the borrow multicall, repay or withdraw; the lend panel's supply or withdraw) as one atomic batch, refused unless aaveBatchProblem passes: only approvals of a reserve's own token naming the spoke, never unlimited, each exactly what the batch's supply or repay pulls (a full repay at most the panel's capped buffer), and only spoke calls on behalf of the signer, all with the Builder Code. Each batch is dry-run on Base first (as single swaps are) and isn't sent if it would revert. Other wallets keep the two steps. On the owner's real borrow and repay (2026-11-24) the browser blocked Base Account's second window every time. Aave, not Morpho, because that is where the USDC is: on 2026-11-03 the Equities pool had $1.23M to lend at ~3.6%, the listed Morpho stock markets about $3,200 in total.
SpokeInstance, solc 0.8.28): the spoke pulls tokens itself, so approvals name the spoke; borrow and withdraw pay the caller; every action needs onBehalfOf = the signer (no position managers are set up); supplying does not make collateral, setUsingAsCollateral does; repay caps an oversized amount at the debt; multicall runs on the spoke itself.multicall: supply, setUsingAsCollateral (only if not on yet), borrow. Either half can be left out. "Max" is the protocol limit (health 1.0, owner's choice) less 0.5% so a price tick or a few minutes' interest doesn't revert it, capped at $25,000 per borrow and the pool's free USDC.repay, or for "All" the debt plus 1 bp and one unit (repayAllApproval) and repay(MAX), which takes only what is owed. Withdraw: withdraw, at most what keeps the loan within the limit (less the margin); everything with no debt.1 − 1/health), red under 1.25. The panel says stock prices can stop updating while the market is closed and that interest runs all weekend.LoanRescue.tsx, lib/lending/rescue.ts): shown in the panel when the wallet owes USDC. The person picks a stress (prices as they are, or every stock 10/20/30% lower together; the USDC debt doesn't move) and a health to keep (1.3, 1.5 or 2.0). It shows the health under that stress and the two ways back to the target: the USDC to repay (rounded up to a cent, "all" when only a full repay gets there) and, for each stock the wallet holds, the tokens to add as collateral (the smallest amount that reaches it, found with the same maths the panel's projection uses, so a stock posted but not yet counted as collateral is handled). Each amount is worked out for the target plus 0.2% (RESCUE_MARGIN) for interest and rounding. When the wallet holds less, it offers what the wallet holds and the health that reaches. A button only fills the panel's own Repay or Add field and switches to that tab: the panel's button, its exact approval, its checks and the Builder Code do the rest, so the planner adds no transaction code. It turns itself off when its health and Aave's own differ by over 2% (RESCUE_MAX_MODEL_GAP: after a governance change to a collateral factor, the user's snapshotted factor differs from today's, and a repay or add doesn't refresh it); inside that, when Aave reads lower, every health shown is scaled down to Aave's and the amounts aim that much higher, so the result reaches the target on Aave's own number. A full repay is offered only when the wallet holds the debt plus the interest buffer (repayAllApproval), otherwise just under the debt; amounts in its sentences are exact, never rounded, so they match the filled box; and adding to a stock posted but switched off as collateral says that it turns it on. Checked on 2026-11-08 against real loans (health 1.16 and 1.17, read with a fake wallet that refuses to sign): its health matched Aave's, and a fill led to an approval of exactly the filled amount to the spoke, with the Builder Code. Tests: tests/loanRescue.test.ts.eth_simulateV1 from real holders (borrow, repay all, withdraw all; max withdraw passes, 10% over reverts) and a fake wallet.#lend-here, since 2026-11-03; AaveLendSection.tsx, AaveLendPanel.tsx, the lending part of lib/lending/aaveBorrow.ts): deposit USDC into the same spoke's USDC reserve, i.e. the Equities pool the loans above borrow from, and withdraw it, behind its own region check and eligibility box (which also says lenders can lose money and may wait to withdraw). Later on 2026-11-03 the pool had $6.42M lent in, 85% borrowed ($0.97M free), lenders earning ~2.9% a year.
supply(usdcReserve, amount, signer); at most $25,000 per deposit (MAX_LEND_USD) and the wallet's balance. Withdraw: withdraw(usdcReserve, amount, signer), at most what the wallet supplied and what the pool has free (getAssetLiquidity on the hub, read live); taking everything sends MAX so the last interest comes too, but only when the pool's free USDC exceeds the deposit by 0.1% plus $1 (lendWithdrawArg); balances, allowance and free USDC are re-read just before the first wallet call.eth_simulateV1 (deposit $1,000, withdraw $400, withdraw MAX: back to the start less one unit of rounding; a deposit without approval reverts) and a fake wallet.For each market: borrow and lend rates, collateral and borrows, USDC still free to borrow (Morpho per market; Aave from the shared pool, within its borrow cap), the Aero-vs-oracle gap, and how much a liquidator could sell on Aerodrome right now and still profit (lib/lending/liquidationRisk.ts). The card shows that as "Aero exit": a word first (aeroExit in lib/lending/borrowSummary.ts: Deep if the pool could take the market's whole collateral twice over, Tight if just, Short if not in one go), then the amount, in neutral colours on the page and the share card (owner decision 2026-10-15: it is a worst case, not an alarm). It is a worst case (every loan liquidated at once); the page says real liquidations are usually much smaller, especially on Aave. Each card's "Check a loan" link (#check=<marketId>) opens the calculator on that market with a 40% loan. The cards (.borrow-grid) are at least 280px wide, one line per row with values right-aligned, the rate labelled beside the big number, and a rule between the loan terms and the liquidation risk; Aave cards drop the Borrowed row (the pool is shared, the note above says so). Morpho Blue's liquidation incentive is min(1.15, 1/(1 - 0.3*(1 - LLTV))) (lib/lending/liquidationMath.ts); each market carries its own incentive, so a liquidator who sells on Aerodrome profits only while the average fill stays above oracle / incentive. Fills are simulated sell-side by walking the pool's real tick liquidity within 25% of the price (lib/market/swapSim.ts, on top of lib/market/depth.ts), since estimateLot only models buys within one tick. A "Check a loan" calculator (app/components/lending/BorrowCalculator.tsx, same pure math as the API) gives the liquidation price, room to fall, and whether Aerodrome could absorb that liquidation, assuming the same liquidity per tick and the same gap at the liquidation price (depth scales with the square root of price under that assumption, not linearly). Markets with no collateral collapse to one line. "Morpho ↗" links follow the same non-US gate as Aerodrome links; Aave cards link to the spoke contract ("BaseScan ↗"), because Aave's own app link for this market is not confirmed. Aave liquidates only enough of a loan to restore its target health (1.24), so the calculator's whole-loan seizure is an upper bound there. Afterbook signs nothing on this page.
Build a basket (/build, /build/<spec>): pick 2–4 tracked stocks and whole-percent weights; the basket lives in the URL (/build/NVDAc-40_AAPLc-30_METAc-30, or /build/NVDAc_AAPLc_METAc for equal weights; lib/build/customBasket.ts parses and renormalizes it, and a malformed one is a real 404 via app/build/[spec]/layout.tsx). Changing the basket keeps your scroll position: the picker navigates with scroll: false inside a transition, and the route deliberately has no loading.tsx, whose full-page placeholder replaced the page on every change and made it jump to the top. It shows the basket's weighted gap with the home hero's rules and labels (close-anchored while cash is fully closed, cashPriceType-driven wording otherwise), each leg's contribution, and what buying $1k / $10k / $50k of it costs on Aerodrome, plus the largest buy under 1% total cost (lib/build/basketCost.ts). Costs walk each leg's slice through that pool's real tick liquidity (simulateBuy in lib/market/swapSim.ts), not estimateLot's single-tick math, which matches it for small sizes but understates large ones (NVDAc $100k: 14.5 bp walked vs 8.2 bp single-tick on 2026-10-12). Each basket has its own share card (buildBasketOgImage). /build redirects to the three deepest pools at equal weights. "Buy or sell it" buys or sells the basket from the visitor's wallet (see In-app swaps → Basket buys); nothing here touches Glider or Basis Tilt. In the header nav as "Build", and linked from /baskets and /today. Five links fit the phone nav down to 320px only because "Biggest gap" reads "Gap" at 420px and below (owner decision, 2026-10-12; short in SiteHeader.tsx, screen readers still get the full label). The two-row phone header now applies up to 980px: at 641–900px the one-row nav used to be cut off.
Trade plan (/plan, owner 2026-11-08; linked from More): a person picks stocks (or "the 5 deepest"), a budget, the most they'll pay over the real stock, the most a fill may cost, and whether to wait before earnings, plus an optional note. Afterbook's code decides; Claude only explains. lib/agent/plan.ts checks each stock in order: a fresh price (else skip), a pool of at least $250k (TAPE_MAIN_DEPTH_USD, else skip), the gap against the same reference the hero uses (todayReference: the close while cash is closed; over 3% either way, wait, because a gap that wide is more often a stale pool or news than a bargain, BILIc read 9% below on 2026-11-08; over the person's limit, wait), and earnings within the chosen days (wait). A stock with no date is said to have no report in the next 14 days only if the earnings job's last full scan (15 days ahead, EARNINGS_SCAN_DAYS, every day fetched) is under 36 hours old (earnings:syncedAt in Redis); otherwise the plan says it couldn't confirm the date and to check before buying. The job tells a failed Nasdaq day from an empty one (fetchNasdaqEarningsForDate returns null on failure) and, if any day failed, only adds found dates: it never deletes a saved one and doesn't move earnings:syncedAt. It then splits the budget equally over what passed (a split under $10 a stock is skipped with that reason), caps each buy at the swap's own limits ($25k, 10% of the pool), and sizes it down until the walked fill cost (getBuyQuoter, price impact plus the pool fee, plus Afterbook's own fee if SWAP_FEE_BPS is ever on) fits the person's limit; every reason is a sentence written from the numbers. lib/agent/explain.ts sends the finished plan (as JSON, with the counts and, for each wait or skip, the one reason that decided it, decidedBy, apart from side notes such as an unconfirmed earnings date: on 2026-11-08 Claude, given one flat list, said a split-too-small skip was also because of the earnings warning) and the note (as quoted text, never instructions) to Claude (claude-haiku-5-5, no thinking, 400 tokens at most: a few sentences about numbers already decided; from an external review the same day, it was Opus with 4,000 tokens), which writes 3–6 plain sentences; it cannot change a verdict or a number, and is told never to forecast or call anything advice. Its reply is shown only if it finished (end_turn), ends a sentence, has no Markdown at all (*, _, backticks, #, links, list bullets) and says nothing banned: a forecast ("will rise", "will moon", "going up"…, punctuation after it included), "should buy/sell", or any form of recommend, guarantee, profit, advice/advise, moon, pump or price target (acceptExplanation, tightened after a second review found "NVDAc will rise." slipping through); otherwise the fixed words are used. Without ANTHROPIC_API_KEY, over the limits (10 explained plans an hour per visitor, 500 a day for the whole site, Redis SafeLimiters) or if Claude fails, the same facts are explained in fixed words (fallbackExplanation) and the page says so. A buy that passes opens the normal swap panel (SwapPanel) pre-filled with that amount, behind the same region gate and eligibility checkbox, with a fresh quote and all the swap checks; nothing is signed by the plan. Past plans are kept in the browser only (localStorage['afterbook-plans'], last 20), each buy with the onchain price at the time and how far it has moved since (before costs). Traction (2026-11-08, for the Stocks Maxxing entry): each plan adds to an anonymous per-day count in Redis (stats:plans:YYYY-MM-DD: made, explained by Claude, with a buy; nothing about the person; the plan waits at most 300 ms for the count, lib/agent/planStats.ts), and a buy reviewed from a plan is built with source: 'plan', so the swap log counts trades signed from a plan, their volume and distinct hashed wallets, each verified onchain like every swap. GET /api/agent/stats?days=30 (cron bearer) returns both. POST /api/agent/plan is the route (read-only, limitRead in the 10-a-minute bucket plus the Claude limits above; without Redis it never calls Claude). Tests: tests/agentPlan.test.ts, agentExplain.test.ts, agentRoute.test.ts.
Describe a basket (/plan, second tab, 2026-11-13): instead of picking stocks, a person gives a theme (fixed chips: AI chips, Memory & storage, Software & cloud, Internet & media, Consumer tech, EVs & autonomy, Health care, China, Outside the US, Bitcoin, Space, or Any), sectors to leave out (GICS), how many stocks to spread over (at least 2, 3 or 4, about 50/33/25% in each), a budget up to $25k (one basket buy), cash to keep (0–50%) and the plan's price, cost and earnings limits. The code picks; Claude only explains. lib/agent/brief.ts: the stocks with that theme (lib/stocks/sectors.ts, hand-made, checked against live sources 2026-11-13; a test fails if a tracked stock has no entry), minus the excluded sectors, with a pool that stayed over $250k for the last 3 hours (below), through the plan's own screen checks, then the up to 4 deepest (ties by symbol), e