"""Is the plateau pick (fewest median trades to first payout, ties to larger E[W]) the funded risk the wallet would choose?  Wallet e_log_growth(80%) by funded risk,
common random numbers, 3 seeds x 5,000 paths, deployed cell otherwise (random side, swap, wait 7, $1,000, 541 trades)."""
import numpy as np
from wallet_variants import *
T3=PA.Tier(3000,38,51); G0=PA.cost_share(34.791728647093755)+0.004783927673690548
for rf in (0.0115,0.0130,0.0145,0.01575,0.0170,0.0185,0.0200,0.0230):
    out=[]
    for seed in (13,14,15):
        w,ru,pu=wallet_var(T3,0.03,G0*0.03,0.7,0.8,1000,horizon_days=541,n=5000,seed=seed,funded_risk=rf,funded_cost=G0*rf,wait=7)
        out.append(glog(w,1000)[0])
    f=PA.funded_chain(rf,G0*rf,PA.payout_threshold(rf,1.0,3000,0.7),rr=1.0,clip_dn=True,wait=7)
    print(f"rf {rf:.4%}: e_log_growth {np.round(out,4)} mean {np.mean(out):+.4f} | chain p_any {f['p_any']:.4f} E[W] {f['e_W']:.4f}",flush=True)
