plan-lab: sponsor leg, entry split, Fast Start switches; builders vs join-and-pay mix; 0 ladder
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
+52
-10
@@ -3,11 +3,14 @@
|
||||
// ── the plan: width, ladder, gap rule ──
|
||||
// unq: what a pass-up does at an unqualified member ('skip' = passes over them; 'licence' = buys their next licence, never cash)
|
||||
// wm: cash watermark. A member who qualifies late is paid cash only by their own directs and by positions created after they qualified.
|
||||
const PLAN = { w: 4, maxL: 8, shape: 'stepped', steps: [10,20,50,100,175,300,500,750], gap: 'fund', unq: 'licence', wm: true,
|
||||
const PLAN = { w: 4, maxL: 8, shape: 'stepped', steps: [20,40,75,125,200,300,500,750], gap: 'fund', unq: 'licence', wm: true,
|
||||
// placeholder products, one per level, until the real ones exist (Marty, 27 Sep): edit in the plan row
|
||||
place: 'spread', // DECIDED 28 Sep: spillover placement: 'shallow' = shallowest open slot; 'spread' = the position with the fewest under it first (then shallowest)
|
||||
zero: false, // cash with no recruits: false = entries only; true = entries + level-2 cash from your own depth 1
|
||||
split: 0.5, // entry split: this share of the net entry to the placement upline, the rest to the recruiter (decided 27 Sep)
|
||||
split: 0.25, // entry split: this share of the net entry to the placement upline, the rest to the recruiter (PROPOSED 28 Sep: 25/75, was 50/50)
|
||||
sponsor: 0.5, // PROPOSED 28 Sep: this share of every level purchase follows the SPONSOR line (the recruiter, their recruiter...). The rest takes the depth/reach route
|
||||
fsTake: 0.20, // Fast Start: share of new joins who buy levels 2..fsLevels on the day they join (uptake is a guess; drag it)
|
||||
fsLevels: 3,
|
||||
half: true, // one-direct half step: one recruit unlocks cash from depths 1-2 (levels 2-3); two recruits unlock full reach
|
||||
fee: 0.20, // admin fee, OUT of every price, to a receiver wallet in the same block (Marty, 27 Sep: 20%, same as InstantAdPay). The other 80% climbs.
|
||||
products: ['Widget 1','Widget 2','Widget 3','Widget 4','Widget 5','Widget 6','Widget 7','Widget 8'] };
|
||||
@@ -569,7 +572,7 @@
|
||||
let rnd = mulberry32(7);
|
||||
function mulberry32(a){ return function(){ a |= 0; a = a + 0x6D2B79F5 | 0; let t = Math.imul(a ^ a >>> 15, 1 | a); t = t + Math.imul(t ^ t >>> 7, 61 | t) ^ t; return ((t ^ t >>> 14) >>> 0) / 4294967296; }; }
|
||||
function gAdd(parent, recruiter, month){
|
||||
const m = { id: G.nextId++, parent, kids: [], depth: parent ? parent.depth + 1 : 0, level: 1, directs: 0, recruiter, cash: 0, entry: 0, lic: 0, licV: 0, cashFrom: 0, cashFromHalf: 0, month };
|
||||
const m = { id: G.nextId++, parent, kids: [], depth: parent ? parent.depth + 1 : 0, level: 1, directs: 0, recruiter, cash: 0, entry: 0, lic: 0, licV: 0, cashFrom: 0, cashFromHalf: 0, month, m0: 0, mDirects: 0, sp: 0 };
|
||||
G.members.push(m); if (parent) parent.kids.push(m);
|
||||
return m;
|
||||
}
|
||||
@@ -593,12 +596,13 @@
|
||||
}
|
||||
const parent = gSlot(recruiter);
|
||||
const m = gAdd(parent, recruiter, month); m.unsponsored = !!unsponsored;
|
||||
recruiter.directs++; if (recruiter.directs === 1) recruiter.cashFromHalf = m.id; if (recruiter.directs === 2) recruiter.cashFrom = m.id;
|
||||
recruiter.directs++; recruiter.mDirects++; if (recruiter.directs === 1) recruiter.cashFromHalf = m.id; if (recruiter.directs === 2) recruiter.cashFrom = m.id;
|
||||
const gross = price(1), fee = gross * PLAN.fee, n = gross - fee;
|
||||
G.aud.spent += gross; G.aud.entryFee += fee; G.aud.received += fee;
|
||||
const toRec = n * (1 - PLAN.split), toUp = n * PLAN.split;
|
||||
recruiter.entry += toRec; parent.entry += toUp; G.aud.received += n;
|
||||
G.mon.in += gross; G.mon.admin += fee; G.mon.joins++; if (unsponsored) G.mon.assigned++;
|
||||
if (month > 0 && PLAN.fsTake > 0 && rnd() < PLAN.fsTake) for (let L = 2; L <= Math.min(PLAN.fsLevels, PLAN.maxL); L++) gBuy(m, L); // Fast Start at join
|
||||
return m;
|
||||
}
|
||||
function gCashOk(u, origin, L){
|
||||
@@ -608,6 +612,30 @@
|
||||
if (PLAN.zero && L <= 2) return true; // level-2 money from your own depth 1 needs no recruits
|
||||
return false;
|
||||
}
|
||||
// The sponsor leg: a share of every level purchase follows the recruiter line (your sponsor, their sponsor...),
|
||||
// not the placement line. Cash to the first one who holds the level and may take cash; a licence for one who is
|
||||
// behind, only when the money covers it; otherwise it climbs as cash-only. Never a licence from money that is short.
|
||||
function gRouteS(from, L, rem, origin){
|
||||
let cur = from.recruiter;
|
||||
while (cur) {
|
||||
if (cur.level >= L) { if (gCashOk(cur, origin, L)) return { to: cur, kind: 'cash' }; }
|
||||
else if (!rem) { const licOk = cur.directs >= 2 || PLAN.unq === 'licence'; if (licOk) return { to: cur, kind: 'lic' }; }
|
||||
cur = cur.recruiter;
|
||||
}
|
||||
return { to: null };
|
||||
}
|
||||
function gPayS(from, L, amt, origin, rem){
|
||||
let r = gRouteS(from, L, rem, origin);
|
||||
if (r.to && r.kind === 'lic' && amt < net(r.to.level + 1) - 0.005) r = gRouteS(from, L, true, origin);
|
||||
if (!r.to) { G.aud.above += amt; G.aud.received += amt; G.mon.above += amt; return; }
|
||||
if (r.kind === 'cash') { r.to.cash += amt; r.to.sp += amt; G.mon.sp += amt; G.aud.received += amt; return; }
|
||||
const n = r.to.level + 1, cost = net(n);
|
||||
r.to.level = n; r.to.lic++; r.to.licV += cost; G.mon.lics++;
|
||||
gFlow(r.to, n, cost, origin);
|
||||
if (amt - cost > 0.005) gPayS(r.to, L, amt - cost, origin, true);
|
||||
}
|
||||
// every purchase, paid or licence, splits the same way: sponsor leg first, the rest by depth
|
||||
function gFlow(m, L, amt, origin){ const sp = amt * PLAN.sponsor; if (sp > 0) gPayS(m, L, sp, origin, false); gPay(m, L, amt - sp, L - 2, origin, false); }
|
||||
function gRoute(from, L, skipN, rem, origin){
|
||||
let cur = from.parent; for (let i = 0; i < skipN && cur; i++) cur = cur.parent;
|
||||
while (cur) {
|
||||
@@ -618,16 +646,17 @@
|
||||
return { to: null };
|
||||
}
|
||||
function gPay(from, L, amt, skipN, origin, rem){
|
||||
const r = gRoute(from, L, skipN, rem, origin);
|
||||
let r = gRoute(from, L, skipN, rem, origin);
|
||||
if (r.to && r.kind === 'lic' && amt < net(r.to.level + 1) - 0.005) r = gRoute(from, L, skipN, true, origin); // short money never buys a licence; it climbs as cash
|
||||
if (!r.to) { G.aud.above += amt; G.aud.received += amt; G.mon.above += amt; return; }
|
||||
if (r.kind === 'cash') { r.to.cash += amt; G.aud.received += amt; return; }
|
||||
const n = r.to.level + 1, cost = net(n);
|
||||
r.to.level = n; r.to.lic++; r.to.licV += cost; G.mon.lics++;
|
||||
gPay(r.to, n, cost, n - 2, origin, false);
|
||||
gFlow(r.to, n, cost, origin);
|
||||
if (amt - cost > 0.005) gPay(r.to, L, amt - cost, 0, origin, true);
|
||||
}
|
||||
function gBuy(m, L){ m.bought = (m.bought || 0) + 1; const gross = price(L), fee = gross * PLAN.fee; G.aud.spent += gross; G.aud.admin += fee; G.aud.received += fee; G.mon.in += gross; G.mon.admin += fee; G.mon.buys++; m.level = Math.max(m.level, L); gPay(m, L, gross - fee, L - 2, m, false); }
|
||||
function gNewMonth(){ G.mon = { in: 0, admin: 0, joins: 0, assigned: 0, buys: 0, lics: 0, above: 0 }; }
|
||||
function gBuy(m, L){ m.bought = (m.bought || 0) + 1; const gross = price(L), fee = gross * PLAN.fee; G.aud.spent += gross; G.aud.admin += fee; G.aud.received += fee; G.mon.in += gross; G.mon.admin += fee; G.mon.buys++; m.level = Math.max(m.level, L); gFlow(m, L, gross - fee, m); }
|
||||
function gNewMonth(){ G.mon = { in: 0, admin: 0, joins: 0, assigned: 0, buys: 0, lics: 0, above: 0, sp: 0 }; for (const m of G.members) { m.m0 = m.cash + m.entry; m.mDirects = 0; } }
|
||||
function gReset(){
|
||||
rnd = mulberry32(7);
|
||||
G = { month: 0, members: [], nextId: 1, you: null, rows: [], aud: { spent: 0, received: 0, admin: 0, entryFee: 0, above: 0 } };
|
||||
@@ -652,7 +681,13 @@
|
||||
}
|
||||
function gSnap(month){
|
||||
const ms = G.members.filter(x => x !== G.you);
|
||||
return { month, joins: G.mon.joins, assigned: G.mon.assigned, buys: G.mon.buys, lics: G.mon.lics, members: ms.length, in: G.mon.in, admin: G.mon.admin, above: G.mon.above,
|
||||
const grp = f => { const g = ms.filter(f), v = g.map(x => x.cash + x.entry).sort((a, b) => b - a); return { n: g.length, paid: g.filter(x => x.cash + x.entry > 0).length, total: v.reduce((a, b) => a + b, 0), median: v.length ? v[Math.floor(v.length / 2)] : 0, top: v[0] || 0, lic: g.reduce((a, x) => a + x.lic, 0) }; };
|
||||
let topB = null; for (const x of ms) if (!topB || x.mDirects > topB.mDirects) topB = x;
|
||||
const b20 = ms.filter(x => x.mDirects >= 20);
|
||||
const extra = { sp: G.mon.sp, heavy: grp(x => x.directs >= 10), light: grp(x => x.directs >= 1 && x.directs < 10), passive: grp(x => x.directs === 0),
|
||||
top: topB && topB.mDirects > 0 ? { id: topB.id, n: topB.mDirects, m: topB.cash + topB.entry - topB.m0, total: topB.cash + topB.entry, level: topB.level, directs: topB.directs } : null,
|
||||
b20: { n: b20.length, avg: b20.length ? b20.reduce((a, x) => a + x.cash + x.entry - x.m0, 0) / b20.length : 0 } };
|
||||
return { ...extra, month, joins: G.mon.joins, assigned: G.mon.assigned, buys: G.mon.buys, lics: G.mon.lics, members: ms.length, in: G.mon.in, admin: G.mon.admin, above: G.mon.above,
|
||||
toMembers: ms.reduce((a, x) => a + x.cash + x.entry, 0), toYou: G.you.cash + G.you.entry, youLevel: G.you.level, youLic: G.you.lic,
|
||||
paid: ms.filter(x => x.cash + x.entry > 0).length, l2: ms.filter(x => x.level >= 2).length, qualified: ms.filter(x => x.directs >= 2).length };
|
||||
}
|
||||
@@ -680,7 +715,7 @@
|
||||
const s = gSnap(G.month); G.rows.push(s);
|
||||
const prev = G.rows[G.rows.length - 2];
|
||||
const dYou = s.toYou - prev.toYou;
|
||||
storyG('<b>Month ' + G.month + '.</b> ' + cnt(s.joins) + ' joined' + (s.assigned ? ', ' + cnt(s.assigned) + ' of them with no recruiter, assigned to members short of a direct' : '') + '. ' + cnt(s.buys) + ' bought a level with their own money and ' + cnt(s.lics) + ' licences were funded by pass-ups. Money in <b>' + $$(s.in) + '</b>: admin wallet <b>' + $$(s.admin) + '</b>, the rest to members' + (s.above ? ' (' + $$(s.above) + ' climbed past you to the company)' : '') + '. You: <b>' + (dYou >= 0 ? '+' : '') + $$(dYou) + '</b>' + (s.youLevel > prev.youLevel ? ', and your team moved you to <span class="chip lic">level ' + s.youLevel + '</span>' : '') + '. ' + cnt(s.paid) + ' of ' + cnt(s.members) + ' members have been paid something; ' + cnt(s.l2) + ' are past level 1.', s.youLevel > prev.youLevel ? 'lic' : 'cash');
|
||||
storyG('<b>Month ' + G.month + '.</b> ' + cnt(s.joins) + ' joined' + (s.assigned ? ', ' + cnt(s.assigned) + ' of them with no recruiter, assigned to members short of a direct' : '') + '. ' + cnt(s.buys) + ' bought a level with their own money and ' + cnt(s.lics) + ' licences were funded by pass-ups. Money in <b>' + $$(s.in) + '</b>: admin wallet <b>' + $$(s.admin) + '</b>, the rest to members' + (s.above ? ' (' + $$(s.above) + ' climbed past you to the company)' : '') + '. You: <b>' + (dYou >= 0 ? '+' : '') + $$(dYou) + '</b>' + (s.youLevel > prev.youLevel ? ', and your team moved you to <span class="chip lic">level ' + s.youLevel + '</span>' : '') + '. ' + cnt(s.paid) + ' of ' + cnt(s.members) + ' members have been paid something; ' + cnt(s.l2) + ' are past level 1.' + (s.top ? ' <b>Heaviest builder this month:</b> #' + s.top.id + ' brought ' + cnt(s.top.n) + ' and made <b>' + $$(s.top.m) + '</b> this month (' + $$(s.top.total) + ' so far, level ' + s.top.level + ', ' + cnt(s.top.directs) + ' recruits in all).' : '') + (s.b20.n ? ' Builders who brought 20+ this month: ' + cnt(s.b20.n) + ', averaging <b>' + $$(s.b20.avg) + '</b> this month.' : '') + (s.sp ? ' Sponsor leg paid ' + $$(s.sp) + ' this month.' : ''), s.youLevel > prev.youLevel ? 'lic' : 'cash');
|
||||
gRender();
|
||||
}
|
||||
function storyG(html, cls){ const ol = document.getElementById('gStory'); if (!ol) return; const li = document.createElement('li'); if (cls) li.className = cls; li.innerHTML = html; ol.prepend(li); while (ol.children.length > 40) ol.removeChild(ol.lastChild); }
|
||||
@@ -705,6 +740,7 @@
|
||||
sp.innerHTML = 'Top earner in the org: <b>' + $$(ms[0] || 0) + '</b>. Top 10% of members took ' + (all ? Math.round(100 * top10 / all) : 0) + '% of what members received. Median member: <b>' + $$(pct(0.5)) + '</b>. Members with nothing: ' + cnt(ms.filter(v => v <= 0).length) + ' (most of them joined recently).'
|
||||
+ '<br><b>Members in for 6 months or more:</b> ' + cnt(older.length) + ', of whom ' + cnt(olderPaid.length) + ' (' + (older.length ? Math.round(100 * olderPaid.length / older.length) : 0) + '%) have been paid; their median is <b>' + $$(olderMed) + '</b>.'
|
||||
+ '<br><b>Product without paying:</b> ' + cnt(carried) + ' members hold level 2 or higher purely from licences their team funded; ' + cnt(ownBuy) + ' bought at least one level themselves.'
|
||||
+ (() => { const s0 = G.rows[G.rows.length - 1]; const line = (name, g) => '<br><b>' + name + ':</b> ' + cnt(g.n) + ' members, ' + cnt(g.paid) + ' paid (' + (g.n ? Math.round(100 * g.paid / g.n) : 0) + '%), median <b>' + $$(g.median) + '</b>, top ' + $$(g.top) + ', ' + cnt(g.lic) + ' licences, ' + (all ? Math.round(100 * g.total / all) : 0) + '% of member income'; return '<br><b>The mix.</b>' + line('Builders, 10+ recruits', s0.heavy) + line('Light builders, 1 to 9', s0.light) + line('Join-and-pay members, no recruits', s0.passive); })()
|
||||
+ '<br>Levels held: ' + Object.keys(lv).map(Number).sort((a, b) => a - b).map(L => 'L' + L + ' ' + cnt(lv[L])).join(' \u00b7 ') + '.';
|
||||
}
|
||||
}
|
||||
@@ -737,6 +773,9 @@
|
||||
document.getElementById('plSpread').setAttribute('aria-pressed', String(PLAN.place === 'spread'));
|
||||
document.getElementById('zeroOff').setAttribute('aria-pressed', String(!PLAN.zero));
|
||||
document.getElementById('zeroOn').setAttribute('aria-pressed', String(PLAN.zero));
|
||||
for (const [id, v] of [['sp0', 0], ['sp30', 0.3], ['sp50', 0.5]]) document.getElementById(id).setAttribute('aria-pressed', String(PLAN.sponsor === v));
|
||||
for (const [id, v] of [['en50', 0.5], ['en75', 0.25], ['en100', 0]]) document.getElementById(id).setAttribute('aria-pressed', String(PLAN.split === v));
|
||||
for (const [id, v] of [['fs0', 0], ['fs10', 0.1], ['fs20', 0.2], ['fs35', 0.35]]) document.getElementById(id).setAttribute('aria-pressed', String(PLAN.fsTake === v));
|
||||
document.getElementById('halfOff').setAttribute('aria-pressed', String(!PLAN.half));
|
||||
document.getElementById('halfOn').setAttribute('aria-pressed', String(PLAN.half));
|
||||
document.getElementById('wmOff').setAttribute('aria-pressed', String(!PLAN.wm));
|
||||
@@ -759,6 +798,9 @@
|
||||
document.getElementById('plSpread').addEventListener('click', () => { PLAN.place = 'spread'; applyPlan(); });
|
||||
document.getElementById('zeroOff').addEventListener('click', () => { PLAN.zero = false; applyPlan(); });
|
||||
document.getElementById('zeroOn').addEventListener('click', () => { PLAN.zero = true; applyPlan(); });
|
||||
for (const [id, v] of [['sp0', 0], ['sp30', 0.3], ['sp50', 0.5]]) document.getElementById(id).addEventListener('click', () => { PLAN.sponsor = v; applyPlan(); });
|
||||
for (const [id, v] of [['en50', 0.5], ['en75', 0.25], ['en100', 0]]) document.getElementById(id).addEventListener('click', () => { PLAN.split = v; applyPlan(); });
|
||||
for (const [id, v] of [['fs0', 0], ['fs10', 0.1], ['fs20', 0.2], ['fs35', 0.35]]) document.getElementById(id).addEventListener('click', () => { PLAN.fsTake = v; applyPlan(); });
|
||||
document.getElementById('halfOff').addEventListener('click', () => { PLAN.half = false; applyPlan(); });
|
||||
document.getElementById('halfOn').addEventListener('click', () => { PLAN.half = true; applyPlan(); });
|
||||
document.getElementById('wmOff').addEventListener('click', () => { PLAN.wm = false; applyPlan(); });
|
||||
|
||||
Reference in New Issue
Block a user