What does Hosted Retainers and Value-Anchored Shares conclude, in numbers, about “The Hosting Playbook: Four Kinds of Client and the Hosting-Contract Calculator”?
Answer: For Lanyu the engine reproduces Chapter 1: value per order 3.7125; a first-month bill of RM 1,900.00 against value of RM 5,568.75, a share of 0.341, and a Bridgecalc gross margin of 0.484. Over ten years the client is expected to pay for 32.08 months, and after RM 4,800 of onboarding the lifetime gross margin is RM 32,562.83, which rounds to exactly the RM 32,563 of p13 in Chapter 1; with a constant churn rate of 0.0667 instead, the engine likewise returns Chapter 1's RM 11,958. Discounted payback comes in month 6. The monthly bills of the four contracts, joined line by line as "client|month|bill", hashed with SHA-256 and cut to the first 16 hex digits, give the fingerprint f3e804c0b4d48f8d; any parameter or line of code that changes any month's bill changes the fingerprint.
Scope of the numbers: Marked boxes separate published evidence, runnable calculations, sources and the author's hypotheses, each stating what would refute it.
Data table
The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 0.0667, 0.341, 0.484, 11958, 13, 1900.00
== lanyu (order) verdict PRICE code OK warn WARN_CAP_NEAR
value per order 3.7125; target bill m1 1949.06; cap / in-house cost 0.923
terms: retainer RM 1,900 incl. 1,500; per extra order: 1,500+ at 0.96, 3,000+ at 0.64
cap RM 4,800; in-house RM 5,200; onboarding RM 4,800; minimum term 12 months
month volume value bill cost share margin client_net supplier_gm
1 1,500 5568.75 1900.00 980.00 0.341 0.484 3668.75 920.00
13 1,902 7062.52 2286.27 1068.52 0.324 0.533 4776.25 1217.75
25 2,413 8956.98 2776.15 1180.78 0.310 0.575 6180.84 1595.37
37 3,060 11359.62 3378.29 1323.16 0.297 0.608 7981.33 2055.13
expected billed months in 120: 32.08; discounted payback month 6; gm / billing 0.568
lifetime gross margin after setup 32562.83; client discounted net gain 145724.84
rounded lgm RM 32,563; at constant churn 0.0667: RM 11,958; team RM 14,400 over 640 hours
== mingyue (invoice) verdict PRICE code OK warn -
value per invoice 3.7500; target bill m1 5250.00; cap / in-house cost 0.679
terms: retainer RM 5,000 incl. 4,000; per extra invoice: 4,000+ at 1.1, 8,000+ at 0.8
cap RM 9,500; in-house RM 14,000; onboarding RM 16,000; minimum term 24 months
month volume value bill cost share margin client_net supplier_gm
1 4,000 15000.00 5000.00 2800.00 0.333 0.440 10000.00 2200.00
13 4,507 16902.38 5558.03 2876.10 0.329 0.483 11344.35 2681.94
25 5,079 19046.02 6186.83 2961.84 0.325 0.521 12859.19 3224.99
37 5,723 21461.53 6895.38 3058.46 0.321 0.556 14566.15 3836.92
expected billed months in 120: 63.01; discounted payback month 8; gm / billing 0.526
lifetime gross margin after setup 129735.07; client discounted net gain 577104.22
rounded lgm RM 129,735; at constant churn 0.0244: RM 78,563; team RM 76,800 over 1,920 hours
== shiguang (booking) verdict PRICE code OK warn -
value per booking 6.0000; target bill m1 462.00; cap / in-house cost 0.600
terms: retainer RM 460 incl. 200; per extra booking: 200+ at 1.2, 400+ at 0.9
cap RM 900; in-house RM 1,500; onboarding RM 1,200; minimum term 6 monthsShow the full program
# Chapter 7. p70: Hosting-contract engine (op "hosting"): bill path, both gains, lifetime gross margin.
# Lanyu, Mingyue, Shiguang follow the sample card (p10-p13, p53); the last three contracts are this chapter's.
# Every client, team cost, volume, rate and retention parameter is a FICTIONAL SAMPLE in MYR, not data.
import hashlib
import math
SHARE_MAX = 0.45 # V2: bill / measured value at baseline volume or above (book rule R1, p80)
GM_MIN = 0.40 # V4: supplier gross margin / bill in every month (book rule R2)
UNIT_MAX = 0.45 # V5: price of one extra unit / value of that unit (book rule R4)
SHARE_WARN_LOW = 0.15 # warn: supplier keeps under 15% of the value it creates
SHARE_SLUMP = 0.50 # warn: in a slump the floor takes more than half of the value
SHARE_OFF = 0.05 # warn: realised month-1 share differs from the negotiated target by more
WEEKS_MIN = 4 # V3: at least four weeks of measured baseline
METHODS = ("mean", "median") # V3: never the worst month (regression to the mean, p24)
EXPORT_DAYS_MAX = 30 # V6: full export in an open format within 30 days
ESC_CAP_MAX = 0.05 # V8: yearly price-adjustment cap (chapter 6 rule)
NOTICE_MIN = 60 # V8: days of written notice before any price change
SLA_MIN = 0.99 # V7: availability target floor
SLA_CAP_MIN = 0.10 # V7: credit cap at least 10% of the monthly bill
PAYBACK_WARN = 12 # warn when discounted payback takes longer than this many months
CAP_NEAR = 0.90 # warn: cap above 0.90 of the client's in-house cost (cap rule of chapter 4)
NEED = ("q0", "team_cost", "team_hours", "minutes_saved", "err_before", "err_after", "cost_per_error",
"baseline_weeks", "baseline_method", "share", "retainer", "included", "tiers", "cap", "inhouse",
"fixed_cost", "unit_cost", "setup", "min_term", "growth", "grow_months", "horizon", "alpha",
"beta", "discount", "sla", "exit", "price_adj")
SLA3 = dict(target=0.995, credits=[[0.995, 0.10], [0.99, 0.25], [0.98, 0.50]], cap=0.50)
SLA_HI = dict(target=0.999, credits=[[0.999, 0.10], [0.995, 0.25], [0.99, 0.50]], cap=0.50)
OPEN_EXIT = dict(export_days=14, open_format=True, fee_rule="unamortized")
INDEX_ADJ = dict(type="index", cap=0.05, notice_days=60)
SAMPLES = {
"lanyu": dict(
unit="order", q0=1500, team_cost=14400, team_hours=640, minutes_saved=7.5,
err_before=0.020, err_after=0.005, cost_per_error=60, credit=1.0, baseline_weeks=6,
baseline_method="mean", share=0.35, retainer=1900, included=1500, rev_per_unit=16,
tiers=[[1500, 0.06], [3000, 0.04]], cap=4800, inhouse=5200, fixed_cost=650, unit_cost=0.22,
setup=4800, min_term=12, growth=0.02, grow_months=36, horizon=120, alpha=1.0, beta=14.0,
discount=0.008, sla=SLA3, exit=OPEN_EXIT, price_adj=INDEX_ADJ),
"mingyue": dict(
unit="invoice", q0=4000, team_cost=76800, team_hours=1920, minutes_saved=3.0,
err_before=0.010, err_after=0.003, cost_per_error=250, credit=1.0, baseline_weeks=8,
baseline_method="median", share=0.35, retainer=5000, included=4000,
tiers=[[4000, 1.10], [8000, 0.80]], cap=9500, inhouse=14000, fixed_cost=2200, unit_cost=0.15,
setup=16000, min_term=24, growth=0.01, grow_months=36, horizon=120, alpha=0.6, beta=24.0,
discount=0.008, sla=SLA_HI, exit=dict(export_days=30, open_format=True, fee_rule="unamortized"),
price_adj=dict(type="index", cap=0.05, notice_days=90)),
"shiguang": dict(
unit="booking", q0=220, team_cost=4800, team_hours=160, minutes_saved=12,
err_before=0.12, err_after=0.12, cost_per_error=180, credit=1.0, baseline_weeks=4, # no-show gain
baseline_method="mean", share=0.35, retainer=460, included=200, # is grade D: left out (ch. 1)
tiers=[[200, 1.20], [400, 0.90]], cap=900, inhouse=1500, fixed_cost=180, unit_cost=0.40,
setup=1200, min_term=6, growth=0.005, grow_months=36, horizon=120, alpha=1.5, beta=9.0,
discount=0.008, sla=dict(target=0.99, credits=[[0.99, 0.10], [0.98, 0.25]], cap=0.25),
exit=dict(export_days=7, open_format=True, fee_rule="unamortized"), price_adj=INDEX_ADJ),
"bellferry": dict(
unit="call", q0=40000, team_cost=4500, team_hours=150, minutes_saved=0.06,
err_before=0.010, err_after=0.002, cost_per_error=2.0, credit=1.0, baseline_weeks=4,
baseline_method="mean", share=0.40, retainer=600, included=30000, rev_per_unit=0.20,
tiers=[[30000, 0.05], [100000, 0.03], [300000, 0.02]], cap=1800, inhouse=2500,
fixed_cost=300, unit_cost=0.001, setup=2500, min_term=12, growth=0.04, grow_months=36,
horizon=120, alpha=1.0, beta=12.0, discount=0.008, sla=SLA_HI, exit=OPEN_EXIT,
price_adj=INDEX_ADJ),
}
def refuse(code, why):
return {"verdict": "REFUSE", "code": "REFUSE " + code, "refusals_hit": [code], "why": why}
def volume(c, t):
return c["q0"] * (1 + c["growth"]) ** min(t - 1, c["grow_months"])
def unit_value(c):
hour = c["team_cost"] / c["team_hours"]
v = c["minutes_saved"] / 60 * hour + (c["err_before"] - c["err_after"]) * c["cost_per_error"]
return c.get("credit", 1.0) * v
def unit_rate(c, rate):
return rate * c.get("rev_per_unit", 1.0)
def bill_raw(c, q):
parts, tiers = [c["retainer"]], c["tiers"]
for i, (start, rate) in enumerate(tiers):
end = tiers[i + 1][0] if i + 1 < len(tiers) else math.inf
parts.append(max(0.0, min(q, end) - start) * unit_rate(c, rate))
return math.fsum(parts)
def bill(c, q):
return min(bill_raw(c, q), c["cap"])
def cost(c, q):
return c["fixed_cost"] + c["unit_cost"] * q
def check(c):
miss = [k for k in NEED if k not in c]
if miss:
return refuse("V1", "missing " + ",".join(miss))
nums = ("q0", "team_cost", "team_hours", "retainer", "included", "cap", "inhouse", "fixed_cost",
"unit_cost", "setup", "alpha", "beta", "minutes_saved", "cost_per_error")
if any(not isinstance(c[k], (int, float)) or c[k] < 0 for k in nums) or c["q0"] <= 0:
return refuse("V1", "negative or non-numeric amount")
if c["team_hours"] <= 0 or c["alpha"] <= 0 or c["beta"] <= 0 or not 0 < c.get("credit", 1.0) <= 1:
return refuse("V1", "team hours, retention parameters or credit outside range")
if not 0 < c["share"] < 1 or not 1 <= c["horizon"] <= 120 or c["growth"] <= -1 or c["discount"] < 0:
return refuse("V1", "share, horizon, growth or discount outside range")
if c["share"] > SHARE_MAX:
return refuse("V2", "negotiated share %.2f above %.2f" % (c["share"], SHARE_MAX))
if (c["baseline_weeks"] < WEEKS_MIN or c["baseline_method"] not in METHODS
or not 0 <= c["err_after"] <= c["err_before"] <= 1):
return refuse("V3", "baseline: %s weeks, method %s, errors %s->%s"
% (c["baseline_weeks"], c["baseline_method"], c["err_before"], c["err_after"]))
starts = [s for s, _ in c["tiers"]]
rates = [unit_rate(c, r) for _, r in c["tiers"]]
shape = any(b <= a for a, b in zip(starts, starts[1:])) or any(b > a for a, b in zip(rates, rates[1:]))
if (c["tiers"] and (starts[0] != c["included"] or shape)) or c["cap"] < c["retainer"]:
return refuse("V5", "tiers: start at included, volumes up, rates down; cap >= retainer")
if rates and rates[0] > UNIT_MAX * unit_value(c):
return refuse("V5", "extra unit priced %.4f, above %.2f of its value %.4f"
% (rates[0], UNIT_MAX, unit_value(c)))
if c["cap"] >= c["inhouse"]:
return refuse("V10", "cap %.2f not below in-house cost %.2f" % (c["cap"], c["inhouse"]))
ex = c["exit"]
if (ex.get("export_days", 999) > EXPORT_DAYS_MAX or not ex.get("open_format")
or ex.get("fee_rule") != "unamortized"):
return refuse("V6", "exit locked: export %s days, open %s, fee %s"
% (ex.get("export_days"), ex.get("open_format"), ex.get("fee_rule")))
s = c["sla"]
if s.get("target", 0) < SLA_MIN or not s.get("credits") or s.get("cap", 0) < SLA_CAP_MIN:
return refuse("V7", "service level without remedy")
pa = c["price_adj"]
if pa.get("type") != "index" or pa.get("cap", 1) > ESC_CAP_MAX or pa.get("notice_days", 0) < NOTICE_MIN:
return refuse("V8", "price change not index-linked, cap above 0.05 or notice under 60 days")
return None
def run(c):
bad = check(c)
if bad:
return bad
alive, rows, gm_pv, net_pv, life, bills = 1.0, [], [], [], [], []
payback, cum = None, -c["setup"]
for t in range(1, c["horizon"] + 1):
q = volume(c, t)
v, b, k = unit_value(c) * q, bill(c, q), cost(c, q)
disc = (1 + c["discount"]) ** (t - 1)
gm_pv.append(alive * (b - k) / disc)
net_pv.append(alive * (v - b) / disc)
bills.append(alive * b / disc)
life.append(alive)
cum = math.fsum([cum, gm_pv[-1]])
if payback is None and cum >= 0:
payback = t
rows.append((t, q, v, b, k, b / v, (b - k) / b))
alive *= (c["beta"] + t - 1) / (c["alpha"] + c["beta"] + t - 1)
over = [r for r in rows if r[1] >= c["q0"] and r[5] > SHARE_MAX + 1e-12]
if over:
return refuse("V2", "share %.3f in month %d" % (over[0][5], over[0][0]))
thin = [r for r in rows if r[6] < GM_MIN]
if thin:
return refuse("V4", "gross margin %.4f in month %d" % (thin[0][6], thin[0][0]))
lgm = math.fsum([-c["setup"]] + gm_pv)
if payback is None or lgm <= 0:
return refuse("V9", "no discounted payback within %d months" % c["horizon"])
warn = []
if min(r[5] for r in rows) < SHARE_WARN_LOW:
warn.append("WARN_SHARE_LOW")
if any(r[5] > SHARE_SLUMP for r in rows):
warn.append("WARN_SHARE_SLUMP")
if abs(rows[0][5] - c["share"]) > SHARE_OFF:
warn.append("WARN_SHARE_OFF")
if any(bill_raw(c, r[1]) > c["cap"] for r in rows):
warn.append("WARN_CAP_HIT")
if c["cap"] > CAP_NEAR * c["inhouse"]:
warn.append("WARN_CAP_NEAR")
if payback > PAYBACK_WARN:
warn.append("WARN_PAYBACK_LONG")
return {"verdict": "PRICE", "code": "OK", "refusals_hit": [], "warn": warn, "rows": rows,
"lgm": lgm, "client_pv": math.fsum(net_pv), "life": math.fsum(life), "payback": payback,
"gm_share": math.fsum(gm_pv) / math.fsum(bills), "unit_value": unit_value(c),
"target_bill_m1": c["share"] * rows[0][2]}
def const_churn_lgm(c):
"""Same path, but every month keeps the client with probability 1 - alpha / (alpha + beta) (p13)."""
keep, alive, terms = 1 - c["alpha"] / (c["alpha"] + c["beta"]), 1.0, []
for t in range(1, c["horizon"] + 1):
q = volume(c, t)
terms.append(alive * (bill(c, q) - cost(c, q)) / (1 + c["discount"]) ** (t - 1))
alive *= keep
return math.fsum(terms) - c["setup"]
def fingerprint(results):
lines = ["%s|%d|%.2f" % (n, r[0], r[3]) for n, res in results for r in res["rows"]]
return hashlib.sha256("\n".join(lines).encode()).hexdigest()[:16]
def main():
done = []
for name, c in SAMPLES.items():
res = run(c)
print("== %s (%s) verdict %s code %s warn %s"
% (name, c["unit"], res["verdict"], res["code"], ",".join(res["warn"]) or "-"))
print(" value per %s %.4f; target bill m1 %.2f; cap / in-house cost %.3f"
% (c["unit"], res["unit_value"], res["target_bill_m1"], c["cap"] / c["inhouse"]))
tiers = ", ".join("{:,}+ at {:g}".format(st, round(unit_rate(c, r), 4)) for st, r in c["tiers"])
print(" terms: retainer RM {:,} incl. {:,}; per extra {}: {}".format(c["retainer"], c["included"],
c["unit"], tiers))
print(" cap RM {:,}; in-house RM {:,}; onboarding RM {:,}; minimum term {} months"
.format(c["cap"], c["inhouse"], c["setup"], c["min_term"]))
print(" month volume value bill cost share margin client_net supplier_gm")
for t, q, v, b, k, sh, gm in res["rows"]:
if t in (1, 13, 25, 37):
print(" %5d %9s %10.2f %8.2f %8.2f %6.3f %7.3f %11.2f %12.2f"
% (t, "{:,.0f}".format(q), v, b, k, sh, gm, v - b, b - k))
print(" expected billed months in %d: %.2f; discounted payback month %d; gm / billing %.3f"
% (c["horizon"], res["life"], res["payback"], res["gm_share"]))
print(" lifetime gross margin after setup %.2f; client discounted net gain %.2f"
% (res["lgm"], res["client_pv"]))
print(" rounded lgm RM {:,.0f}; at constant churn {:.4f}: RM {:,.0f}; team RM {:,} over {:,} hours"
.format(res["lgm"], c["alpha"] / (c["alpha"] + c["beta"]), const_churn_lgm(c),
c["team_cost"], c["team_hours"]))
done.append((name, res))
print("fingerprint", fingerprint(done))
if __name__ == "__main__":
main()Single source and citation
Fan, Y. (2026). Hosted-Platform Retainers, Value-Anchored Revenue-Share Hybrids and Customer Lifetime Gross-Margin Lock-In (Version 0.1.0), Chapter 7: The Hosting Playbook: Four Kinds of Client and the Hosting-Contract Calculator. 5D Library. DOI pending
DOI pending · monograph page goes live after publication · 5DL-B-135 · v0.1.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026135,
author = {Fan, Yafu},
title = {Hosted-Platform Retainers, Value-Anchored Revenue-Share Hybrids and Customer Lifetime Gross-Margin Lock-In},
year = {2026},
publisher = {5D Library},
edition = {0.1.0},
note = {DOI pending}
}Other chapter answers in this book
- Chapter 1 · Method: Three Ways to Misprice Hosting, the Value Anchor and the Two-Part Contract
- Chapter 2 · Value Anchoring: Team Hours Saved, Errors Avoided and Growth Absorbed
- Chapter 3 · Two-Part Tariffs: Base Fees, Usage Pricing, Tiers and Caps
- Chapter 4 · Revenue Sharing and Tiered Excess Shares: Floors, Caps, and the Arithmetic of Aligned and Misaligned Incentives
- Chapter 5 · Customer Lifetime Gross Margin: sBG Retention, Cohort Accounting, Discounting and Acquisition Payback
- Chapter 6 · Contract Risk: Service Levels, Minimum Terms, Exit, Price Adjustment and Disputes
- Chapter 8 · Practice: Bridgecalc Designs a Three-Tier Contract for Lanyu