@aegis-engine/core 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -100,6 +100,26 @@ export interface paths {
100
100
  patch?: never;
101
101
  trace?: never;
102
102
  };
103
+ "/v1/markets/{marketId}/tvl-history": {
104
+ parameters: {
105
+ query?: never;
106
+ header?: never;
107
+ path?: never;
108
+ cookie?: never;
109
+ };
110
+ /**
111
+ * Read bounded observed core-principal TVL history
112
+ * @description Reads one existing historical-records item. Only qualified ReservesLens TVL observations are served; legacy rows without observation provenance are counted separately; invalid qualified frames and duplicate buckets create gaps. Values retain their original token-config valuation and custom-accounting limitation; they are not repriced, complete hook assets, OHLC or personal earnings. The rolling window is at most 60 days with twelve-hour buckets. The current bucket is included only if observed. A smaller limit returns the latest points with truncated=true; missing buckets refer to the full requested window. Malformed records and database/deadline failures return 503, not empty history. No RPC or write occurs.
113
+ */
114
+ get: operations["getPoolTvlHistory"];
115
+ put?: never;
116
+ post?: never;
117
+ delete?: never;
118
+ options?: never;
119
+ head?: never;
120
+ patch?: never;
121
+ trace?: never;
122
+ };
103
123
  "/v1/engine/markets/{marketId}/history": {
104
124
  parameters: {
105
125
  query?: never;
@@ -329,7 +349,7 @@ export interface paths {
329
349
  };
330
350
  /**
331
351
  * List open and closed Engine position identities for history
332
- * @description A bounded catalog retaining zero-balance lender rows and burned vaults, independent of current portfolio discovery. A lending position is closed when its indexed share balance is zero; a vault is closed only when burned. By default vaults belong to the current or last indexed owner. ownerScope=ever-owned also includes transferred-away vaults through indexed registry transfers and requires the ownership schema. No ownership epochs, valuation, PnL or wallet cash-flow claims. Ordering is vaults first, then lending, with lexical source IDs within each family. Cursors bind account, chain, limit, ownerScope, server-configured deployment and exact indexed block for ten minutes; continuation never refreshes to a newer head. All payloads and metadata are hash-pinned. This is indexer evidence, not RPC canonicality or finality. At most 50 positions, three Graph queries, a shared five-second deadline and 1 MiB upstream-response budget. More positions produce explicit partial coverage and a cursor; missing or malformed indexer data is unavailable, not an empty catalog. No history table, wallet RPC or price access. All responses are private/no-store.
352
+ * @description A bounded catalog retaining zero-balance lender rows and burned vaults, independent of current portfolio discovery. A lending position is closed when its indexed share balance is zero; a vault is closed only when burned. By default vaults belong to the current or last indexed owner. ownerScope=ever-owned also includes transferred-away vaults through indexed registry transfers and requires the ownership schema. No ownership epochs, valuation, PnL or wallet cash-flow claims. Ordering is vaults first, then lending, with lexical source IDs within each family. Select an alternate deployment by its hook; omitted hook selects the canonical deployment. Cursors bind account, chain, limit, ownerScope, selected deployment and exact indexed block for ten minutes; continuation never refreshes to a newer head. All payloads and metadata are hash-pinned. This is indexer evidence, not RPC canonicality or finality. At most 50 positions, three Graph queries, a shared five-second deadline and 1 MiB upstream-response budget. More positions produce explicit partial coverage and a cursor; missing or malformed indexer data is unavailable, not an empty catalog. No history table, wallet RPC or price access. All responses are private/no-store.
333
353
  */
334
354
  get: operations["listEngineHistoryPositions"];
335
355
  put?: never;
@@ -389,7 +409,7 @@ export interface paths {
389
409
  };
390
410
  /**
391
411
  * Discover owned Engine positions in one indexed block frame
392
- * @description Hash-pinned discovery of borrow vaults and lender shares, including hidden or unknown markets. Raw indexed amounts are not live valuation or a canonicality/finality verdict. Verify the frame hash against RPC before hydration. Coverage reports rejected malformed rows; a successful empty result is distinct from an unavailable read. Each request has a five-second deadline, a 1,000 evaluated-row cap and a 2 MiB upstream-response budget. Wallet responses are private/no-store. Rows are under coverage.positions only for complete accounts, otherwise coverage.partialPositions. Follow coverage.nextCursor for truncated reads; resumed pages remain partial and retain the original frame. Legacy positions v1/v2 schemas are unchanged.
412
+ * @description Hash-pinned discovery of borrow vaults and lender shares, including hidden or unknown markets. Select an alternate deployment by its hook; omitted hook selects the canonical deployment. Raw indexed amounts are not live valuation or a canonicality/finality verdict. Verify the frame hash against RPC before hydration. Coverage reports rejected malformed rows; a successful empty result is distinct from an unavailable read. Each request has a five-second deadline, a 1,000 evaluated-row cap and a 2 MiB upstream-response budget. Wallet responses are private/no-store. Rows are under coverage.positions only for complete accounts, otherwise coverage.partialPositions. Follow coverage.nextCursor for truncated reads; resumed pages remain partial and retain the original frame. Legacy positions v1/v2 schemas are unchanged.
393
413
  */
394
414
  get: operations["discoverEngineAccount"];
395
415
  put?: never;
@@ -966,6 +986,54 @@ export interface components {
966
986
  feesUsd: number;
967
987
  }[];
968
988
  };
989
+ /** @description Optional current pool principal composition, excluding fees. Absent for older producers; null with observations.composition.reason when the stored snapshot is unusable. A stale last-good snapshot retains its original state time; use observations.composition.stale, which is also true when the block state time is more than 15 minutes old. */
990
+ composition?: {
991
+ /** @enum {number} */
992
+ schemaVersion: 1;
993
+ /** @enum {string} */
994
+ source: "uniswap-v4-reserves-lens";
995
+ /** @enum {string} */
996
+ definition: "v4_core_pool_fee_excluded";
997
+ chainId: number;
998
+ poolId: string;
999
+ token0: {
1000
+ address: string;
1001
+ decimals: number;
1002
+ /** @description Exact unsigned principal amount in token base units; excludes fees. */
1003
+ amountRaw: string;
1004
+ };
1005
+ token1: {
1006
+ address: string;
1007
+ decimals: number;
1008
+ /** @description Exact unsigned principal amount in token base units; excludes fees. */
1009
+ amountRaw: string;
1010
+ };
1011
+ /** @description Prices used by the producer for this TVL, not independently qualified historical marks. */
1012
+ valuation: {
1013
+ /** @enum {string} */
1014
+ source: "token-config";
1015
+ token0PriceUsd: number;
1016
+ token1PriceUsd: number;
1017
+ tvlUsd: number;
1018
+ };
1019
+ /** @description State was read at a block number; the observed header is not proof of canonical state or finality. */
1020
+ observation: {
1021
+ /** Format: date-time */
1022
+ observedAt: string;
1023
+ /** @description Exact RPC block number as a canonical decimal string. */
1024
+ blockNumber: string;
1025
+ blockTimestamp: number;
1026
+ observedHeaderHash: string | null;
1027
+ /** @enum {string} */
1028
+ blockReference: "number";
1029
+ /** @enum {string} */
1030
+ headerStateConsistency: "unchecked";
1031
+ /** @enum {string} */
1032
+ finality: "unconfirmed";
1033
+ };
1034
+ /** @description Custom-accounting limitation; independent of token-price confidence. */
1035
+ approximate: boolean;
1036
+ } | null;
969
1037
  };
