# The optimization and inference method for the Prime Academy strategy

Synthesised from three arena candidates (base: candidate-3, GPT; grafts from candidate-1, Opus,
and candidate-2, Fable; see SYNTHESIS.md). Every number recomputed by the picker from
`modules/prime.py` at the deployed stop's mean of 34.8 pips, floor on the tick, target clipped.

## The answer in one paragraph

The optimum is not gridded and not read off a derivative. Calculus settles the structure: the
two stages separate, the assessment risk is a corner at the 35% cap, the funded payout chance
has a kink where the 35% rule takes over from the $100 minimum, and no first-order condition
holds at either. Exact computation settles the value: below the kink the funded payout chance is
a sawtooth whose teeth sit at closed-form positions, so the funded risk needs a fine
one-dimensional line search, and the assessment needs one exact evaluation at the cap. The
history through the broker settles inputs and large model faults, not the optimum: given the win
probability, the cost share and the rule readings, every rate is exact, so the optimum's
uncertainty is the input uncertainty pushed through the chains, and a claim that one cell beats
another is a test of a paired difference in calendar blocks, with the resolution 2.8 years allow.

## 1. Formulation

Variables: reward-to-risk RR and risk per trade r in each stage (u = RR r is the up-step), the
tier B, the number of accounts n. The stop, the window and the side are fixed by the
walk-forward and the swap and enter only through the cost share gamma and the pace.

Objectives, in the operator's order: maximise the funded chance of any payout a; then the
assessment pass rate P; buy only if the wallet's expected log growth is positive at 80% of
payouts honoured, at the measured cost.

Hard constraints, all as inequalities on the variables:

| # | inequality | source |
|---|---|---|
| R1 | r (1 + gamma) <= 0.05 (1 - D): r <= 4.42% at gamma 2.87% | daily loss, from entry |
| R1s | r (1 + gamma) + g r <= 0.05 E_prev, g the overnight floating gain in stops given back: breach needs g > 0.64 at 3%, 0.22 at 4% | daily loss, strict reading (equity-based) |
| R2 | RR r_a <= 0.35 T = 3.15%, gross: commission is charged at the open and a trade lasts two days, so the closing day shows the full win | 35% rule in the assessment (assumed to apply) |
| R3 | payout request M >= max(100 / (alpha B), RR r_f / 0.35) | minimum request and the 35% rule funded |
| R4 | one trade a day; 3 trading days a stage; 14-day clock; step aside on every touched hour; no EA use assumed; no hedging or mirroring | rulebook |
| R5 | the stop leg lands on the floor, the target leg on the target, both net of cost | floor on the tick; the clip |
| T1 | median time to first cash within the operator's tolerance (120 days is the working figure) | operator: "I need money" |
| W1 | fee <= 6% of the wallet; simulated ruin <= 5%; n = 1 until a payout is honoured | wallet, operator |

## 2. What calculus settles, step by step

**The stages separate.** The funded account opens at the nominated balance, so P(cash) =
P(RR_a, r_a) x a(RR_f, r_f) with no variable shared. Each factor is maximised alone.

**A trade's drift and variance.** With cost c = gamma r a trade has mean -gamma r and variance
RR r^2 = u r. The barrier exponent of the diffusion limit is lambda = 2 (gamma r) / (u r) =
2 gamma / u. The risk cancels: every barrier probability depends on the up-step u and the cost
share gamma only.

**The assessment is a corner.** With T = D the pass rate is P = 1 / (1 + e^{lambda D}), and

    dP/du = P (1 - P) 2 gamma D / u^2 > 0

for every gamma > 0. P rises with u until a constraint stops it, so u_a goes to the tightest cap.
R2 binds before R1 whenever RR >= 0.73, so u_a* = 3.15% (gross). The cap's shadow price is 0.13
points of pass rate per 0.1% of risk (chain: 45.38% at 3.00%, 45.57% at 3.15%). Along the cap the
split into RR and r barely moves P (chain: 45.50%, 45.57%, 45.69%, 45.83% at RR 0.75, 1, 1.5, 3),
so RR is settled by what the diffusion omits: time (a trade lasts RR times longer with the stop
fixed) and verifiability (only at RR 1 is a random-side trade an exact coin; off RR 1 the broker's
brackets read about a point under fair). RR_a = 1.

