Merge pull request 'fix: feat: LLM seed — Balanced Adaptive optimizer (#676)' (#965) from fix/issue-676 into master

This commit is contained in:
johba 2026-03-18 16:25:40 +01:00
commit b30e3a8d51
2 changed files with 79 additions and 0 deletions

View file

@ -0,0 +1,78 @@
;; llm_balanced.push3 — Balanced Adaptive Optimizer
;;
;; Strategy: "steady hand, no extreme positions."
;;
;; Philosophy:
;; All outputs stay in a balanced mid-range and scale gradually with inputs.
;; No hard branches, no extreme allocations — "good enough at everything."
;;
;; anchorShare = 40% + percentageStaked * 20% / 1e18 (40%..60%)
;; anchorWidth = 10 + taxRate * 190 / 1e18 (10..200 ticks)
;; discoveryDepth = 30% + percentageStaked * 20% / 1e18 (30%..50%)
;; ci = 0
;;
;; Inputs on DYADIC stack (slot 0 on top, slot 7 at bottom):
;; [0] percentageStaked (0..1e18, where 1e18 = 100%)
;; [1] averageTaxRate (0..1e18)
;; [2-7] reserved/future (0 if unavailable)
;;
;; Outputs (DYADIC stack at termination, bottom to top):
;; discoveryDepth (bottom)
;; anchorWidth
;; anchorShare
;; ci (top)
;;
;; Example values:
;; 0% staked, 0% tax: DD=30%, AW=10, AS=40%, CI=0
;; 50% staked, 50% tax: DD=40%, AW=105, AS=50%, CI=0
;; 100% staked, 100% tax: DD=50%, AW=200, AS=60%, CI=0
;;
;; Notes:
;; - Floor always gets 40-60% of ETH (complement of anchorShare).
;; - No EXEC.IF used — all transitions are arithmetic-only.
(
;; Step 1: Bind slot 0 (percentageStaked) and slot 1 (averageTaxRate).
PERCENTAGESTAKED DYADIC.DEFINE
;; Stack: [slot7, slot6, slot5, slot4, slot3, slot2, slot1]
TAXRATE DYADIC.DEFINE
;; Stack: [slot7, slot6, slot5, slot4, slot3, slot2]
;; Step 2: Discard unused inputs (slots 2-7) — 6 pops.
DYADIC.POP
DYADIC.POP
DYADIC.POP
DYADIC.POP
DYADIC.POP
DYADIC.POP
;; Stack: []
;; Step 3: Push discoveryDepth = 300000000000000000 + percentageStaked * 200000000000000000 / 1e18
;; Moderate exposure: ranges 30%..50%. Always some upside, never speculative excess.
PERCENTAGESTAKED
200000000000000000 DYADIC.*
1000000000000000000 DYADIC./
300000000000000000 DYADIC.+
;; Stack: [discoveryDepth]
;; Step 4: Push anchorWidth = 10 + taxRate * 190 / 1e18 (ticks: 10..200)
;; Low tax (stable market) → tight anchor bands (10 ticks).
;; High tax (volatile market) → wide anchor bands (200 ticks).
TAXRATE
190 DYADIC.*
1000000000000000000 DYADIC./
10 DYADIC.+
;; Stack: [discoveryDepth, anchorWidth]
;; Step 5: Push anchorShare = 400000000000000000 + percentageStaked * 200000000000000000 / 1e18
;; Balanced: ranges 40%..60%. Floor always gets the complement (40%..60%).
PERCENTAGESTAKED
200000000000000000 DYADIC.*
1000000000000000000 DYADIC./
400000000000000000 DYADIC.+
;; Stack: [discoveryDepth, anchorWidth, anchorShare]
;; Step 6: Push ci = 0 (no VWAP bias on floor placement).
0
;; Stack: [discoveryDepth, anchorWidth, anchorShare, ci=0]
)

View file

@ -6,3 +6,4 @@
{"file":"llm_contrarian.push3","fitness":null,"origin":"llm","run":null,"generation":null,"date":"2026-03-13","note":"Contrarian optimizer — bets against consensus. High staking = bearish, low staking = bullish."}
{"file":"evo_run007_champion.push3","fitness":null,"origin":"evolved","run":"007","generation":24,"date":"2026-03-14","note":"Run 7 champion. Unbounded AW, 500k gas, IL crystallization attack. When staked<=88%: CI=0, AW=153, AS=20%, DD=20%. When staked>88%: bear defaults (all zero). Fitness nulled for re-evaluation after processExecIf branching fix (#655)."}
{"file":"evo_run008_champion.push3","fitness":6023051186447921487286,"origin":"evolved","run":"008","generation":0,"date":"2026-03-14","note":"Run 8 champion. First run with TWAP-enforced recenter (#713). 29-tier tax rate thresholds with delta-cubed scaling. When staked>80% and low tax: CI=0, AW=20, AS=100%, DD=100%. High tax: CI=0, AW=100, AS=30%, DD=30%. Staked<=80%: bear defaults (CI=0, AW=100, AS=30%, DD=30%)."}
{"file":"llm_balanced.push3","fitness":null,"origin":"llm","run":null,"generation":null,"date":"2026-03-18","note":"Balanced Adaptive: no branching, all outputs scale arithmetically. anchorShare=40-60% (floor always gets complement), anchorWidth=10-200 ticks linear with taxRate, discoveryDepth=30-50% linear with percentageStaked, ci=0."}