pages / example / trading_session
canister coord://offchain/genie/program/trading_session@v1/6ae531fa5b4e6562 · v1 · artifact root 0x6ae531fa5b4e6562b1c1136f48ac78d590f556242660ea4caf4ce4bb5a500b3b · previous none (first version) · superroot at publish not sealed yet
sealed cases that reached it: 0 — sealed cases that reached this word (the store counts, never reads)
trading session (a .genie program) in the studio: 18 symptoms, 18 fixes
// _GENIE_v1_ — one trading session of an agent on the venue (the trading pack): opened by its verb, the market's candles read through // the time compressor, a decision that carries the no-lookahead proof, fills, the receipt graded by System One, settled on the session's // meter; the trading vault is the register's (its caps are the owner's, see the register gaps), so no money moves from this program. genie trading_session v1 about "One trading session: opened, candles compressed and read, a decision under the causality proof, fills, the receipt graded by System One and metered" use venue mcp use product sma.session market.price clob.fill use guard halt-on-failure receipt-check agent session is "one session of a trading agent, opened to receipted" states opened compressed decided filled receipted graded settled refused expired start opened final settled refused expired failed refused expired on lane sessions read GET /v1/market/candles as candles read GET /v1/trading/metrics as metrics move opened -> compressed verb market.candles market BTC-USD compress 1m 4 op GET /v1/market/candles venue mcp meter market.price hop offer_in move compressed -> decided when candles.count > 0 proves causality verb proof.causality op GET /v1/session/:id/proof venue mcp hop classify move decided -> filled when metrics.fills > 0 proves fill market BTC-USD hop delivered move decided -> expired when candles.stale == true move filled -> receipted verb session.receipt op POST /v1/session/:id/receipt venue mcp guard receipt-check meter sma.session hop delivered move receipted -> graded assure 0.7 asks spec_met unsupported_claim ending cheat_shaped proves replay meter sma.session hop graded move receipted -> refused when grade.verdict == "reject" hop graded move graded -> settled guard halt-on-failure meter clob.fill hop settled refuse lookahead "a candle was read after the decision it fed: the receipt is refused" refuse no_caps "the trading vault has no caps in the register; no money moves from this program" say compressed "The window's candles are compressed by the factor before the decision reads them" say receipted "The receipt names the fills, the PnL, the R and the windows read; the proof orders them" next opened compressed "Read the market through the time compressor" next receipted graded "System One grades the receipt against the proof" knowledge symptom "the receipt is refused with lookahead" caused_by "a candle read came after the decision it fed" fixed_by "read the window first, decide after; the proof orders the trace" symptom "the session never settles" caused_by "the trading vault has no caps in the register" fixed_by "the owner sets the vault's caps in the register; until then the session settles on its meter only" symptom "the receipt is graded under 0.7" caused_by "the receipt claims fills the candles do not show" fixed_by "replay the session from its receipt; the fills must match the candles" fix "read the window first, decide after; the proof orders the trace" opens classify fix "the owner sets the vault's caps in the register; until then the session settles on its meter only" opens settled fix "replay the session from its receipt; the fills must match the candles" opens graded // the guided cases (week 2): what a trading agent asks about its sessions, each a door to a hop of the sale symptom "what is a session, how does a trading session work, what is this pack, what is this for" fixed_by "one session of a trading agent: opened, candles compressed and read, a proven decision, fills, a sealed receipt graded and settled" symptom "how do I open a session, start trading, session open, begin a session" fixed_by "session.open names the session key, the markets and the window; one receipt per session" symptom "which markets, what can I trade, supported markets, the markets" fixed_by "the markets are the order book's: BTC-USD, ETH-USD, SOL-USD and the NQ, ES and YM futures" symptom "which windows, candle sizes, timeframes, compress the candles, compression" fixed_by "the windows are 15s, 1m, 5m and 1h candles; a move names the compression factor and the window must be the pack's" symptom "what is proof causality, how is lookahead checked, the no-lookahead proof, causality" fixed_by "proof.causality orders every candle read before the decision it fed; a read after the decision refuses the receipt" symptom "how do I close a session, get a receipt, session receipt, end the session" fixed_by "session.receipt closes the session: fills, PnL, R and the windows read, sealed as a twig" symptom "how do I publish a strategy, strategy publish, sell my strategy, the split" fixed_by "strategy.publish lists the strategy on the venue at the pack's split: seventy to the publisher, thirty to the venue" symptom "what does a session cost, is it metered, price of a session, what am I charged" fixed_by "a session is metered on the products its moves name: the session, the price reads and the fills; the grade decides the settle" symptom "live price, market price, current price, read candles, market candles" fixed_by "market.price reads the live price of a market; market.candles reads a window's candles" fix "one session of a trading agent: opened, candles compressed and read, a proven decision, fills, a sealed receipt graded and settled" is "One session of a trading agent: opened with its key and markets, the candles compressed and read, a decision with its no-lookahead proof, the fills, a receipt sealed as a twig, graded by System One and settled on its meter." opens offer_in fix "session.open names the session key, the markets and the window; one receipt per session" is "session.open names the session key, the markets and the window. One session gives one receipt; the session is metered on the products its moves name." opens hired fix "the markets are the order book's: BTC-USD, ETH-USD, SOL-USD and the NQ, ES and YM futures" is "The markets are the order book's: BTC-USD, ETH-USD and SOL-USD, and the NQ, ES and YM futures. A session names the markets it reads and trades." opens classify fix "the windows are 15s, 1m, 5m and 1h candles; a move names the compression factor and the window must be the pack's" is "The windows are the 15s, 1m, 5m and 1h candles. A move names the compression factor; a window outside the pack is refused by the checker, not at run time." opens classify fix "proof.causality orders every candle read before the decision it fed; a read after the decision refuses the receipt" is "proof.causality orders every candle read before the decision it fed. A read that came after the decision refuses the receipt as lookahead; the replay proof checks the same order from the receipt." opens graded fix "session.receipt closes the session: fills, PnL, R and the windows read, sealed as a twig" is "session.receipt closes the session with its fills, PnL, R and the windows read, sealed as a twig. The receipt is what System One grades and what a replay checks." opens delivered fix "strategy.publish lists the strategy on the venue at the pack's split: seventy to the publisher, thirty to the venue" is "strategy.publish lists the strategy on the venue. The split is the pack's row: seventy to the publisher and thirty to the venue, on every session that runs it." opens listed fix "a session is metered on the products its moves name: the session, the price reads and the fills; the grade decides the settle" is "A session is metered on the products its moves name: the session, the price reads and the fills. The grade of the receipt decides the settle; a refused receipt settles nothing." opens settled fix "market.price reads the live price of a market; market.candles reads a window's candles" is "market.price reads the live price of a market and market.candles reads the candles of a window, compressed by the factor the move names. Both are reads metered on the key." opens classify rule "a decision reads only candles compressed before it; the causality proof is the trace's order" term "R" is "the session's return in units of its risk per trade" door "Run a session" as session product trading-session locale en step opened "Your session is open; its key and markets are set" next compressed opens compressed step compressed "The market's candles are compressed and read" next decided step decided "Your decision carries the no-lookahead proof" next filled step filled "Fills are in; the receipt is next" next receipted step receipted "The receipt is sealed; System One grades it" next graded opens graded step graded "The grade stands; the session settles on its meter" next settled step settled "The session is settled and metered" step refused "The grade did not stand; replay the session" step expired "The candles went stale before a decision" handoff "a dispute over a receipt is a person's case" booking https://cal.com/taifoon meet https://meet.jit.si room genie-trading-session