vialfile

Vial inventory & cost

Running out mid-cycle is a safety failure — a sudden taper of a GH secretagogue or a scramble to split doses across vials of different concentrations. This page tracks every vial you own, pulls in your injection log to estimate remaining mg, and compares the total to your active stack's burn rate. If you've got less than a week of supply, it tells you.

Supply per peptide

Your vials

How burn-rate is computed

  1. Open vials sort oldest-first. The injection log's entries (timestamped after your oldest open vial's open date) are allocated FIFO — the first vial drains until empty, then overflow goes to the next.
  2. Sealed vials count toward total mg in hand. They don't get allocated log use until you mark them open.
  3. Daily burn comes from your active stack. The stack item's doseMcg × the peptide library's typical frequency (daily, 2x-weekly, etc.). Without an active stack, the math is skipped and you see "set an active stack to compute."
  4. Running-out threshold = 7 days. Low = 7–14 days. Above 14 = ok. The warning at the top lists every peptide in the running-out bucket.

Inventory FAQ

What does the expiry badge (e.g. "expires 2026-08-12") on a vial mean?

It shows the pharmacist-confirmed expiry date you entered when adding that vial. Reconstituted BAC-water peptides degrade over weeks to months depending on peptide, solvent, temperature, and light exposure — the app can't calculate this exactly, so the optional expiry field lets you record the date printed on your compounding pharmacy label or confirmed by your protocol. Colour-coded: green = more than 7 days away, amber = within 7 days, red = expired. Leaving the field blank hides the badge entirely and falls back to the default shelf-life display. Expiry dates are stored alongside the vial; updating the date requires deleting and re-adding the vial (or editing the JSON in your browser's DevTools).

What's the "Reorder now: BPC-157 — ~5d of supply remaining" card at the top?

It's a focused reorder prompt that surfaces the single active-stack peptide with the lowest days-of-supply below the comfort threshold (14 days). Unlike the general running-out warning (which lists every peptide below 7 days) and the per-peptide "Suggested: N vials" badge inside each supply card, this one picks the most critical peptide and puts it front and center with a direct vendor search link so the action is one click away. The card collapses entirely when all your active-stack peptides are above the 14-day low-stock threshold. The search link targets Peptide Sciences — you can copy the peptide name and search any supplier you prefer.

What's the "Used ~7.5mg over last 30 days" line under a peptide card?

It's your observed consumption for the trailing 30 days, summed straight from your injection log — no projections, no stack assumptions. Every log entry for that peptide within the window (timestamp ≤ now, timestamp > 30 days ago) with a positive dose and a recorded route is counted. The number is in mg (mcg ÷ 1000). The "~" prefix is honest about minor imprecision: entries recorded with slightly wrong timestamps still get counted if they're in the window. The line hides when there's no qualifying log activity so a peptide with zero injections in the past month doesn't show a confusing "Used ~0mg" line. Compare this number to the projected burn rate from your active stack to spot dose-schedule drift — if you're logging 5 mg/month but your stack projects 10 mg/month, you're under-dosing relative to protocol.

What's the "BPC-157 cost/mg: $8.40 → $9.60 → $10.40 (8 vials, +24% trend)" line under a peptide card?

It's a supplier-price-drift cue: under each per-peptide summary card, when you've logged at least 3 vials of that peptide with a non-zero costUsd, this line shows the per-mg price for the oldest, middle, and newest purchase, plus the overall trend percentage. Below 3 vials the line hides — one or two data points is noise, not a pattern. The numbers normalize to cost per mg (vial cost ÷ mgInVial) so a 5 mg vial @ $40 and a 10 mg vial @ $80 read as the same $8/mg supplier price; raw vial cost across SKUs would create a noisy false trend. The middle value comes from the chronological median position (floor((N − 1) / 2)) so for 8 vials it's the 4th-oldest. Trend percentage is the rounded ((newest − oldest) ÷ oldest) × 100 — positive numbers prefix "+", zero prints as "0%", negative numbers carry their own minus. Vials without a recorded cost (costUsd = 0) are excluded entirely so a partial-data peptide doesn't get an artificially-low first value.