**The funded chance of any payout has a kink.** With M the request threshold,

    a = (e^{lambda D} - 1) / (e^{lambda (D + M)} - 1),   M = max(m_1, u / 0.35),   m_1 = 100 / (alpha B).

Below u = 0.35 m_1 the threshold is fixed at m_1; lambda falls as u rises, and a rises. Above it
M = u / 0.35, so lambda M = 2 gamma / 0.35 is a constant kappa; writing A = e^{lambda D},
a = (A - 1) / (A e^kappa - 1), whose derivative in A is (e^kappa - 1) / (A e^kappa - 1)^2 > 0, and
A falls as u rises, so a falls. The maximum is the kink u_f* = 0.35 m_1 = 1.667% on the $3,000
tier, for any gamma > 0, and no derivative is zero there. This qualifies the paper's Proposition
"the distribution cap sets the cash frequency", which states a decreasing in u without the
lower branch.

**At a fixed up-step the diffusion limit is blind to RR.** The exact chain is not: the 14-trade
clock and the discrete steps favour a smaller loss leg, so at u = 1.6% the chain reads 37%, 43%,
45%, 47%, 48% at RR 0.5, 1, 1.5, 2, 3. The gain is bought with time: the first payout moves from
17 trades at RR 1 to 31 at RR 3, and a trade at RR 3 lasts 3.5 days against 2.0. Constraint T1
returns RR_f to 1.

