Documentation sections
// OPTIONS OS DOCUMENTATION

Build a crypto-options engine on an existing engineering system.

Options OS is a specification-driven repository for building crypto-options trading engines with Claude Code or Codex. It combines reusable financial libraries, an options-native domain model, venue adapters, engine specifications, agent execution controls, and conformance tooling.

You define the trading system. Options OS translates that definition into engineering contracts, resolves the required framework components, controls implementation, and verifies the resulting engine against the system it claims to implement.

21 Python libraries Deribit reference adapter Claude Code + Codex Specifications + implementation evidence
01 / REPOSITORY

What the repository provides.

options-os/
├── .agents/                    shared agent capabilities
├── .claude/                    Claude Code integration
├── .codex/                     Codex integration
├── .docs/                      operational documentation
├── .legal/                     commercial licence and notices
├── .vscode/                    editor configuration
├── execution/
│   ├── backlog/
│   ├── done/
│   ├── in-work/
│   ├── queued/
│   ├── support/
│   ├── EXECUTION_PROTOCOL.md
│   └── README.md
├── packages/
│   ├── adapter-deribit/
│   ├── libs/
│   └── ruff.toml
├── specifications/
│   ├── framework/
│   ├── libs/
│   └── README.md
├── tools/
│   ├── codemap/
│   ├── controls/
│   ├── flatten/
│   ├── lint/
│   ├── probes/
│   ├── scraper/
│   └── tree/
├── AGENTS.md
├── CLAUDE.md
├── INVARIANTS.md
├── PROFILE.md
├── Makefile
└── README.md
Repository areaProvides
Domain modelShared identifiers, units, instruments, prices, volatility, Greeks, structures, portfolios, orders, and lifecycle types.
Quantitative librariesPricing, volatility, Greeks, surfaces, portfolio aggregation, costs, PnL, mandates, risk, and hedging.
Trading foundationsMarket-quality evaluation, trading models, order programs, messaging, configuration, logging, and notifications.
Venue boundaryShared adapter contracts and a Deribit reference implementation covering market data, orders, fills, positions, errors, and reconciliation.
Specification systemTrading-system definition, engine contracts, venue contracts, library contracts, assemblies, and dependency bindings.
Agentic build layerShared controls, skills, hooks, and workflows for Claude Code and Codex.
VerificationArchitecture enforcement, tests, readiness checks, code mapping, and contract-to-implementation conformance.
02 / LIBRARIES

Reusable options-system capabilities.

The framework is implemented as separate libraries with explicit contracts and dependency boundaries. Libraries establish facts, plans, and verdicts. They do not own strategy policy.

CapabilityLibrariesResponsibility
Canonical domain canonical Shared quantitative vocabulary, identifiers, units, primitives, enums, and immutable domain objects.
Infrastructure config, logger, message-bus, notification Configuration, observability, and explicit communication boundaries.
Market domain instrument, price-facts, market-quality Normalized instruments, qualified prices, freshness, validity, and market-quality classifications.
Quantitative model quant-pricing, quant-volatility, quant-greeks, quant-surface Valuation, implied volatility, sensitivities, smiles, skew, term structure, and surface facts.
Portfolio economics quant-cost, pnl-algebra, quant-portfolio Fees, spread, slippage, funding, carry, PnL, and portfolio-level exposure aggregation.
Risk and hedging mandate, risk-kernel, hedging Mandate evaluation, risk verdicts, residual exposure, hedge targets, and hedge plans.
Trading and execution trading-model, order-algebra, adapter-core Trading facts, order programs, lifecycle contracts, adapter capabilities, and runtime substrate.
LIBRARY / ENGINE SEPARATION

The hedging library can produce a hedge plan. The risk kernel can produce a verdict. The engine decides whether to hedge, reduce risk, reject an entry, or halt.

03 / CONSTRUCTION MODEL

Financial meaning is separated from effects.

Options OS structures reusable code through a progression from domain vocabulary to controlled interaction with the outside world.

primitives → enums → objects → algebra + laws
                              ↓
                         morphisms
                              ↓
                         pipelines
                              ↓
                          programs
                              ↓
                        interpreter
                              ↓
                          effects
                              ↓
                     runtime → world
LayerOwns
Primitives and enumsUnits, identifiers, and closed semantic alternatives.
ObjectsImmutable financial and operational values.
Algebra and lawsPure calculations, identities, aggregation, and comparison.
Morphisms and pipelinesPure transformations and their named composition.
ProgramsInstructions and causal order represented as data.
InterpretersTranslation of programs into explicit capabilities.
EffectsNetwork, database, clock, filesystem, and mutable state.
RuntimeDependency selection, scheduling, supervision, and resources.