What's the "Will need to open next vial in ~3d" line under a vial?

It's a refill-cycle nudge: under the open vial you're currently drawing from, when there's a sealed sibling waiting AND your active stack gives a positive daily burn, this projects how many days the open vial has left. Computed as round((mgInVial − mgUsed) ÷ dailyMgBurn), minimum 1 day (the "~" prefix makes that approximation honest). Only attaches to the newest-opened vial in each peptide group — older opens (rare) will empty mid-stream while you keep drawing from the newest, so opening a sealed isn't required at that moment. Hides entirely when there's no sealed sibling, no active stack, or the vial is full enough not to matter. Mirrors the FIFO oldest-opened-first allocation rule the rest of the page is built on.

What's the "Log says these vials have used more than you recorded" panel?

Your injection log is the authoritative record of what was actually drawn. Each vial's mgUsed is an eyeball estimate that drifts — you forget to update it after a dose, a week later it's off. The preview panel runs the FIFO oldest-opened-first allocation (same rule your days-of-supply uses) over the log against each open vial and shows where the log says you've drawn more than you recorded. One click applies the log-derived number, routing through the same setVialUsed the manual "Record use" button uses. Never reduces mgUsed; never over-allocates past vial capacity; only appears for vials where something would actually change.

Does inventory write to my injection log?

No. Inventory is a read-only consumer of vialfile-log-v1, the same pattern the stack and bloodwork pages use. Your log entries stay user-authored; inventory looks at them without touching.

What if my injection log doesn't match the log-derived mg used?

Manual mgUsed on each vial is treated as a floor — if you record 2 mg used manually, the FIFO allocation starts at 2 mg. If the log contains more doses than the manual number, the log takes over. If it contains fewer (e.g. you didn't log every dose), the manual floor is preserved.

Why FIFO oldest-opened?

Real pharmacy behavior: you finish the vial you opened first before opening the next. FIFO makes the running-out estimate refer to the vial you're actively drawing from, not the average across all open vials. When the oldest fills to capacity, overflow bumps into the next.

What counts as "running out"?

Fewer than 7 days of supply at the active-stack burn rate. The warning surface at the top of the page lists every peptide in this state. 7–14 days = "low" (grey-warn badge but no top banner). More than 14 days = ok.

What's the notes summary above my vial list?

It's a consolidated view of every vial note you've entered — lot numbers, vendor names, reconstitution concentrations, anything you put in the note field when adding a vial. The note is already visible on each individual vial row, but when you're spread across many vials across multiple peptides, scrolling through them one by one to find your lot number is slow. The summary surfaces all non-empty notes in alphabetical peptide order so you can scan everything in one place. Vials without notes are omitted. The panel disappears entirely if none of your vials have notes.

Why isn't inventory in the backup file?

The backup file covers injections, side-effects, and bloodwork — the three user-authored logs. Inventory is recoverable from receipts and the injection log; losing it is a rebuild afternoon, not years of history. A future backup version may include it; for now, v1 stays stable.

What if I don't have an active stack?

The per-peptide summary shows mg in hand and total cost, but days-of-supply is blank ("set an active stack to compute"). Go to the stack page and mark one active to light up the supply math.

What does the "runs out Nd before panel" alert mean?

When you have an upcoming bloodwork protocol scheduled AND your current peptide supply (days-of-supply at active-stack burn rate) will run out before that draw date, this alert fires: BPC-157 — runs out in 4d, 2d before panel (panel due in 6d). The purpose is to catch reorder timing before a draw — some peptides need active dosing right up to the bloodwork window (or to be paused cleanly in advance). The alert is ranked by shortfall: the peptide with the biggest gap between supply-end and draw date appears first. It only fires for peptides whose draw date is in the future; overdue draws are covered by the ⚠ badge on empty vials below.