**The rest are corners.** The tier is the largest whose fee is at most 6% of the wallet with ruin
at most 5%: $3,000 at $1,000 (the fee is 3.8%, slack; the next tier's 9.9% is out). n = 1 by W1.

## 3. What must be computed exactly

**The sawtooth.** A payout is allowed after n trades when the net wins clear the request. With j
the excess of wins over losses needed, the request clears when j r (1 - gamma) minus the losses'
cost reaches m_1, which puts a tooth of a(r) at

    r_edge(j, n) = m_1 / (j - n gamma).

At n = 14, j = 4, gamma = 2.87%: 1.324%. The chain jumps from 51.5% at 1.30% to 52.7% at 1.35%,
and the formula predicts every jump the line search finds at other costs (1.253%, 1.349%,
1.413%, 1.555% at gamma 1.44%, 3.35%, 4.5%, 6.7%).

**The procedure.**
1. Assessment: one exact evaluation at the cap, and at the cap less a margin. A grid wastes every
   cell above the cap; a root find has nothing to find.
2. Funded: a line search in r_f at RR 1 over [0.6%, 2.0%] in 0.01% steps (140 chain calls, under
   a minute), with the lattice unit checked at c/40 and c/80, per cost scenario (gamma 1.44%,
   2.87%, 3.35%, 4.5%, 6.7%) and per clock (14 trades; 7 trades if the clock proves to be calendar
   days). Report the plateau (cells within one point of the maximum), not the argmax alone: the
   argmax wanders from 0.87% to 1.64% across scenarios, the plateau is stable.
3. The wallet gate: `wallet_mc` at the chosen cell, at 100% and 80% of payouts honoured.
4. The 0.01-lot grid: a floored lot carries 91% to 100% of the nominal risk, so a nominal risk
   just above a tooth trades below it on some days; keep the pick inside a tooth, not on its edge.

A half-point grid straddles the teeth (the 1.10% to 1.45% plateau has no half-point member but
1.5%). A root find or golden section stops at one tooth.

## 4. Inference

**Where the uncertainty is.** Given p, gamma and the readings, the chain is exact. The optimum
has no sampling error. What the data resolve are inputs: the pace (2.03 +/- 0.01 days a trade),
the aside rate (1.33 +/- 0.05 a trade), the cost share at the measured spread, and any edge.
Sensitivity, an edge epsilon entering the drift as 2 epsilon r, so one point of win rate equals
two points of cost share:

| epsilon | gamma_eff | P (3%) | a (1.5%) | cash / fee |
|---|---|---|---|---|
| -2 pt | 6.87% | 39.1% | 41.2% | 0.94 |
| -1 pt | 4.87% | 42.2% | 47.4% | 1.26 |
| 0 | 2.87% | 45.4% | 52.4% | 1.67 |
| +1 pt | 0.87% | 48.6% | 56.4% | 2.20 |

**What 2.8 years cannot resolve.** An edge at the scale that matters: 467 deployed closes give
the win rate a standard error of 2.3 points; 80% power against one point needs about 19,600
trades. Cells within about 2 points of each other on the funded side, and the funded cells at
low risk at all (4 blocks of twice the account span). Zero edge is imposed, not measured.

**How "A beats B" is tested, declared before any number.** Pair the two cells on the same price
path, seeds and account cycling. Cut the calendar into blocks at least twice the longer account
span; require at least ten. With S_k and N_k the successes and completed accounts in block k,
the pooled rates are sums over blocks, and the difference Delta has standard error s_Delta from
the block-to-block spread of the paired influence contributions, divided by the square root of
the block count. Null: Delta <= Delta_0, where Delta_0 is the chains' own difference run under
the broker's protocol (the same trades per replay, the open account dropped), because the
protocol biases long-lived funded cells by up to 24 points. Reject if (Delta_hat - Delta_0) >
2 s_Delta. Planning power at the assessment's block error of 1.7 points: 50% against 3.4 points,
83% against 5, 94% against 6; so 3% against 4% in the assessment (0.86 points) is not resolvable
and rests on the rule reading alone, while the funded ridge (1.5% against 4%, about 21 points)
is. When a difference keeps its sign over the whole input region of the sensitivity table, the
chain settles it and no replay adds to it; when it flips, the measurement that pins the flipping
input settles it (1.5% against 1% funded flips at a spread near 0.33 pip).

**Declared model checks, not superiority tests.** The broker's coin side against the chains'
model under the broker's protocol at the two chosen cells, within 2 block standard errors; and
the short-side win rate within 2 standard errors of one half (an alarm, weak by construction).

## 5. Worked application

| variable | method | current pick | constraint status |
|---|---|---|---|
| RR, both stages | 1 | 1 | time and verifiability |
| assessment risk | 3.0% | 3.0% | R2 binds at 3.15% gross; 3.0% holds 0.15% under it (0.19 points, 1.7 pips); R1 slack; R1s unmeasured |
| funded risk | 1.5% | 1.5% | upper edge of the 1.1%-1.5% plateau, chosen for the earlier first payout (18 trades against 23 at 1.1%); m_1 binding, the funded 35% slack |
| tier, accounts | $3,000, 1 | same | W1 slack at 3.8%; the next tier is out |
| purchase | none until the gate opens | same | at the measured 1.33 asides and 0.5 pip the cost share is 6.7%, cash per fee 0.97, growth negative |

At the paper's cost (2.87%): pass 45.38%, any payout 52.36%, 1.10 payouts, 6.66% withdrawn,
P(cash) 23.8%, cash 1.67 times the fee, wallet growth +0.17 at full honour and about zero at 80%.

**Corrections to the current reading.** The cap is 3.15% gross, not the 3.24% net arithmetic
allows. The 1.7-pip margin under the cap does not cover a weekend gap (median 9 pips), and a
favourable gap through the target fills better than the target at a real venue, so a win can
exceed the cap: confirm the venue's fill rule or go flat before weekends in the assessment. Above
a cost share of 3.6% the plateau's top moves to 1.6%.

## What none of this sees

The spread and swap in the broker; the equity between completed trades (R1s); whether the firm
pays; whether many small payouts read as trading. The RR 3 funded cell is a 5-point gain at the
same up-step that only the exact chain sees and only a longer wait buys.
