Livestream E-commerce product sourcing - lineup structure and whole-show margin calculator, single file - building a lineup is casting roles, not picking best-sellers, and the traffic item's loss is the cost of buying audience: shown openly, budgeted openly. Outputs a show-level profit band and per-role contribution, arithmetic on the page, and the tool never suggests cutting a losing product
You are a coding agent building an internal tool for a
livestream selling team. Build a single-file HTML tool (HTML,
CSS, JS all inlined, no external dependencies, no network
requests, opens by double-click) for product sourcing to
compute livestream lineup structure and whole-show margin.
Core stance: a lineup is role-casting, not a collection of
"products that sell" - the loss on traffic items is the cost
of buying concurrency, and that account gets computed in the
open.
Input areas (manual entry, save and export):
A. Lineup detail: product / role (traffic, acquisition,
margin, showcase - pick one) / show price / per-unit
direct cost (goods + commission + shipping + attached-gift
offset) / low and high sales estimates (two figures, no
single-point entry)
B. Fixed costs: venue and labor allocation for the show /
paid-traffic budget / samples and presentation consumables
(showcase items live mostly here)
C. Parameters: combined traffic-plus-acquisition loss red
line (amount or share of projected GMV, blank for local
setting)
Computation rules (all expanded on the page, every step
visible):
1. Per-unit margin = show price - per-unit direct cost
(negative is a per-unit loss; no absolute-value hiding)
2. Product contribution = per-unit margin x volume (low and
high each)
3. Show profit = sum of contributions - fixed costs -
output low and high, forming a band; no "expected value"
single point
4. Role contribution shares: each role's margin contribution
(or loss) as a share of the show - traffic items display
as negative contribution, labeled plainly
5. Bleed monitor: the combined loss of traffic + acquisition
roles compared against the red line; over the line, a
full-screen red banner
6. Margin-item pressure: the margin-item revenue share needed
for the show to break even - this number tells the lineup
builder what the margin items must sell like, which beats
any "margin items matter" reminder
Output areas:
1. Show profit band card: low and high side by side, red when
below zero
2. Lineup structure table: grouped by role - product /
per-unit margin / both volume tiers / both contributions /
share
3. Bleed-versus-red-line bar
4. Every number click-expands to its full arithmetic -
features whose formulas cannot be shown do not get built
Usage boundary (printed in the tool footer):
- Data stays in the local browser; nothing uploads
- Red-line breaches alarm but never auto-suggest "cut product
X" - a losing role is part of the cast; cutting it is a
human lineup decision, not a bug the tool corrects
- Showcase items carry no sales estimate: their value is
display and trust endorsement; inventing a volume for them
and computing margin turns an unknown into a fake known -
only their sample and consumable costs enter fixed costs
Prohibitions:
- No single-point "expected profit" output - single points
manufacture false precision; bands are honest
- Volumes, costs, and red-line parameters stay blank; no
pre-filled "typical industry values" - pre-fills become
authoritative defaults
- No "auto-optimize the lineup" feature (auto-ranking, auto-
cutting) - lineup trade-offs carry much human judgment
(rhythm, audience, supplier relations); the tool only keeps
the books clear
- No "smart" or "AI-optimized" wording anywhere on the page -
this is an abacus
Why it is written this way
The mistake most available in lineup accounting is not arithmetic but stance: viewed as "what each product earns on its own," the traffic item is an error to be eliminated; viewed as role-casting, its loss is the marketing budget that buys the room its audience. Both views hold, but only the second explains why every big livestream room sells traffic items at a loss. This tool welds the second stance into its structure - traffic items display as negative contribution, bleed sits against a red line - so the lineup builder sees where the money goes and how much, before deciding, rather than discovering it in the P&L afterward.
Two volume tiers forming a band instead of a single forecast exists because livestream volume is genuinely unpredictable: host condition, traffic swings, competitor moves all perturb it. Give an "expected volume" point and the tool joins the false-precision game - the builder starts deciding around a number that was a guess. A band at least frames the uncertainty honestly.
"Margin-item pressure" is the tool's most useful single output: the margin-item revenue share required to break even. It translates "will this show work" into "that product must sell like this" - a builder seeing 45% naturally goes and checks whether the margin item's mechanism and presentation minutes can carry it, which no reminder to "value margin items" ever achieved.
No auto-cutting, no smart optimization, guards the boundary between tool and decision. Whether to cut a losing product pulls on show rhythm, audience tagging, supplier relations - variables that are not in the tool's input area. Its value is transparent books with decisions left in human hands; the moment it starts "optimizing," the builder stops thinking, and the tool begins deciding things it cannot see.
Variables
| Variable | Description |
|---|---|
| Loss red line | The tolerated combined loss on traffic + acquisition (amount or GMV share) - the team's audience-buying budget; set openly or it binds nothing |
| Volume tiers | Each product's low and high estimates - low on conservative traffic, high on a smooth show; better wide than narrow |
| Fixed-cost basis | Which fixed items get allocated per show - once set, keep it stable across shows or shows stop being comparable |