Qoc

Snapshots and equity

Capture point-in-time NAV and position state to build an equity curve, run retrospectives, and track long-term performance.


A snapshot is a timestamped capture of your UTA balance sheet written to snapshots/ — the sequence of snapshots forms your equity curve and the basis for every retrospective analysis.

What a snapshot contains

Each snapshot records: total NAV, cash by venue, open positions (symbol, quantity, average cost, current mark, unrealized P&L), realized P&L since the previous snapshot, and the list of connectors that contributed data.

Snapshots are written as TOML files named by ISO timestamp so they sort chronologically. They are committed to workspace history automatically, giving you a git-traceable equity record alongside your order history.

Example snapshot file

snapshots/2026-07-05T16-00-00Z.toml
toml
[meta]
timestamp      = "2026-07-05T16:00:00Z"
nav_usd        = 167_420.88
cash_usd       = 41_210.50
realized_pnl   = 1_840.22
unrealized_pnl = 3_108.65
connectors     = ["main-equities", "crypto-spot", "sweep-cash"]

[[position]]
connector  = "main-equities"
symbol     = "AAPL"
quantity   = 150
avg_cost   = 198.42
mark       = 211.40
pnl_open   = 1_947.00

[[position]]
connector  = "crypto-spot"
symbol     = "BTC-USD"
quantity   = 0.5
avg_cost   = 58_400.00
mark       = 61_200.00
pnl_open   = 1_400.00

Taking a snapshot

  1. 1

    Manual snapshot

    Run qoc snapshot at any time. Qoc queries all active connectors, aggregates the UTA book, and writes the snapshot file.

  2. 2

    Scheduled snapshots

    Add a [[schedule]] block in desk.toml to capture snapshots automatically — for example, at market close every trading day.

  3. 3

    Verify the snapshot

    Run qoc status --snapshot latest to print the most recent snapshot in a human-readable table. Cross-check the NAV against your venue's own account summary to confirm the connector is reconciled.

Scheduling daily snapshots

desk.toml — snapshot at 16:05 ET on weekdays
toml
[[schedule]]
name  = "daily-close-snapshot"
cron  = "5 16 * * 1-5"
tz    = "America/New_York"
task  = "snapshot"

Equity curve and retrospectives

Any tool that can read TOML files can consume your snapshots. Qoc ships a built-in retrospective task (qoc run retrospective) that reads the snapshots/ directory, computes daily returns, max drawdown, Sharpe ratio, and win rate, and writes a markdown report to research/.

Because snapshots are committed to workspace history, you can git log snapshots/ to see the full chronological record and git diff two snapshot files to understand what changed between any two points in time.

Snapshot NAV depends on mark prices

Unrealized P&L is computed from the mark price returned by each connector at snapshot time. For illiquid instruments or after-hours periods, the mark may lag the true fair value. Treat unrealized P&L as indicative until the position is closed.

Back-fill historical snapshots

If you connect a venue that has historical position data, run qoc snapshot --backfill <date> to generate synthetic snapshots from the venue's account history. Back-filled snapshots are tagged backfill: true in their metadata so they are distinguishable from live captures.