Back to Browse

Afterbook MCP Server

Developer ToolsLow Risk10.0MCP RegistryRemote
Free

Server data from the Official MCP Registry

Checked trade plans, baskets and loan health for Coinbase tokenized stocks on Base. You sign.

About

Checked trade plans, baskets and loan health for Coinbase tokenized stocks on Base. You sign.

Remote endpoints: streamable-http: https://afterbook.app/api/mcp

Security Report

10.0
Low Risk10.0Low Risk

Valid MCP server (1 strong, 0 medium validity signals). No known CVEs in dependencies. Imported from the Official MCP Registry.

7 tools verified · Open access · No issues found

Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.

Permissions Found in Source Code

Found by scanning the linked source code. This listing connects to a hosted endpoint, so none of this runs on your machine: it describes what the server software does where it is hosted.

file_system

Applies to the server that hosts this plugin, not to your machine.

HTTP Network Access

Connects to external APIs or services over the internet.

database

Applies to the server that hosts this plugin, not to your machine.

How to Connect

Remote Plugin

No local installation needed. Your AI client connects to the remote endpoint directly.

Add this to your MCP configuration to connect:

{
  "mcpServers": {
    "io-github-hryhorii77-afterbook": {
      "url": "https://afterbook.app/api/mcp"
    }
  }
}

Documentation

View on GitHub

From the project's GitHub README.

Afterbook

Live at afterbook.app.

AI agents: start at afterbook.app/AGENTS.md: what Afterbook does, the safety and routing rules, the MCP server and API with prices, and every token and pool address (built from the code). The short index is /llms.txt.

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.

What it shows

  • 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). Look up a wallet (2026-11-26, WalletLookup.tsx, lib/wallet/walletInput.ts): type any 0x address or Basename on /portfolio (or open /portfolio?wallet=jesse) to see that wallet's public positions without connecting, headed "A looked-up wallet" with "Stop viewing" (or "Back to my wallet"); on /borrow, "Look up a wallet's stock loans" shows any wallet's Aave and Morpho loans from the free /api/loans (the same report as the MCP tool check_loan_health, without its rescue links, which fill the panel from the connected wallet). Read-only: it reads public positions and never signs. A Basename resolves forward through the Basenames registry (addressOfBasename), and a reverse name is shown only if it points back to the same address (anyone can set any reverse name). The approvals section on /portfolio stays the connected wallet's. Tests: tests/walletLookup.test.ts; 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 link can fill in the buy amount (?side=buy&usdc=100, lib/swap/prefill.ts, 2026-11-26): buy only, whole dollars from $1 to the $25,000 swap cap, anything else ignored (whole dollars because the panel floors its starting amount to cents in floating point, so $19.99 would show 19.98). It only sets the page's amount, which is quoted live like a typed one; a note says the link filled it in, and the person still ticks the box, reviews and signs. The swap panel and its checks are unchanged. Tests: tests/prefill.test.ts. 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.
    • Loan alerts (since 2026-10-14): /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).
      • When it warns: once, when the lowest health drops below the threshold (default 1.2, allowed 1.01–3; liquidation is below 1.00). It re-arms only above threshold × 1.05 (nextLoanState, LOAN_REARM_FACTOR in lib/lending/loanHealth.ts).
      • Aerodrome's price: health is also worked out at Aerodrome's price, the edge here. Lending oracles follow the shut cash market while Aerodrome trades, so the warning can come before the oracle moves, and the message says when that is the reason.
      • Failed reads and closed loans: a failed read keeps the state, so it can't fire or re-arm. A wallet with no loans re-arms. Posted collateral or an open Morpho position whose oracle price couldn't be read counts as a failed read, never as a smaller loan or no

Documentation truncated — see the full README on GitHub.

Reviews

No reviews yet

Be the first to review this server!