970
1038
  MarketV2: {
971
1039
  id: string;
@@ -1048,14 +1116,76 @@ export interface components {
1048
1116
  feesUsd: number;
1049
1117
  }[];
1050
1118
  };
1119
+ /** @description Optional current pool principal composition, excluding fees. Absent for older producers; null with observations.composition.reason when the stored snapshot is unusable. A stale last-good snapshot retains its original state time; use observations.composition.stale, which is also true when the block state time is more than 15 minutes old. */
1120
+ composition?: {
1121
+ /** @enum {number} */
1122
+ schemaVersion: 1;
1123
+ /** @enum {string} */
1124
+ source: "uniswap-v4-reserves-lens";
1125
+ /** @enum {string} */
1126
+ definition: "v4_core_pool_fee_excluded";
1127
+ chainId: number;
1128
+ poolId: string;
1129
+ token0: {
1130
+ address: string;
1131
+ decimals: number;
1132
+ /** @description Exact unsigned principal amount in token base units; excludes fees. */
1133
+ amountRaw: string;
1134
+ };
1135
+ token1: {
1136
+ address: string;
1137
+ decimals: number;
1138
+ /** @description Exact unsigned principal amount in token base units; excludes fees. */
1139
+ amountRaw: string;
1140
+ };
1141
+ /** @description Prices used by the producer for this TVL, not independently qualified historical marks. */
1142
+ valuation: {
1143
+ /** @enum {string} */
1144
+ source: "token-config";
1145
+ token0PriceUsd: number;
1146
+ token1PriceUsd: number;
1147
+ tvlUsd: number;
1148
+ };
1149
+ /** @description State was read at a block number; the observed header is not proof of canonical state or finality. */
1150
+ observation: {
1151
+ /** Format: date-time */
1152
+ observedAt: string;
1153
+ /** @description Exact RPC block number as a canonical decimal string. */
1154
+ blockNumber: string;
1155
+ blockTimestamp: number;
1156
+ observedHeaderHash: string | null;
1157
+ /** @enum {string} */
1158
+ blockReference: "number";
1159
+ /** @enum {string} */
1160
+ headerStateConsistency: "unchecked";
1161
+ /** @enum {string} */
1162
+ finality: "unconfirmed";
1163
+ };
1164
+ /** @description Custom-accounting limitation; independent of token-price confidence. */
1165
+ approximate: boolean;
1166
+ } | null;
1051
1167
  };
