Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions test/archive-forwarder-contract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ describe("archive forwarder wire contract (shared golden fixture)", () => {
new Set([
"strategy_data.policy_evaluation_events",
"strategy_data.strategy_policy_snapshots",
"strategy_data.market_identity",
"strategy_data.symbol_mapping",
"strategy_data.inventory_settlement_events",
]),
);
Expand Down
2 changes: 1 addition & 1 deletion test/archive-forwarder-strategy-contract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
import fixture from "./fixtures/archive_forwarder_envelope.json";

const PINNED_MAKER_FIXTURE_SHA256 =
"784f647e048052a6c3382309b1a86abfbe08bc162363ead9fc88eaa1ba3d50c9";
"5c9fd679a5a05ebce5f5158f4cc376360f24a34d9a07edeee43e94e564db3ee7";

const strategyTables = [
"strategy_data.policy_evaluation_events",
Expand Down
5 changes: 4 additions & 1 deletion test/archive-forwarder-strategy-request.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ describe("strategy durable HTTP admission", () => {
});
expect(response.status).toBe(202);
expect(insertCalled).toBe(false);
expect(spool.stats()).toMatchObject({ queuedBatches: 1, queuedWork: 3 });
expect(spool.stats()).toMatchObject({
queuedBatches: 1,
queuedWork: fixture.rows.length,
});
spool.close();
});

Expand Down
78 changes: 77 additions & 1 deletion test/fixtures/archive_forwarder_envelope.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,82 @@
},
"table": "strategy_data.strategy_policy_snapshots"
},
{
"row": {
"access_policy_id": "",
"active_from_ms": 1719999999996,
"archive_event_id": "run-2026-07-02T00-00-00Z:strategy_data.market_identity:1",
"base_asset": "ARB",
"canonical_core_pool_id": "0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
"canonical_exchange": "binance",
"canonical_market_id": "0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
"canonical_trading_pair": "ARB-USDC",
"connector_id": "fiet_cex",
"connector_name": "fiet_cex",
"content_hash": "3f9c9e16063259ea9b0329dcad2a64eea8ab52747cc71d623ce4251bd9c7dd16",
"controller_id": "layer12-live-arb-usdc-015",
"controller_type": "layer12_live",
"core_pool_id": "0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
"deployment_id": "arb-usdc-015",
"emitted_at_ms": 1720000000000,
"event_time_ms": 1719999999996,
"exchange": "binance",
"market_id": "arb-usdc-015",
"payload_json": "{\"market_detail\":{\"core_pool_id\":\"0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"inventory\":{\"token0\":{\"address\":\"0x1111111111111111111111111111111111111111\",\"symbol\":\"ARB\"},\"token1\":{\"address\":\"0x2222222222222222222222222222222222222222\",\"symbol\":\"USDC\"}},\"market_id\":\"arb-usdc-015\"},\"market_identity\":{\"canonical_core_pool_id\":\"0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"core_pool_id\":\"0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"market_id\":\"arb-usdc-015\"}}",
"producer_id": "hb_runtime:arb-usdc-015:layer12-live-arb-usdc-015",
"producer_run_id": "run-2026-07-02T00-00-00Z",
"quote_asset": "USDC",
"revision": "3f9c9e16063259ea9b0329dcad2a64eea8ab52747cc71d623ce4251bd9c7dd16",
"run_id": "run-2026-07-02T00-00-00Z",
"schema_version": "2",
"seq": 3,
"snapshot_reason": "startup",
"source": "hb_runtime",
"source_hash": "3f9c9e16063259ea9b0329dcad2a64eea8ab52747cc71d623ce4251bd9c7dd16",
"source_symbol": "ARB-USDC",
"stream_name": "strategy_data.market_identity",
"stream_seq": 1,
"trading_pair": "ARB-USDC"
},
"table": "strategy_data.market_identity"
},
{
"row": {
"access_policy_id": "",
"active_from_ms": 1719999999998,
"archive_event_id": "run-2026-07-02T00-00-00Z:strategy_data.symbol_mapping:1",
"base_asset": "ARB",
"canonical_exchange": "binance",
"canonical_market_id": "arb-usdc-015",
"canonical_trading_pair": "ARB-USDC",
"connector_id": "fiet_cex",
"connector_name": "fiet_cex",
"content_hash": "ad9018fea06786f8448b2ebf2ff99b3c6a7cf647c5b0853a1173f466bf358cfc",
"controller_id": "layer12-live-arb-usdc-015",
"controller_type": "layer12_live",
"deployment_id": "arb-usdc-015",
"emitted_at_ms": 1720000000000,
"event_time_ms": 1719999999998,
"exchange": "binance",
"market_id": "arb-usdc-015",
"payload_json": "{\"base_asset\":\"ARB\",\"cex_exchange_name\":\"binance\",\"connector_name\":\"fiet_cex\",\"market_pair\":\"ARB-USDC\",\"policy_epoch\":\"42\",\"quote_asset\":\"USDC\",\"trading_account_selector\":\"secondary:1\",\"trading_pair\":\"ARB-USDC\"}",
"producer_id": "hb_runtime:arb-usdc-015:layer12-live-arb-usdc-015",
"producer_run_id": "run-2026-07-02T00-00-00Z",
"quote_asset": "USDC",
"revision": "ad9018fea06786f8448b2ebf2ff99b3c6a7cf647c5b0853a1173f466bf358cfc",
"run_id": "run-2026-07-02T00-00-00Z",
"schema_version": "2",
"seq": 4,
"snapshot_reason": "symbol_mapping_change",
"source": "hb_runtime",
"source_hash": "ad9018fea06786f8448b2ebf2ff99b3c6a7cf647c5b0853a1173f466bf358cfc",
"source_symbol": "ARB-USDC",
"stream_name": "strategy_data.symbol_mapping",
"stream_seq": 1,
"trading_pair": "ARB-USDC"
},
"table": "strategy_data.symbol_mapping"
},
{
"row": {
"account": "secondary:1",
Expand All @@ -77,7 +153,7 @@
"reservation_id": "resv-0001",
"run_id": "run-2026-07-02T00-00-00Z",
"schema_version": "2",
"seq": 3,
"seq": 5,
"source": "hb_runtime",
"stream_name": "strategy_data.inventory_settlement_events",
"stream_seq": 1,
Expand Down
Loading