THE PROBLEM The True Markets Call for Builders promises "a best execution report you can share with your clients." The Gateway API already returns the raw facts for every order: the reference price at creation, the fill VWAP, the fee, the venue and chain, and an explorer link. It has no report endpoint, so a fintech serving many users has no statement it can hand a client, and no execution audit across all of its users. WHAT FILL LEDGER DOES Fill Ledger is a read-only console that turns those fields into: - Organization overview: filled volume, orders, fees, trading clients, and an execution quality summary for a 24h, 7d or 30d window. - Execution audit: every order across every client, with slippage against the compared price, fee in bps, filters for failed or worse than reference fills, and a CSV export. - Order audit page: the maths shown step by step, the cost in dollars, the raw Gateway row, and a cross-issuer check of the same stock at the order's time, with staleness flags (a stale issuer price is struck through and never compared). - Per client statement: a date range, print or save as PDF, CSV, and a signed 7day read-only share link. It never signs, places or cancels a trade. The web app has no signer key. HOW IT USES GATEWAY All Gateway calls are made on the server, against api.truemarkets.co: - POST /v1/auth/api-key/token: organization token (ES256), using the API key. - GET /v1/gateway/organizations/{organization_id}/transactions?type=order: every client's orders, including price, executed_vwap, fee, venue, chain, explorer_url and failure_reason. - GET /v1/gateway/organizations/{organization_id}/transactions/stats: overview KPIs and the volume chart (24h, 7d, 30d). - GET /v1/account/organizations/{organization_id}/users: the client list. - GET /v1/gateway/assets: the public catalog, to find the same stock from other issuers. - GET /v1/defi/market/prices/history/point: the last known price at the order's time, used as the benchmark when Gateway's price is null and for the cross-issuer table. Staleness-checked. Slippage in bps is (executed VWAP minus compared price) divided by compared price, times 10,000, with the sign flipped for sells, so positive always means worse for the client. Within 5 bps either way counts as "at reference." When Gateway's price is null ("Null when no price was recorded"), Fill Ledger uses a public benchmark at order time, not a Gateway reference, and only if that price is fresh (by default no more than 120 seconds older than the order). The benchmark's age is shown next to every verdict that rests on it. A stale, future-dated or missing benchmark is struck through and the comparison reads n/a. Limit orders are compared with their own limit and labelled "vs limit (price improvement)"; they are left out of averages and of the better, at and worse counts. REAL ORDERS IN THE RECORDED DEMO The public demo runs in recorded mode: four real market orders placed on 25 November 2026 by our own test organization for test client demo-client-1, on Solana and Base. Each order has an onchain explorer link. Gateway returned a null price on all four, so each is compared with the public benchmark where that feed was fresh: - Buy NVDAC on Base: fill VWAP 142.98 versus a benchmark of 142.61 taken 24 seconds before the order, +25.8 bps, worse. The client paid $0.0031 more than at the benchmark. - Sell NVDAC on Base: fill VWAP 142.27 versus a benchmark of 142.97, 20 seconds old, +48.8 bps, worse. The client received $0.0059 less than at the benchmark. - The two NVDAX orders on Solana read n/a because that public feed was stale (about 38 hours). In the 7day window, filled volume is $6.38 with $0.0248 in fees, for one trading client. The average versus the public benchmark is +37.3 bps across the two comparable fills. Two fills were worse than the compared price, and two had no comparable price. This is a slippage and execution audit against the price data the API exposes. It is not a regulatory best execution analysis (no venue comparison, no NBBO). DATA MODES - Sample (default): bundled fixtures, labelled as sample data on every page, statement and CSV. - Recorded: real Gateway responses captured from our own test organization (the public demo). The banner shows the capture time, and pages read the captured file, not a live API call. - Live: calls Gateway on each request with the organization key, behind HTTP Basic auth. SECURITY - The organization API key is read on the server only and never sent to the browser. - Gateway error bodies are redacted (tokens, JWTs, keys, signatures) before they reach logs or pages. - Live and recorded modes sit behind HTTP Basic auth unless CONSOLE_PUBLIC is set to true, as on the public demo. - Share links are HMAC-signed, expire after 7 days, and show one client only. - CSV cells that look like formulas are escaped to block formula injection. HOW TO RUN Run npm install, then npm run dev to start sample mode on localhost:3000. Run npm run check for lint, typecheck and tests. Needs Node 20.9 or newer. Configuration is only through environment variables (see .env.example). Times use REPORT_TIMEZONE, which defaults to Africa/Lagos and is shown as WAT. Source: https://github.com/Mzee04/fill-ledger