1052
1168
  warnings: ("paused" | "surge-active" | "cap-event" | "swap-unavailable")[];
1053
1169
  observations?: {
1054
1170
  tvl: {
1055
- /** Format: date-time */
1171
+ /**
1172
+ * Format: date-time
1173
+ * @description Qualified Lens state block time; legacy rows without block time retain their recorded observation time. Null when unknown or invalid.
1174
+ */
1056
1175
  updatedAt: string | null;
1057
1176
  stale: boolean;
1058
1177
  };
1178
+ composition?: {
1179
+ /**
1180
+ * Format: date-time
1181
+ * @description Normalized blockTimestamp state time; the snapshot observedAt is the separate fetch receipt.
1182
+ */
1183
+ updatedAt: string | null;
1184
+ /** @description True when the producer flagged the paired TVL stale, or when the block state time is more than 15 minutes older than the API read time. A stale snapshot keeps its values and state time. */
1185
+ stale: boolean;
1186
+ /** @enum {string} */
1187
+ reason?: "invalid-composition" | "inconsistent-composition" | "tvl-unavailable";
1188
+ };
1059
1189
  };
1060
1190
  };
1061
1191
  MarketListV2: {
@@ -1139,16 +1269,131 @@ export interface components {
1139
1269
  feesUsd: number;
1140
1270
  }[];
1141
1271
  };