Effects begin at the interpreter boundary. Pricing, portfolio, risk, and order meaning remain testable without opening a network connection, reading a database, or importing a venue client.

04 / SPECIFICATION SYSTEM

Trading intent becomes an engineering contract.

The entry point is a structured trading-system definition. It records the strategy thesis, market observations, inputs, setup and signal rules, candidate construction, entries, exits, portfolio allocation, risk, hedging, order lifecycle, reconciliation, recovery, and runtime modes.

The accepted definition is translated into three coordinated engine contracts:

ContractOwns
Engine specificationStrategy meaning, facts, state, decisions, risk, attribution, and variation points.
Operations specificationLifecycles, book, execution, persistence, degraded operation, reconciliation, recovery, and replay.
Scenario specificationDecision cases, lifecycle episodes, failures, restart, isolation, performance, and controlled-runtime evidence.

Venue specifications separately own venue-native capabilities and behaviour. Library specifications own reusable financial meaning. Assembly bindings resolve the engine contract against selected libraries, venues, and infrastructure without redefining them.

trading definition
    ↓
engine contracts
    ↓
venue + library contracts
    ↓
assembly + bindings
    ↓
resolved contract map
05 / AGENTIC BUILD LAYER

The repository controls how agents change the system.

Claude Code and Codex consume the same engineering authority, shared agent capabilities, and completion rules. The agent does not reconstruct the architecture from code or decide what “done” means while implementing.

ComponentResponsibility
Agent contractsGive Claude Code and Codex the same repository execution rules.
SkillsSupply specialized procedures for specification, construction, integration, auditing, and repair.
Hooks and controlsEnforce repository rules before, during, and after agent actions.
Execution protocolConverts an accepted plan into dependency-closed implementation packets with one progress authority.
Verification workflowsBuild, change, repair, certify, and evaluate release readiness.

Repository workflows

  • build-system
  • change-system
  • correct-defect
  • certify-trading-build
  • release-readiness

Work is implemented as the smallest dependency-closed causal cut. Every affected consumer, contract, and verification surface is updated within the same cut.

06 / FIRST VERTICAL SPINE

Prove the complete engine lifecycle.

Deribit market data
    ↓
normalized option instruments
    ↓
strategy facts and decision
    ↓
canonical order program
    ↓
adapter interpretation
    ↓
orders, fills and positions
    ↓
portfolio, PnL and risk
    ↓
exit or settlement
    ↓
restart and reconciliation

The first engine should use one venue, one underlying, one book, and one explicit operating policy. This exercises the actual seams where trading engines fail: financial identity, order state, partial fills, fees, position adoption, risk, settlement, restart, and venue reconciliation.

Additional venues and strategies come after this spine is coherent.

07 / VERIFICATION

Compare accepted meaning with implemented behaviour.

specifications
    ↓
types + schemas
    ↓
invariants + architecture rules
    ↓
unit + property tests
    ↓
integration + contract tests
    ↓
lifecycle + acceptance scenarios
    ↓
static analysis + quality gates
    ↓
runtime evidence
    ↓
conformance

Options OS generates distinct evidence artifacts for distinct questions:

ArtifactQuestion answered
Blueprint manifestWhich contracts, providers, bindings, and topology were selected?
Contract mapWhich accepted rules must the implementation satisfy?
Readiness resultWhich decisions, capabilities, or evidence still block the build?
Code mapWhere does each rule exist in code, configuration, and tests?
Conformance resultWhich rules are covered, missing, contradictory, or unverifiable?
COMPLETION

A similarly named module is not implementation evidence. The code must preserve the rule’s inputs, units, state transitions, failure behaviour, and invariants.

08 / OPERATIONAL DOCUMENTATION

The exact procedures ship with the repository.

The private documentation turns the public architecture into an executable workflow:

  • Verified installation and package provisioning
  • Complete repository map and dependency graph
  • Field-by-field trading-system definition
  • Specification acceptance and assembly procedures
  • Vertical-spine implementation map
  • Copyable Claude Code and Codex directives
  • Executable verification and conformance commands
  • Venue probes, troubleshooting, security, and support

The public documentation exposes the architecture and construction model. The licensed repository contains the authoritative specifications, schemas, controls, generators, and operating procedures.

Repository access: bella@leanos.tech

Access and pricing →