UNPKG

kestrel.markets

Version:

A typed, token-efficient language + runtime for agentic trading: agents author bounded plans, the runtime fires them at the tick. CLI + typed library + MCP server.

1,660 lines (1,653 loc) 243 kB
import { toProtocolBlotter } from "./bin-cv13fq8c.js"; import { DEFAULT_API, bearerHeader, consumeOperationStream, jsonHeaders, mintTrialCapability, parseValidateDiagnostics, postEffectful } from "./bin-qewrvqtv.js"; import { BACKTEST_CONFIG, cellConfigId, declaresEnvelope, openSession } from "./bin-xx1qrxe3.js"; import { sha256 } from "./bin-8pchjxn2.js"; import { serializeBus } from "./bin-73jr945c.js"; import { PROTOCOL_VERSION, grade, readBus } from "./bin-3ft0k1jq.js"; import { KestrelParseError, decodeOperation, parse } from "./bin-2ywrx58g.js"; // src/sdk/facade.ts var SDK_VERSION = `kestrel.sdk/${PROTOCOL_VERSION}`; function createSdk(transport) { return { transportKind: transport.kind, version: SDK_VERSION, transportVersion: transport.version, catalog: () => transport.catalog(), validate: (document) => transport.validate(document), openSession: (subject, document) => transport.openSession(subject, document), grade: (request) => transport.grade(request), artifact: (ref) => transport.artifact(ref), resumeOperation: (ref) => transport.resumeOperation(ref) }; } // src/catalog/session-catalog.ts import { dirname, join } from "node:path"; import { fileURLToPath } from "node:url"; // src/catalog/catalog-listing.ts class CatalogListingDecodeError extends Error { constructor(message) { super(message); this.name = "CatalogListingDecodeError"; } } function toCatalogListing(f) { return { id: f.id, title: f.title, description: f.description, instrument: f.instrument, period: { start: f.periodStart, end: f.periodEnd }, frameCount: f.frameCount, free: f.free }; } function toCatalogListingWire(l) { return { artifact_id: l.id, title: l.title, description: l.description, instrument: l.instrument, period: { start: l.period.start, end: l.period.end }, frame_count: l.frameCount, free: l.free }; } var WAKE_FRAMES = 2; var LISTING_META = { "choppy-1101-strict": { title: "Choppy intraday — strict-cross fills", description: "A range-bound QQQ intraday session graded under the strict-cross fill model.", instrument: "QQQ", period: { start: "2026-03-02", end: "2026-03-02" }, frameCount: WAKE_FRAMES, free: true }, "spike-1102-maker-fair": { title: "Volatility spike — maker-fair fills", description: "A sharp QQQ intraday volatility spike graded under the maker-fair fill model.", instrument: "QQQ", period: { start: "2026-03-02", end: "2026-03-02" }, frameCount: WAKE_FRAMES, free: true }, "trending-1103-maker-fair": { title: "Trending intraday — maker-fair fills", description: "A directional QQQ intraday trend graded under the maker-fair fill model.", instrument: "QQQ", period: { start: "2026-03-02", end: "2026-03-02" }, frameCount: WAKE_FRAMES, free: true } }; function buildCatalogListing(ids) { return ids.map((id) => { const meta = LISTING_META[id]; if (meta === undefined) { throw new CatalogListingDecodeError(`no LISTING_META for catalog id ${JSON.stringify(id)} — cannot list it`); } return toCatalogListing({ id, title: meta.title, description: meta.description, instrument: meta.instrument, periodStart: meta.period.start, periodEnd: meta.period.end, frameCount: meta.frameCount, free: meta.free }); }); } var isRecord = (v) => typeof v === "object" && v !== null; var str = (v) => typeof v === "string" && v.length > 0 ? v : undefined; function decodeCatalogListingWire(body) { const rows = Array.isArray(body) ? body : isRecord(body) && Array.isArray(body["entries"]) ? body["entries"] : (() => { throw new CatalogListingDecodeError("GET /catalog returned neither a listing array nor a { entries: [...] } wrapper"); })(); return rows.map((row) => { if (!isRecord(row)) throw new CatalogListingDecodeError("a catalog listing row was not an object"); const id = str(row["artifact_id"]) ?? str(row["id"]); if (id === undefined) { throw new CatalogListingDecodeError("a catalog listing row carried neither `artifact_id` nor `id` — unaddressable for openSession"); } const period = isRecord(row["period"]) ? row["period"] : {}; const frameCount = typeof row["frame_count"] === "number" ? row["frame_count"] : typeof row["frameCount"] === "number" ? row["frameCount"] : 0; return toCatalogListing({ id, title: str(row["title"]) ?? "", description: str(row["description"]) ?? "", instrument: str(row["instrument"]) ?? "", periodStart: str(period["start"]) ?? "", periodEnd: str(period["end"]) ?? "", frameCount, free: row["free"] === true }); }); } function decodeCatalogPricing(body) { if (!isRecord(body)) return; const pricing = body["pricing"]; if (!isRecord(pricing)) return; const okScalars = typeof pricing["paid_available"] === "boolean" && typeof pricing["price_sheet_url"] === "string" && typeof pricing["price_sheet_version"] === "string" && typeof pricing["currency"] === "string" && typeof pricing["note"] === "string"; if (!okScalars || !Array.isArray(pricing["skus"]) || !Array.isArray(pricing["settlement_methods"])) { return; } return pricing; } function decodeCatalogPage(body) { const entries = decodeCatalogListingWire(body); const pricing = decodeCatalogPricing(body); return pricing === undefined ? { entries } : { entries, pricing }; } // src/catalog/session-catalog.ts var SESSION_CATALOG_VERSION = "1.1.0"; class SessionCatalogError extends Error { code; constructor(code, message) { super(message); this.name = "SessionCatalogError"; this.code = code; } } var HEX64 = /^[0-9a-f]{64}$/; var SUPPORTED_SCHEMA = `kestrel.session/${PROTOCOL_VERSION}`; var KNOWN_FILL_MODELS = ["strict-cross-v1", "maker-fair-v1"]; function busRoot(events) { return sha256(serializeBus(events)); } function bareRootOf(handle) { const m = /^sha256:([0-9a-f]{64})$/.exec(handle); return m === null ? null : m[1]; } function msgOf(e) { return e instanceof Error ? e.message : String(e); } function fixturePath(tape) { return join(dirname(fileURLToPath(import.meta.url)), "fixtures", tape); } function planDocPin(text) { return `sha256:${sha256(text)}`; } function deriveInputPin(config, planDoc) { if (declaresEnvelope(config)) { return { kind: "agent-authored", config: `sha256:${cellConfigId(config)}` }; } return { kind: "fixed-plan", planDoc: planDocPin(planDoc) }; } function resolvePlanDoc(e) { const pin = e.entry.inputPin; if (pin === undefined || pin.kind !== "fixed-plan") { throw new SessionCatalogError("plan-doc-missing", `entry ${e.id}: no fixed-plan doc to resolve (${pin === undefined ? "no inputPin" : `pin kind ${pin.kind}`})`); } const doc = e.recipe.document; const expected = bareRootOf(pin.planDoc); const actual = sha256(doc); if (expected === null || actual !== expected) { throw new SessionCatalogError("plan-doc-mismatch", `entry ${e.id}: stored plan doc (sha256 ${actual}) does not match pinned ${JSON.stringify(pin.planDoc)}`); } return doc; } function verifyPlanArtifact(e) { const pin = e.entry.inputPin; if (pin === undefined) { throw new SessionCatalogError("plan-doc-missing", `entry ${e.id}: fixed-plan cell carries no input pin — its authored plan doc is unrecoverable (fail closed)`); } if (pin.kind === "fixed-plan") { resolvePlanDoc(e); return; } if (bareRootOf(pin.config) === null) { throw new SessionCatalogError("plan-doc-mismatch", `entry ${e.id}: agent-authored config pin ${JSON.stringify(pin.config)} is not a sha256 content root`); } } function assertEntryValid(e) { if (e.entry.schema !== SUPPORTED_SCHEMA) { throw new SessionCatalogError("unsupported-schema", `entry ${e.id}: schema ${JSON.stringify(e.entry.schema)} is not the supported ${JSON.stringify(SUPPORTED_SCHEMA)}`); } if (!KNOWN_FILL_MODELS.includes(e.entry.permittedFillModel)) { throw new SessionCatalogError("unknown-fill-model", `entry ${e.id}: permittedFillModel ${JSON.stringify(e.entry.permittedFillModel)} is not a known fill model`); } if (!HEX64.test(e.expectedConformanceRoot)) { throw new SessionCatalogError("corrupt-content-root", `entry ${e.id}: expectedConformanceRoot ${JSON.stringify(e.expectedConformanceRoot)} is not a 64-hex sha256`); } if (!e.entry.contentRoots.includes(`sha256:${e.expectedConformanceRoot}`)) { throw new SessionCatalogError("corrupt-content-root", `entry ${e.id}: conformance root sha256:${e.expectedConformanceRoot} is not pinned in entry.contentRoots`); } verifyPlanArtifact(e); } function loadSessionCatalog(manifest = SESSION_CATALOG) { for (const e of manifest.entries) { assertEntryValid(e); resolveTapeEvents(e); } return manifest.entries; } function resolveTapeEvents(e) { let events; try { events = [...readBus(fixturePath(e.tape))]; } catch (err) { throw new SessionCatalogError("corrupt-content-root", `entry ${e.id}: tape ${e.tape} is unreadable (${msgOf(err)})`); } const expected = bareRootOf(e.entry.provenance.source); const actual = busRoot(events); if (expected === null || actual !== expected) { throw new SessionCatalogError("corrupt-content-root", `entry ${e.id}: tape ${e.tape} content root ${actual} does not match pinned ${e.entry.provenance.source}`); } return events; } var RECIPE = { document: ["PLAN atm-rider budget 0.5R ttl +60m", " WHEN phase open", " DO buy 1 atm C @ lean(bid, fair, 0.5)"].join(` `), wakes: [ { hour: 8, minute: 50 }, { hour: 9, minute: 10 } ], rUsd: 1e4, fairTauYears: () => 6.5 / (365 * 24) }; var RECORDED_AT = "2026-07-13T00:00:00.000Z"; var CORPUS_TIER = "public-baseline"; var ENGINE_VERSION = "kestrel-engine/4"; var JUDGE_VERSION = "kestrel-judge/1"; var VIEW_IDENTITY = `sha256:${sha256(`kestrel.view/backtest/${PROTOCOL_VERSION}`)}`; var RENDERING_IDENTITY = `sha256:${sha256(`kestrel.rendering/machine-frame/${PROTOCOL_VERSION}`)}`; function makeEntry(args) { const entry = { id: args.id, contentRoots: [`sha256:${args.tapeRoot}`, `sha256:${args.conformanceRoot}`], schema: SUPPORTED_SCHEMA, corpusTier: CORPUS_TIER, requirements: { engineVersion: ENGINE_VERSION, judgeVersion: JUDGE_VERSION }, permittedFillModel: args.fillModel, viewIdentity: VIEW_IDENTITY, renderingIdentity: RENDERING_IDENTITY, provenance: { source: `sha256:${args.tapeRoot}`, recordedAt: RECORDED_AT }, inputPin: deriveInputPin(BACKTEST_CONFIG, RECIPE.document) }; return { id: args.id, entry, tape: args.tape, recipe: RECIPE, expectedConformanceRoot: args.conformanceRoot }; } var RECIPE_WAKE_COUNT = RECIPE.wakes.length; var SESSION_CATALOG = { version: SESSION_CATALOG_VERSION, entries: [ makeEntry({ id: "choppy-1101-strict", tape: "choppy-1101.jsonl", fillModel: "strict-cross-v1", tapeRoot: "7166b08f3438c8ed6ee23b5e86ae785736f94870207a63051893a00f08b462b1", conformanceRoot: "6b523f157a0810ae97375e2a913906899e04f4f74f79157054d16829079f35d1" }), makeEntry({ id: "spike-1102-maker-fair", tape: "spike-1102.jsonl", fillModel: "maker-fair-v1", tapeRoot: "5b50609e931959aa911b1c576a94d81c0947ff1e0193de8a40054de969baa583", conformanceRoot: "20a1ac0ea1264b3f02449e81ee5d8d31afdd6439d6bc2629e7d56cbdf4bffb5b" }), makeEntry({ id: "trending-1103-maker-fair", tape: "trending-1103.jsonl", fillModel: "maker-fair-v1", tapeRoot: "2528243e6a4b708bf169beffe6352b95e4db0e3374891e0ab78bfee8a7b871f2", conformanceRoot: "fcd23dc97426d2c082e95fc1f86e0ff94fa0c601fd3836c000add10085f494bd" }) ] }; function catalogListing() { return buildCatalogListing(SESSION_CATALOG.entries.map((e) => e.id)); } // src/sdk/local.ts class SdkLocalError extends Error { name = "SdkLocalError"; code; constructor(code, message) { super(message); this.code = code; } } function conformanceRootOf(b) { return b.session.bus.sha256; } function gradeOf(sessionId, b) { return grade([toProtocolBlotter(sessionId, b)]); } function artifactsOf(sessionId, conformanceRoot) { return [`sha256:${conformanceRoot}`, `blotter:${sessionId}`]; } class LocalSession { ctrl; register; sessionId; constructor(ctrl, register) { this.ctrl = ctrl; this.register = register; this.sessionId = ctrl.sessionId; } start() { return this.ctrl.start(); } advance(response) { return this.ctrl.advance(response); } revise(response) { return this.ctrl.revise(response); } submit(response) { return this.ctrl.submit(response); } async resume(after) { return this.ctrl.resume(after); } async finalize() { const fin = await this.ctrl.finalize(); const conformanceRoot = conformanceRootOf(fin.blotter); const blotter = toProtocolBlotter(fin.sessionId, fin.blotter); const artifacts = artifactsOf(fin.sessionId, conformanceRoot); const finalized = { blotter, sessionId: fin.sessionId, tipHash: fin.tipHash, conformanceRoot, artifacts }; const grade2 = gradeOf(fin.sessionId, fin.blotter); this.register(fin.sessionId, { finalized, grade: grade2, engineBlotter: fin.blotter }); return finalized; } } function localTransport() { const registry = new Map; const register = (id, record) => registry.set(id, record); return { kind: "local", version: `${SDK_VERSION}+local`, async catalog() { return { entries: catalogListing() }; }, async validate(document) { try { parse(document); return { ok: true, diagnostics: [] }; } catch (e) { if (e instanceof KestrelParseError) { return { ok: false, diagnostics: [e.message] }; } throw e; } }, async openSession(subject, _document) { if (subject.kind !== "catalog") { throw new SdkLocalError("unsupported-subject", "the LOCAL transport runs catalog subjects; a raw dataset needs the managed backend (HTTP transport)"); } const entries = loadSessionCatalog(SESSION_CATALOG); const entry = entries.find((e) => e.id === subject.id); if (entry === undefined) { throw new SdkLocalError("unknown-subject", `no catalog entry ${JSON.stringify(subject.id)}`); } const events = resolveTapeEvents(entry); const ctrl = openSession({ events, config: BACKTEST_CONFIG, wakes: entry.recipe.wakes, fillModel: entry.entry.permittedFillModel, rUsd: entry.recipe.rUsd, fairTauYears: entry.recipe.fairTauYears }); return { gated: false, value: new LocalSession(ctrl, register) }; }, async grade(request) { const id = request.blotters[0]; if (id === undefined) throw new SdkLocalError("empty-grade", "grade requires at least one Blotter id"); const record = registry.get(id); if (record === undefined) { throw new SdkLocalError("unknown-artifact", `no finalized Blotter for ${JSON.stringify(id)} — finalize the Session first`); } return { gated: false, value: record.grade }; }, async artifact(ref) { for (const record of registry.values()) { if (record.finalized.artifacts.includes(ref)) { const isBlotter = ref.startsWith("blotter:"); return { ref, kind: isBlotter ? "blotter" : "conformance-root", value: isBlotter ? record.finalized.blotter : record.finalized.conformanceRoot }; } } throw new SdkLocalError("unknown-artifact", `artifact ${JSON.stringify(ref)} not found`); }, async resumeOperation(ref) { const record = registry.get(ref.operationId); if (record === undefined) { throw new SdkLocalError("unknown-operation", `no finalized Operation ${JSON.stringify(ref.operationId)}`); } return { operationId: ref.operationId, cursor: null, payload: { blotter: record.finalized.blotter, grade: record.grade, artifacts: record.finalized.artifacts } }; } }; } // artifacts/sdk/catalog-records.json var catalog_records_default = { catalogEntries: [ { id: "choppy-1101-strict", contentRoots: [ "sha256:7166b08f3438c8ed6ee23b5e86ae785736f94870207a63051893a00f08b462b1", "sha256:6b523f157a0810ae97375e2a913906899e04f4f74f79157054d16829079f35d1" ], schema: "kestrel.session/0.4", corpusTier: "public-baseline", requirements: { engineVersion: "kestrel-engine/4", judgeVersion: "kestrel-judge/1" }, permittedFillModel: "strict-cross-v1", viewIdentity: "sha256:7024aa5d72f506078395a8ab8de60304db56dce9cd1a37926f2065f75142aec1", renderingIdentity: "sha256:e739bbc12e0d5b78979162ec681b363f23e320ac56656edaf8c5f92d209094f5", provenance: { source: "sha256:7166b08f3438c8ed6ee23b5e86ae785736f94870207a63051893a00f08b462b1", recordedAt: "2026-07-13T00:00:00.000Z" }, inputPin: { kind: "fixed-plan", planDoc: "sha256:b2f537d46f63616271a0dba07ea6ef81ccd9010184c76797127965f28dc4dcb7" } }, { id: "spike-1102-maker-fair", contentRoots: [ "sha256:5b50609e931959aa911b1c576a94d81c0947ff1e0193de8a40054de969baa583", "sha256:20a1ac0ea1264b3f02449e81ee5d8d31afdd6439d6bc2629e7d56cbdf4bffb5b" ], schema: "kestrel.session/0.4", corpusTier: "public-baseline", requirements: { engineVersion: "kestrel-engine/4", judgeVersion: "kestrel-judge/1" }, permittedFillModel: "maker-fair-v1", viewIdentity: "sha256:7024aa5d72f506078395a8ab8de60304db56dce9cd1a37926f2065f75142aec1", renderingIdentity: "sha256:e739bbc12e0d5b78979162ec681b363f23e320ac56656edaf8c5f92d209094f5", provenance: { source: "sha256:5b50609e931959aa911b1c576a94d81c0947ff1e0193de8a40054de969baa583", recordedAt: "2026-07-13T00:00:00.000Z" }, inputPin: { kind: "fixed-plan", planDoc: "sha256:b2f537d46f63616271a0dba07ea6ef81ccd9010184c76797127965f28dc4dcb7" } }, { id: "trending-1103-maker-fair", contentRoots: [ "sha256:2528243e6a4b708bf169beffe6352b95e4db0e3374891e0ab78bfee8a7b871f2", "sha256:fcd23dc97426d2c082e95fc1f86e0ff94fa0c601fd3836c000add10085f494bd" ], schema: "kestrel.session/0.4", corpusTier: "public-baseline", requirements: { engineVersion: "kestrel-engine/4", judgeVersion: "kestrel-judge/1" }, permittedFillModel: "maker-fair-v1", viewIdentity: "sha256:7024aa5d72f506078395a8ab8de60304db56dce9cd1a37926f2065f75142aec1", renderingIdentity: "sha256:e739bbc12e0d5b78979162ec681b363f23e320ac56656edaf8c5f92d209094f5", provenance: { source: "sha256:2528243e6a4b708bf169beffe6352b95e4db0e3374891e0ab78bfee8a7b871f2", recordedAt: "2026-07-13T00:00:00.000Z" }, inputPin: { kind: "fixed-plan", planDoc: "sha256:b2f537d46f63616271a0dba07ea6ef81ccd9010184c76797127965f28dc4dcb7" } } ], records: { "choppy-1101-strict": { entryId: "choppy-1101-strict", sessionId: "fa4d371afafa771baa89aef0fce43086cc45b23537847fea3b4348c5bdb1949a", blotter: { sessionId: "fa4d371afafa771baa89aef0fce43086cc45b23537847fea3b4348c5bdb1949a", orders: [], fills: [], positions: [], settlement: { realized: -64, asset: "usd", settledAt: "2026-03-02T14:29:30.000Z" }, totals: { floor: -64, expected: -64, headline: { channel: "floor", usd: -64, gate: { qualified: false, reasons: [ "sampled channel off (no fillSeed) — nothing to qualify (fail-closed, ADR-0016 §5)", "no sampled-channel qualification on record — calibration + causality + fidelity study not passed (kestrel-9gu.8.6; 9gu.8 AC#7, fail-closed)" ] }, tainted: false, reasons: [] }, settle_mark: { stale: false, source: "market", mark_uncertain: false, note: null } }, fill_claim: [ { support: "calibrated", expected: -64, gain: 0, loss: -64 }, { support: "extrapolated", expected: 0, gain: 0, loss: 0 } ] }, grade: { subjectSessionId: "fa4d371afafa771baa89aef0fce43086cc45b23537847fea3b4348c5bdb1949a", metrics: { realized_pnl: -64, fill_rate: 0, order_count: 0, fill_count: 0, position_count: 0, gross_traded_qty: 0, filled_notional: 0, realized_floor_usd: -64, expected_usd: -64, bankable_ev: -64 } }, tipHash: "6fc299ea0282833e2d9cc468c60bf3296d2bc0b557db8ae30113027cbd8c1bab", conformanceRoot: "6b523f157a0810ae97375e2a913906899e04f4f74f79157054d16829079f35d1", artifacts: [ "sha256:6b523f157a0810ae97375e2a913906899e04f4f74f79157054d16829079f35d1", "blotter:fa4d371afafa771baa89aef0fce43086cc45b23537847fea3b4348c5bdb1949a" ], entries: [ { kind: "turn", sessionId: "fa4d371afafa771baa89aef0fce43086cc45b23537847fea3b4348c5bdb1949a", ordinal: -1, parentHash: "fa4d371afafa771baa89aef0fce43086cc45b23537847fea3b4348c5bdb1949a", frameRoot: "139efcfc67d42f084776dd00aa55510ecdfd17541833754e540391eb0efc146e", authoredSha256: "b2f537d46f63616271a0dba07ea6ef81ccd9010184c76797127965f28dc4dcb7", body: { kind: "authored", bytes: `PLAN atm-rider budget 0.5R ttl +60m WHEN phase open DO buy 1 atm C @ lean(bid, fair, 0.5)` }, entryHash: "9744b21f02eabf25b22da51306fa9d3356901fcfe34ba6b0221551ecd997ef1b" }, { kind: "turn", sessionId: "fa4d371afafa771baa89aef0fce43086cc45b23537847fea3b4348c5bdb1949a", ordinal: 0, parentHash: "9744b21f02eabf25b22da51306fa9d3356901fcfe34ba6b0221551ecd997ef1b", frameRoot: "638b959e1b2785f7dafb4536652ac584feee54bc0f424cd83b0873c8feb211a1", authoredSha256: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", body: { kind: "authored", bytes: "" }, entryHash: "5b8ae8b0420ee1e069245e1aa7a687f3ba0c5f4cf5ffd80841204462d897a9bf" }, { kind: "turn", sessionId: "fa4d371afafa771baa89aef0fce43086cc45b23537847fea3b4348c5bdb1949a", ordinal: 1, parentHash: "5b8ae8b0420ee1e069245e1aa7a687f3ba0c5f4cf5ffd80841204462d897a9bf", frameRoot: "a489625546f2ddabaaab78ef3a25a6b7f3b0c0e7418c60a0943c5bfd1626a852", authoredSha256: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", body: { kind: "authored", bytes: "" }, entryHash: "6fc299ea0282833e2d9cc468c60bf3296d2bc0b557db8ae30113027cbd8c1bab" } ], frames: [ { timeToCloseMin: 60, phase: "pre", clockET: "08:30", instruments: [ { symbol: "QQQ", assetClass: "option-underlier", role: "signal" } ], market: { instrument: "QQQ", levels: { spot: 100, spotStaleSeconds: 0, priorClose: null, hod: null, lod: null, vwap: null, orHigh: null, orLow: null }, tape: [], tapeBucketMin: 1, chain: [ { strike: 92, right: "C", bid: 8.4, ask: 8.65, fair: 8.51999108866734, fairNote: "b76 nLiq=17" }, { strike: 92, right: "P", bid: 0.49, ask: 0.55, fair: 0.5249910886673383, fairNote: "b76 nLiq=17" }, { strike: 93, right: "C", bid: 7.46, ask: 7.67, fair: 7.562498087306096, fairNote: "b76 nLiq=17" }, { strike: 93, right: "P", bid: 0.54, ask: 0.59, fair: 0.5674980873060829, fairNote: "b76 nLiq=17" }, { strike: 94, right: "C", bid: 6.51, ask: 6.69, fair: 6.597498343879366, fairNote: "b76 nLiq=17" }, { strike: 94, right: "P", bid: 0.57, ask: 0.63, fair: 0.6024983438793754, fairNote: "b76 nLiq=17" }, { strike: 95, right: "C", bid: 5.56, ask: 5.71, fair: 5.632498591568151, fairNote: "b76 nLiq=17" }, { strike: 95, right: "P", bid: 0.61, ask: 0.66, fair: 0.637498591568157, fairNote: "b76 nLiq=17" }, { strike: 96, right: "C", bid: 4.61, ask: 4.72, fair: 4.6624988254432225, fairNote: "b76 nLiq=17" }, { strike: 96, right: "P", bid: 0.64, ask: 0.69, fair: 0.6674988254432357, fairNote: "b76 nLiq=17" }, { strike: 97, right: "C", bid: 3.64, ask: 3.73, fair: 3.682499053027499, fairNote: "b76 nLiq=17" }, { strike: 97, right: "P", bid: 0.66, ask: 0.71, fair: 0.6874990530275014, fairNote: "b76 nLiq=17" }, { strike: 98, right: "C", bid: 2.68, ask: 2.74, fair: 2.7099999999992974, fairNote: "b76 nLiq=17" }, { strike: 98, right: "P", bid: null, ask: null, fair: 0.7149999999992893, fairNote: "b76 nLiq=17" }, { strike: 99, right: "C", bid: 1.69, ask: 1.74, fair: 1.7150000000007353, fairNote: "b76 nLiq=17" }, { strike: 99, right: "P", bid: 0.7, ask: 0.74, fair: 0.7200000000007236, fairNote: "b76 nLiq=17" }, { strike: 100, right: "C", bid: 0.7, ask: null, fair: 0.7150000000004013, fairNote: "b76 nLiq=17" }, { strike: 100, right: "P", bid: 0.7, ask: 0.74, fair: 0.7200000000003968, fairNote: "b76 nLiq=17" }, { strike: 101, right: "C", bid: 0.7, ask: 0.74, fair: 0.7174996504407005, fairNote: "b76 nLiq=17" }, { strike: 101, right: "P", bid: 1.7, ask: 1.74, fair: 1.722499650440696, fairNote: "b76 nLiq=17" }, { strike: 102, right: "C", bid: 0.68, ask: 0.73, fair: 0.7049999999992735, fairNote: "b76 nLiq=17" }, { strike: 102, right: "P", bid: 2.68, ask: 2.74, fair: 2.709999999999269, fairNote: "b76 nLiq=17" }, { strike: 103, right: "C", bid: 0.66, ask: 0.71, fair: 0.6850000000006382, fairNote: "b76 nLiq=17" }, { strike: 103, right: "P", bid: 3.65, ask: 3.73, fair: 3.690000000000637, fairNote: "b76 nLiq=17" }, { strike: 104, right: "C", bid: null, ask: null, fair: 0.6600000000004904, fairNote: "b76 nLiq=17" }, { strike: 104, right: "P", bid: 4.61, ask: 4.72, fair: 4.665000000000489, fairNote: "b76 nLiq=17" }, { strike: 105, right: "C", bid: 0.61, ask: 0.66, fair: 0.6324985736705351, fairNote: "b76 nLiq=17" }, { strike: 105, right: "P", bid: 5.56, ask: 5.71, fair: 5.637498573670527, fairNote: "b76 nLiq=17" }, { strike: 106, right: "C", bid: 0.57, ask: 0.63, fair: 0.5974983228318536, fairNote: "b76 nLiq=17" }, { strike: 106, right: "P", bid: 6.51, ask: 6.69, fair: 6.602498322831849, fairNote: "b76 nLiq=17" }, { strike: 107, right: "C", bid: 0.54, ask: 0.59, fair: 0.5624980625810458, fairNote: "b76 nLiq=17" }, { strike: 107, right: "P", bid: 7.46, ask: 7.67, fair: 7.567498062581038, fairNote: "b76 nLiq=17" }, { strike: 108, right: "C", bid: 0.49, ask: 0.55, fair: 0.520000000000767, fairNote: "b76 nLiq=17" }, { strike: 108, right: "P", bid: 8.4, ask: 8.65, fair: 8.525000000000759, fairNote: "b76 nLiq=17" } ], chainDte: 0 }, kernel: { positions: [], resting: [], fillsSinceLast: [], budget: { used: 0, remaining: 1e4, total: 1e4 }, plans: [] } }, { wakeIndex: 0, minutesSinceLast: 20, timeToCloseMin: 40, phase: "regular", clockET: "08:50", wakeReason: "0850", market: { instrument: "QQQ", levels: { spot: 99.79, spotStaleSeconds: 30, priorClose: null, hod: 100.1, lod: 99.78, vwap: 99.96974358974359, orHigh: 100.1, orLow: 99.94 }, tape: [ { clock: "08:30", open: 100, high: 100, low: 100, close: 100 }, { clock: "08:30", open: 100, high: 100, low: 100, close: 100 }, { clock: "08:30", open: 100, high: 100, low: 100, close: 100 }, { clock: "08:30", open: 100, high: 100, low: 100, close: 100 }, { clock: "08:31", open: 100.04, high: 100.04, low: 100.04, close: 100.04 }, { clock: "08:31", open: 100.04, high: 100.04, low: 100.04, close: 100.04 }, { clock: "08:31", open: 100, high: 100, low: 100, close: 100 }, { clock: "08:31", open: 100, high: 100, low: 100, close: 100 }, { clock: "08:32", open: 100.03, high: 100.03, low: 100.03, close: 100.03 }, { clock: "08:32", open: 100.03, high: 100.03, low: 100.03, close: 100.03 }, { clock: "08:32", open: 99.99, high: 99.99, low: 99.99, close: 99.99 }, { clock: "08:32", open: 99.99, high: 99.99, low: 99.99, close: 99.99 }, { clock: "08:33", open: 99.94, high: 99.94, low: 99.94, close: 99.94 }, { clock: "08:33", open: 99.94, high: 99.94, low: 99.94, close: 99.94 }, { clock: "08:33", open: 100.05, high: 100.05, low: 100.05, close: 100.05 }, { clock: "08:33", open: 100.05, high: 100.05, low: 100.05, close: 100.05 }, { clock: "08:34", open: 100.1, high: 100.1, low: 100.1, close: 100.1 }, { clock: "08:34", open: 100.1, high: 100.1, low: 100.1, close: 100.1 }, { clock: "08:34", open: 100.02, high: 100.02, low: 100.02, close: 100.02 }, { clock: "08:34", open: 100.02, high: 100.02, low: 100.02, close: 100.02 }, { clock: "08:35", open: 100.05, high: 100.05, low: 100.05, close: 100.05 }, { clock: "08:35", open: 100.05, high: 100.05, low: 100.05, close: 100.05 }, { clock: "08:35", open: 100.05, high: 100.05, low: 100.05, close: 100.05 }, { clock: "08:35", open: 100.05, high: 100.05, low: 100.05, close: 100.05 }, { clock: "08:36", open: 100.01, high: 100.01, low: 100.01, close: 100.01 }, { clock: "08:36", open: 100.01, high: 100.01, low: 100.01, close: 100.01 }, { clock: "08:36", open: 100.07, high: 100.07, low: 100.07, close: 100.07 }, { clock: "08:36", open: 100.07, high: 100.07, low: 100.07, close: 100.07 }, { clock: "08:37", open: 100.09, high: 100.09, low: 100.09, close: 100.09 }, { clock: "08:37", open: 100.09, high: 100.09, low: 100.09, close: 100.09 }, { clock: "08:37", open: 100.01, high: 100.01, low: 100.01, close: 100.01 }, { clock: "08:37", open: 100.01, high: 100.01, low: 100.01, close: 100.01 }, { clock: "08:38", open: 99.92, high: 99.92, low: 99.92, close: 99.92 }, { clock: "08:38", open: 99.92, high: 99.92, low: 99.92, close: 99.92 }, { clock: "08:38", open: 99.89, high: 99.89, low: 99.89, close: 99.89 }, { clock: "08:38", open: 99.89, high: 99.89, low: 99.89, close: 99.89 }, { clock: "08:39", open: 99.94, high: 99.94, low: 99.94, close: 99.94 }, { clock: "08:39", open: 99.94, high: 99.94, low: 99.94, close: 99.94 }, { clock: "08:39", open: 100, high: 100, low: 100, close: 100 }, { clock: "08:39", open: 100, high: 100, low: 100, close: 100 }, { clock: "08:40", open: 100.03, high: 100.03, low: 100.03, close: 100.03 }, { clock: "08:40", open: 100.03, high: 100.03, low: 100.03, close: 100.03 }, { clock: "08:40", open: 100.02, high: 100.02, low: 100.02, close: 100.02 }, { clock: "08:40", open: 100.02, high: 100.02, low: 100.02, close: 100.02 }, { clock: "08:41", open: 100.04, high: 100.04, low: 100.04, close: 100.04 }, { clock: "08:41", open: 100.04, high: 100.04, low: 100.04, close: 100.04 }, { clock: "08:41", open: 99.98, high: 99.98, low: 99.98, close: 99.98 }, { clock: "08:41", open: 99.98, high: 99.98, low: 99.98, close: 99.98 }, { clock: "08:42", open: 99.9, high: 99.9, low: 99.9, close: 99.9 }, { clock: "08:42", open: 99.9, high: 99.9, low: 99.9, close: 99.9 }, { clock: "08:42", open: 99.94, high: 99.94, low: 99.94, close: 99.94 }, { clock: "08:42", open: 99.94, high: 99.94, low: 99.94, close: 99.94 }, { clock: "08:43", open: 100.02, high: 100.02, low: 100.02, close: 100.02 }, { clock: "08:43", open: 100.02, high: 100.02, low: 100.02, close: 100.02 }, { clock: "08:43", open: 99.91, high: 99.91, low: 99.91, close: 99.91 }, { clock: "08:43", open: 99.91, high: 99.91, low: 99.91, close: 99.91 }, { clock: "08:44", open: 99.89, high: 99.89, low: 99.89, close: 99.89 }, { clock: "08:44", open: 99.89, high: 99.89, low: 99.89, close: 99.89 }, { clock: "08:44", open: 99.9, high: 99.9, low: 99.9, close: 99.9 }, { clock: "08:44", open: 99.9, high: 99.9, low: 99.9, close: 99.9 }, { clock: "08:45", open: 99.9, high: 99.9, low: 99.9, close: 99.9 }, { clock: "08:45", open: 99.9, high: 99.9, low: 99.9, close: 99.9 }, { clock: "08:45", open: 99.93, high: 99.93, low: 99.93, close: 99.93 }, { clock: "08:45", open: 99.93, high: 99.93, low: 99.93, close: 99.93 }, { clock: "08:46", open: 99.95, high: 99.95, low: 99.95, close: 99.95 }, { clock: "08:46", open: 99.95, high: 99.95, low: 99.95, close: 99.95 }, { clock: "08:46", open: 99.93, high: 99.93, low: 99.93, close: 99.93 }, { clock: "08:46", open: 99.93, high: 99.93, low: 99.93, close: 99.93 }, { clock: "08:47", open: 99.94, high: 99.94, low: 99.94, close: 99.94 }, { clock: "08:47", open: 99.94, high: 99.94, low: 99.94, close: 99.94 }, { clock: "08:47", open: 99.95, high: 99.95, low: 99.95, close: 99.95 }, { clock: "08:47", open: 99.95, high: 99.95, low: 99.95, close: 99.95 }, { clock: "08:48", open: 99.83, high: 99.83, low: 99.83, close: 99.83 }, { clock: "08:48", open: 99.83, high: 99.83, low: 99.83, close: 99.83 }, { clock: "08:48", open: 99.78, high: 99.78, low: 99.78, close: 99.78 }, { clock: "08:48", open: 99.78, high: 99.78, low: 99.78, close: 99.78 }, { clock: "08:49", open: 99.78, high: 99.78, low: 99.78, close: 99.78 }, { clock: "08:49", open: 99.78, high: 99.78, low: 99.78, close: 99.78 }, { clock: "08:49", open: 99.79, high: 99.79, low: 99.79, close: 99.79 }, { clock: "08:49", open: 99.79, high: 99.79, low: 99.79, close: 99.79 } ], tapeBucketMin: 1, chain: [ { strike: 92, right: "C", bid: 8.11, ask: 8.34, fair: 8.22500000000042, fairNote: "b76 nLiq=17" }, { strike: 92, right: "P", bid: 0.41, ask: 0.46, fair: 0.4350000000004144, fairNote: "b76 nLiq=17" }, { strike: 93, right: "C", bid: 7.16, ask: 7.36, fair: 7.260000000000517, fairNote: "b76 nLiq=17" }, { strike: 93, right: "P", bid: 0.44, ask: 0.5, fair: 0.47000000000051934, fairNote: "b76 nLiq=17" }, { strike: 94, right: "C", bid: 6.2, ask: 6.37, fair: 6.287497864268204, fairNote: "b76 nLiq=17" }, { strike: 94, right: "P", bid: 0.47, ask: 0.53, fair: 0.49749786426819576, fairNote: "b76 nLiq=17" }, { strike: 95, right: "C", bid: 5.25, ask: 5.38, fair: 5.314999999999301, fairNote: "b76 nLiq=17" }, { strike: 95, right: "P", bid: 0.5, ask: 0.55, fair: 0.5249999999993058, fairNote: "b76 nLiq=17" }, { strike: 96, right: "C", bid: 4.28, ask: 4.39, fair: 4.3350000000005195, fairNote: "b76 nLiq=17" }, { strike: 96, right: "P", bid: 0.52, ask: 0.57, fair: 0.5450000000005097, fairNote: "b76 nLiq=17" }, { strike: 97, right: "C", bid: 3.32, ask: 3.4, fair: 3.357498763822491, fairNote: "b76 nLiq=17" }, { strike: 97, right: "P", bid: 0.54, ask: 0.59, fair: 0.5674987638224671, fairNote: "b76 nLiq=17" }, { strike: 98, right: "C", bid: 2.34, ask: 2.4,