The execution variants of the Python project and Compiled project use recorded hourly observations and a separately pinned funding history. Their ledgers state the actual policy and evaluated window.
Prerequisites
Start with the selected predictions and their declared availability. Use the unchanged recorded bars and funding input for the execution variant; changing the product, capital or trading policy creates a different comparison.
The execution engine determines the accounting model
| Execution path | Position and price interpretation | Retained evidence |
|---|---|---|
| Snapshot | Lagged binary positions over aligned return and OHLC evidence, with configured costs and optional barriers | Twenty summary metrics and optional aligned execution tracks |
| Event cash spot | Actual admitted intents and fills against recorded source clocks, with cash and inventory constraints | States, intents, fills, episodes, and funding ledgers |
| Event linear perpetual | Signed or fractional exposure under declared quote-settled economics and collateral | The same ledger families plus configured funding recognition and settlement |
Snapshot multiclass outputs require an explicit binary mapping, and multilabel outputs require an explicit selected label. The limited short/flat snapshot path has its own contract. Event signed exposure instead requests a target position under the configured sizing rules. Backtest owns the exact inputs, metric definitions, and supported policy combinations.
Decision and fill clocks preserve different observations
A decision timestamp identifies the model's row. Availability identifies when the information needed by that decision exists. Recorded source intervals also distinguish open-price availability from full-bar availability. Execution lag applies after the eligible decision becomes available.
The event engine retains pending intents until an admissible recorded fill exists. A fine execution source or formed-bar constituent history supplies its own price and availability evidence. Those clocks explain the relationship between a requested position, its eventual fill, and its measured return.
Python Research
The base experiment trades the next bar from open to close. A positive forecast takes positive exposure, a negative forecast takes negative exposure, and each nonzero decision pays two basis points round trip. The returned value is the mean net return per evaluated observation:
def backtest(validation, forecasts): positions = np.sign(forecasts) net = positions * validation["next_return"].to_numpy() - abs(positions) * 0.0002 return float(np.mean(net))That caller-owned policy is deliberately small. The execution variant separately uses explicit event inputs, product and funding rules. It retains actual fills and account states rather than treating the forecast itself as a fill.
Compiled Research
The worked research manifest declares the product, source interval and execution assumptions alongside the model:
backtest: source_interval_seconds: 900 fee_bps: 7.0 slip_bps: 3.0 notional_rate: 0.5 execution_lag_seconds: 0.0 product: kind: cash_spot instrument: BTCUSDT base_currency: BTC quote_currency: USDT quantity_step: 1.0e-9 min_notional: 0.0Read the event ledger in the retained native records: each fill has a time, quantity, price and fee; account states retain exposure and equity. The execution and funded variants change the declared economics and retain their own results:
limen run --no-progress-bar \ compiled-research/execution.yaml \ compiled-research/funded.yamlA snapshot, a cash account and a perpetual account are different interpretations. Compare returns only after the observation population, availability, policy and capital conventions agree. The execution reference preserves every supported product, clock, barrier, funding, allocation and observed-cost contract. The benchmark reference defines when retained tracks are comparable.
Signed exposure retains sizing and exit policy
Changed sizing signals target post-cost current equity subject to the configured quantity step, minimum notional, and collateral constraints. Unchanged sizing signals hold quantity. Resizes and reversals therefore differ from repeatedly restoring an unchanged percentage exposure on every observation.
Independent exits, elapsed holding limits, timers, take-profit, and stop-loss can close exposure before the model changes direction. Rearming governs later entry. The terminal policy marks remaining event exposure without forcing an invented close. The retained contract identifies those choices beside the ledger.
Funding uses its own observed schedule
Funding declares rate units, valuation conventions, schedule, phase, and recognition or cash-settlement behavior. Discrete settlement and continuous accrual have separate accounting rules. The supplied Binance history provides realized rates and mark prices for the worked perpetual case.
Binance BTCUSDT, Hyperliquid BTC, and Deribit BTC/USDC presets provide declared mechanics and scenario assumptions. Supplied historical funding replaces those scenario rates and must cover the required interval. A settled funding value is cost evidence at its recorded availability; a predictive funding feature requires its own causal source.
Observed fills can calibrate a retrospective cost comparison
The Python-only observed-cost scenario freezes a calibration artifact from pinned actual fills and reference observations. It evaluates each candidate with its original and calibrated execution policy. The admitted calibration changes slippage. Candidate fees remain the declared fee schedule.
def observed_costs(data_dir, output): fixture = data_dir / 'observed_costs' expected = {'history.zip': 'df4d7776172df459ec297cbcfe8e72a4748a51ab626e3c990deec83415102093', 'benchmark.json': 'b71011697713417b21302e670abf78c0bff739ec9135c7012db02fa3b2d6ccf8'} for name, digest in expected.items(): if hashlib.sha256((fixture / name).read_bytes()).hexdigest() != digest: raise ValueError('Recorded execution-cost input differs: ' + name) with ZipFile(fixture / 'history.zip') as archive: history = output / 'history.json' history.write_bytes(archive.read('admitted.json')) calibration = CostCalibration.from_history(history, cutoff_ns=1785810791000000000) artifact, specification = output / 'calibration.json', output / 'research-specification.json' calibration.write(artifact) specification.write_text(json.dumps({'calibration_digest': calibration.digest})) reports = [] for mode in ('binary', 'target_exposure'): for hour in (1, 2): experiment, comparison = run_cost_experiment(artifact, specification, fixture / 'benchmark.json', output / f'{mode}-{hour}', mode=mode, hour=hour) reports.append({'mode': mode, 'hour': hour, 'rounds': project.completed_log(experiment).height, 'comparison': comparison.report()}) return {'calibration': calibration.report(), 'runs': reports, 'historical_delivery': 'unknown; retrospective stress only'}- calibration.support.disposition
"retrospective_low_effective_support"
- calibration.support.selected legs
363
- calibration.support.admitted legs
363
- calibration.support.low effective support sides
[ "sell" ]
- historical delivery
"unknown; retrospective stress only"
Limen 6.0.1 · 42593d34 · Merged source PR · Validation and result digest · Native records
Support, side concentration, source clocks, and historical delivery limits remain part of the comparison. The retained sample supports a retrospective stress comparison under its stated assumptions. Observed-cost contracts define admission, immutable calibration, comparison artifacts, and unchanged candidate identity.
Read the fills
These excerpts show the first eight native fills, with Unix nanosecond timestamps, signed quantity changes, reference prices and fees. The full ledgers remain in the native records. The two campaigns use different declared assessment populations; compare their policy and clocks before comparing a return.
Python Research ledger
| time ns | quantity delta | reference price | fee |
|---|---|---|---|
| 1704074400000000000 | 0.23443000000000003 | 42613.57 | 6.995027329405173 |
| 1704081600000000000 | -0.23443000000000003 | 42330.5 | 6.944393437285851 |
| 1704096000000000000 | 0.23307000000000003 | 42492.46 | 6.934682137246963 |
| 1704103200000000000 | -0.23307000000000003 | 42649.69 | 6.9561667975278585 |
| 1704135600000000000 | 0.23011 | 43111.1 | 6.94628991669641 |
| 1704142800000000000 | -0.23011 | 43687.85 | 7.034996682105665 |
| 1704157200000000000 | 0.22268000000000002 | 45056 | 7.0252560007168 |
| 1704164400000000000 | -0.22268000000000002 | 45378.96 | 7.071368721729313 |
Limen 6.0.1 · 42593d34 · Merged source PR · Validation and result digest · Native records
Compiled Research ledger
| time ns | quantity delta | reference price | fee |
|---|---|---|---|
| 1704416400000000000 | 0.22584 | 44211.1 | 9.989627141411999 |
| 1704420000000000000 | -0.22584 | 44029.701711526875 | 9.938696000613964 |
| 1704423600000000000 | 0.22788000000000003 | 43506.01 | 9.919106633579402 |
| 1704427200000000000 | -0.22788000000000003 | 43465.21 | 9.899899628772603 |
| 1704430800000000000 | 0.22655000000000003 | 43589.87 | 9.880222691024253 |
| 1704441600000000000 | -0.22655000000000003 | 43777.48 | 9.912829199953004 |
| 1704445200000000000 | 0.22518000000000002 | 43911.44 | 9.8929220482296 |
| 1704452400000000000 | -0.22518000000000002 | 43711.573219429345 | 9.838050571522325 |
Limen 6.0.1 · 42593d34 · Merged source PR · Validation and result digest · Native records
Carry the policy with the result
A Sensor emits a prediction with its availability and identity. Downstream trading owns order execution. Continue to linked learning stages with the declared timing and economics, then research evidence to interpret the resulting candidate scores.