1272
+ /** @description Optional current pool principal composition, excluding fees. Absent for older producers; null with observations.composition.reason when the stored snapshot is unusable. A stale last-good snapshot retains its original state time; use observations.composition.stale, which is also true when the block state time is more than 15 minutes old. */
1273
+ composition?: {
1274
+ /** @enum {number} */
1275
+ schemaVersion: 1;
1276
+ /** @enum {string} */
1277
+ source: "uniswap-v4-reserves-lens";
1278
+ /** @enum {string} */
1279
+ definition: "v4_core_pool_fee_excluded";
1280
+ chainId: number;
1281
+ poolId: string;
1282
+ token0: {
1283
+ address: string;
1284
+ decimals: number;
1285
+ /** @description Exact unsigned principal amount in token base units; excludes fees. */
1286
+ amountRaw: string;
1287
+ };
1288
+ token1: {
1289
+ address: string;
1290
+ decimals: number;
1291
+ /** @description Exact unsigned principal amount in token base units; excludes fees. */
1292
+ amountRaw: string;
1293
+ };
1294
+ /** @description Prices used by the producer for this TVL, not independently qualified historical marks. */
1295
+ valuation: {
1296
+ /** @enum {string} */
1297
+ source: "token-config";
1298
+ token0PriceUsd: number;
1299
+ token1PriceUsd: number;
1300
+ tvlUsd: number;
1301
+ };
1302
+ /** @description State was read at a block number; the observed header is not proof of canonical state or finality. */
1303
+ observation: {
1304
+ /** Format: date-time */
1305
+ observedAt: string;
1306
+ /** @description Exact RPC block number as a canonical decimal string. */
1307
+ blockNumber: string;
1308
+ blockTimestamp: number;
1309
+ observedHeaderHash: string | null;
1310
+ /** @enum {string} */
1311
+ blockReference: "number";
1312
+ /** @enum {string} */
1313
+ headerStateConsistency: "unchecked";
1314
+ /** @enum {string} */
1315
+ finality: "unconfirmed";
1316
+ };
1317
+ /** @description Custom-accounting limitation; independent of token-price confidence. */
1318
+ approximate: boolean;
1319
+ } | null;
1142
1320
  };
1143
1321
  warnings: ("paused" | "surge-active" | "cap-event" | "swap-unavailable")[];
1144
1322
  observations?: {
1145
1323
  tvl: {
1146
- /** Format: date-time */
1324
+ /**
1325
+ * Format: date-time
1326
+ * @description Qualified Lens state block time; legacy rows without block time retain their recorded observation time. Null when unknown or invalid.
1327
+ */
1147
1328
  updatedAt: string | null;
1148
1329
  stale: boolean;
1149
1330
  };
1331
+ composition?: {
1332
+ /**
1333
+ * Format: date-time
1334
+ * @description Normalized blockTimestamp state time; the snapshot observedAt is the separate fetch receipt.
1335
+ */
1336
+ updatedAt: string | null;
1337
+ /** @description True when the producer flagged the paired TVL stale, or when the block state time is more than 15 minutes older than the API read time. A stale snapshot keeps its values and state time. */
1338
+ stale: boolean;
1339
+ /** @enum {string} */
1340
+ reason?: "invalid-composition" | "inconsistent-composition" | "tvl-unavailable";
1341
+ };
1150
1342
  };
1151
1343
  }[];
