Imported from roycoprotocol/royco-simulator (
AGENTS.md). Install upstream withnpx skills add roycoprotocol/royco-simulator. Copyright stays with the author.
Simulator template rules
Read docs/NEW_SIMULATOR.md before creating or editing a Dawn simulator.
Read docs/NEW_DAY_SIMULATOR.md before creating or editing the Day simulator.
Non-negotiable boundaries
- Never duplicate or rewrite the accountant, waterfall, coverage, NAV, observation, or YDM math. All simulator accounting must flow through
lib/try/engine.tsandlib/try/backtest.ts. - Never copy and modify the simulator page or its CSS for a new market. New markets use
components/simulator/MarketSimulator.tsxandSimulatorPageShell.tsxunchanged. - Never replace locked descriptions. Standard section text lives in
lib/simulator-template/locked-copy.tsand must remain exact unless the template itself is intentionally revised for every simulator. - Market-specific work belongs in
lib/markets/<market-id>/market.json,series.json,market.ts, and the small route generated underapp/<market-id>-sim/page.tsx. - Market folders may not contain CSS or React components.
- Never invent data provenance, fee treatment, asset history, launch dates, or production integration details. Use
unknownand fail verification when information is missing. - Run
npm run sim:verify -- <market-id>andnpm run sim:certify -- <market-id>before requesting publication. - Do not create or merge a PR while any data, math, copy, design, test, lint, or build check is failing.
Shared-file changes
Changes to lib/try/engine.ts, lib/try/backtest.ts, components/simulator/, or lib/simulator-template/ are template changes affecting every market. They require the full repository test, parity, lint, build, and visual review—not merely a market verification.
Day boundary
- A new Day market is a factory operation. Run
npm run day-sim:new; then edit onlylib/day-markets/<market-id>/market.json. - Market-specific presentation changes must be declared in
market.jsonundercustomization, explicitly authorized by the user, supported by the shared customization schema, and reported by verification. Never add market-local React or CSS. - Day accounting flows through
lib/day/engineandlib/day-simulator-template/runtime.ts. Never copy formulas into UI, routes, market files, calibration, or reports. - Every public Day route must use
StrictDaySimulatorPageShell. It may not pass variants, classes, styles, copy, or custom children. - Pareto FalconX v3 is the grounded default. Fonts, colors, borders, spacing, charts, diagrams, and behavior remain shared and byte-locked; an authorized market may use supported section-visibility or copy overrides without forking the component.
- Never guess provenance, price type, fee treatment, desired yield ranges, hidden parameters, or customization authority. Incomplete intake must remain
unknownand fail verification. - Calibrate with
npm run day-sim:calibrate -- <market-id>; never calculate tranche outputs independently. - Run
npm run day-sim:verify -- <market-id>andnpm run day-sim:certify -- <market-id>before requesting publication. Certification must pass all 78 Solidity vectors, tests, lint, and build. - If an explicitly authorized customization is not yet supported, extend the shared manifest-driven customization schema with tests; do not create a one-off market component. Updating the template lock is a maintainer action after full certification.
- Do not create or merge a PR until verification and certification pass and the user approves the browser preview.
- Erasure annotations consume the accountant's structured erased amount and pre-refill Junior valuation. Never parse event copy or size erasure against a same-timestamp refill.