1344
+ PoolTvlHistoryResponse: {
1345
+ /** @enum {string} */
1346
+ schemaVersion: "1";
1347
+ marketId: string;
1348
+ /** @enum {string} */
1349
+ resolution: "12h";
1350
+ /** @enum {string} */
1351
+ window: "7d" | "30d" | "60d";
1352
+ /** @enum {string} */
1353
+ status: "ready" | "partial" | "no_data";
1354
+ pointCount: number;
1355
+ points: {
1356
+ t: number;
1357
+ tvlUsd: number;
1358
+ observation: {
1359
+ /** @enum {number} */
1360
+ policyVersion: 1;
1361
+ /** @enum {string} */
1362
+ source: "uniswap-v4-reserves-lens";
1363
+ /** @enum {string} */
1364
+ definition: "v4_core_pool_fee_excluded";
1365
+ /** Format: date-time */
1366
+ observedAt: string;
1367
+ blockNumber: string;
1368
+ blockTimestamp: number;
1369
+ approximate: boolean;
1370
+ /** @enum {string} */
1371
+ priceSource: "token-config";
1372
+ };
1373
+ }[];
1374
+ /** Format: date-time */
1375
+ updatedAt: string | null;
1376
+ coverage: {
1377
+ requestedFrom: number;
1378
+ requestedTo: number;
1379
+ fromBucket: number;
1380
+ throughBucket: number;
1381
+ expectedBucketCount: number;
1382
+ firstObservedBucket: number | null;
1383
+ lastObservedBucket: number | null;
1384
+ presentBucketCount: number;
1385
+ missingBuckets: number[];
1386
+ invalidPointCount: number;
1387
+ legacyPointCount: number;
1388
+ truncated: boolean;
1389
+ };
1390
+ };
1391
+ PoolTvlHistoryReadFailure: {
1392
+ /** @enum {string} */
1393
+ error: "Pool TVL history temporarily unavailable";
1394
+ /** @enum {string} */
1395
+ code: "tvl-history-read-timeout" | "tvl-history-read-unavailable" | "tvl-history-invalid-record" | "tvl-history-budget-exceeded";
1396
+ };
1152
1397
  EngineToken: {
1153
1398
  /**
1154
1399
  * @example 4663
@@ -7337,6 +7582,44 @@ export interface operations {
7337
7582
  500: components["responses"]["ServerError"];
7338
7583
  };
7339
7584
  };
7585
+ getPoolTvlHistory: {
7586
+ parameters: {
7587
+ query?: {
7588
+ window?: "7d" | "30d" | "60d";
7589
+ limit?: number;
7590
+ };
7591
+ header?: never;
7592
+ path: {
7593
+ /** @description Exact case-sensitive historical record ID from market discovery; no case normalization. */
7594
+ marketId: string;
7595
+ };
7596
+ cookie?: never;
7597
+ };
7598
+ requestBody?: never;
7599
+ responses: {
7600
+ /** @description Observed TVL with actual coverage and gaps */
7601
+ 200: {
7602
+ headers: {
7603
+ [name: string]: unknown;
7604
+ };
7605
+ content: {
7606
+ "application/json": components["schemas"]["PoolTvlHistoryResponse"];
7607
+ };
7608
+ };
7609
+ 400: components["responses"]["BadRequest"];
7610
+ /** @description Bounded history read unavailable */
7611
+ 503: {
7612
+ headers: {
7613
+ "Retry-After"?: "5";
7614
+ "Cache-Control"?: "no-store";
7615
+ [name: string]: unknown;
7616
+ };
7617
+ content: {
7618
+ "application/json": components["schemas"]["PoolTvlHistoryReadFailure"];
7619
+ };
7620
+ };
7621
+ };
7622
+ };
7340
7623
  getEngineMarketHistory: {
7341
7624
  parameters: {
7342
7625
  query?: {
@@ -7816,9 +8099,11 @@ export interface operations {
7816
8099
  * @example 0x8a5c4fa037a583b057be7a46e7e94ec496702f25
7817
8100
  */
7818
8101
  account: components["parameters"]["AccountQuery"];
8102
+ /** @description Aegis hook selecting an Engine deployment. Omit for the canonical deployment. */
8103
+ hook?: string;
7819
8104
  limit?: number;
7820
8105
  ownerScope?: "current-or-last" | "ever-owned";
7821
- /** @description Opaque continuation returned by this catalog; preserve account, chainId, limit and ownerScope. */
8106
+ /** @description Opaque continuation returned by this catalog; preserve account, chainId, hook, limit and ownerScope. */
7822
8107
  cursor?: string;
7823
8108
  };
7824
8109
  header?: never;
@@ -7871,6 +8156,8 @@ export interface operations {
7871
8156
  chainId: "1" | "56" | "130" | "8453" | "4663" | "57073";
7872
8157
  account: string;
7873
8158
  poolId: string;
8159
+ /** @description Aegis hook selecting an Engine deployment. Omit for the canonical deployment. */
8160
+ hook?: string;
7874
8161
  kind: "lend_shares" | "borrow_vault";
7875
8162
  /** @description Required only for borrow_vault. */
7876
8163
  vaultId?: string;
@@ -7944,6 +8231,8 @@ export interface operations {
7944
8231
  */
7945
8232
  account: components["parameters"]["AccountQuery"];
7946
8233
  poolId: string;
8234
+ /** @description Aegis hook selecting an Engine deployment. Omit for the canonical deployment. */
8235
+ hook?: string;
7947
8236
  kind: "lend_shares" | "borrow_vault";
7948
8237
  /** @description Required only for borrow_vault. */
7949
8238
  vaultId?: string;
@@ -7991,6 +8280,8 @@ export interface operations {
7991
8280
  * @example 0x8a5c4fa037a583b057be7a46e7e94ec496702f25
7992
8281
  */
7993
8282
  account: components["parameters"]["AccountQuery"];
8283
+ /** @description Aegis hook selecting an Engine deployment. Omit for the canonical deployment. */
8284
+ hook?: string;
7994
8285
  /** @description Opaque page selector from coverage.nextCursor. Bound to wallet, chain, deployment and indexed frame. */
7995
8286
  cursor?: string;
7996
8287
  };
@@ -8062,6 +8353,8 @@ export interface operations {
8062
8353
  * @example 8453,4663
8063
8354
  */
8064
8355
  chainIds: string;
8356
+ /** @description Select an alternate Engine deployment by hook. Requires a single chain; omitted for canonical deployment. */
8357
+ hook?: string;
8065
8358
  limit?: number;
8066
8359
  /** @description Opaque continuation; reuse the original account, chains and limit. */
8067
8360
  cursor?: string;
@@ -8120,6 +8413,8 @@ export interface operations {
8120
8413
  account: components["parameters"]["AccountQuery"];
8121
8414
  /** @description Portfolio chain set including the transaction chain. Defaults to only the transaction chain. */
8122
8415
  chainIds?: string;
8416
+ /** @description Select an Engine deployment by hook. Requires a single-chain portfolio; omitted for the canonical deployment. */
8417
+ hook?: string;
8123
8418
  /** @description Previously observed receipt block; provide together with observedBlockHash. */
8124
8419
  observedBlockNumber?: string;
8125
8420
  observedBlockHash?: string;
@@ -8188,6 +8483,8 @@ export interface operations {
8188
8483
  * @example 0x8a5c4fa037a583b057be7a46e7e94ec496702f25
8189
8484
  */
8190
8485
  account: components["parameters"]["AccountQuery"];
8486
+ /** @description Select an Engine deployment by hook; omitted for the canonical deployment. */
8487
+ hook?: string;
8191
8488
  };
8192
8489
  header?: never;
8193
8490
  path: {
@@ -8253,6 +8550,8 @@ export interface operations {
8253
8550
  kind: "borrow_vault";
8254
8551
  vaultId: string;
8255
8552
  snapshotId: string;
8553
+ /** @description Use the same deployment hook as the accounting snapshot; omitted for the canonical deployment. */
8554
+ hook?: string;
8256
8555
  };
8257
8556
  header?: never;
8258
8557
  path?: never;
@@ -8324,6 +8623,8 @@ export interface operations {
8324
8623
  kind: "borrow_vault";
8325
8624
  vaultId: string;
8326
8625
  snapshotId: string;
8626
+ /** @description Use the same deployment hook as the accounting and portfolio snapshots; omitted for the canonical deployment. */
8627
+ hook?: string;
8327
8628
  /** @description Required for open positions; capture portfolio before accounting. */
8328
8629
  portfolioSnapshotId?: string;
8329
8630
  };
@@ -8393,6 +8694,8 @@ export interface operations {
8393
8694
  * @example 8453,4663
8394
8695
  */
8395
8696
  chainIds: string;
8697
+ /** @description Select an Engine deployment by hook. Requires one chain; omitted for the canonical deployment. */
8698
+ hook?: string;
8396
8699
  };
8397
8700
  header?: never;
8398
8701
  path?: never;
@@ -8451,6 +8754,8 @@ export interface operations {
8451
8754
  * @example 8453,4663
8452
8755
  */
8453
8756
  chainIds: string;
8757
+ /** @description Select an Engine deployment by hook. Requires one chain; omitted for the canonical deployment. */
8758
+ hook?: string;
8454
8759
  snapshotId: string;
8455
8760
  /** @description Opaque continuation bound to the snapshot and page limit. */
8456
8761
  cursor?: string;