@aegis-engine/core 0.11.0 → 0.13.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.
@@ -47,7 +47,10 @@ export interface paths {
47
47
  path?: never;
48
48
  cookie?: never;
49
49
  };
50
- /** List curated tokens for a chain */
50
+ /**
51
+ * List curated tokens for a chain
52
+ * @description Returns curated token metadata, including priceUsd, for the chain. Responses are shared-cacheable for 60 seconds with a 60-second stale-while-revalidate window, so priceUsd can lag the price writer by about two minutes.
53
+ */
51
54
  get: operations["listTokens"];
52
55
  put?: never;
53
56
  post?: never;
@@ -66,7 +69,7 @@ export interface paths {
66
69
  };
67
70
  /**
68
71
  * List curated tokens by address
69
- * @description Filters curated token metadata to the requested comma-separated EVM token addresses. Matching is case-insensitive and unknown addresses are omitted.
72
+ * @description Filters curated token metadata to the requested comma-separated EVM token addresses. Matching is case-insensitive and unknown addresses are omitted. Responses are shared-cacheable for 60 seconds with a 60-second stale-while-revalidate window, so priceUsd can lag the price writer by about two minutes.
70
73
  */
71
74
  get: operations["listTokensByAddress"];
72
75
  put?: never;
@@ -166,7 +169,7 @@ export interface paths {
166
169
  };
167
170
  /**
168
171
  * Get pool candles or a labelled token reference line
169
- * @description Returns processor-owned Uniswap v4 pair candles for 1d, 7d, 30d, 90d, or 180d. The 1d window uses exact five-minute Swap-event candles. The 7d window uses copied Uniswap PoolHourData; 30d, 90d, and 180d use copied PoolDayData. Prices remain canonical token1 per token0 (quote_per_base). Exact five-minute rows expose swapCount and first/last swap provenance. Upstream aggregate rows expose txCount under its real meaning and may include volumeUSD, feesUSD, and tvlUSD. Dense five-minute coverage reports missing stored buckets as indexing gaps. Sparse upstream series treat absent keys as quiet intervals; malformed stored rows are dropped and reported as invalid_row gaps. Metadata absence returns 404. HTTP 200 and metadata-absent 404 responses are shared-cacheable for 30 seconds. This display series is not an execution quote or transaction input. The Lambda does not call a subgraph or RPC. basis=token_market_reference explicitly selects a display-only line of matching TokenHourData or TokenDayData close ratios for 7d/30d/90d/180d. The reference has no 1d/5m series, no pair OHLC, and no automatic fallback. Component close trades need not be simultaneous. Historical venue independence is unknown and must not be presented as independent fair value.
172
+ * @description Returns processor-owned Uniswap v4 pair candles for 1d, 7d, 30d, 90d, or 180d. The 1d window uses exact five-minute Swap-event candles. By default, the 7d window uses copied Uniswap PoolHourData; 30d, 90d, and 180d use copied PoolDayData. aggregation=exact_swaps explicitly selects qualified dense PoolManager RPC rollups for those longer windows, retaining swapCount and first/last swap provenance with no copied USD fields. Without that parameter, longer RPC rollups are unavailable to preserve existing client validators. A requested representation that is not stored returns 404 before reading buckets, with no automatic source substitution. Prices remain canonical token1 per token0 (quote_per_base). Exact five-minute rows expose swapCount and first/last swap provenance. Upstream aggregate rows expose txCount under its real meaning and may include volumeUSD, feesUSD, and tvlUSD. Dense exact-swap coverage reports missing stored buckets as indexing gaps. Sparse upstream series treat absent keys as quiet intervals; malformed stored rows are dropped and reported as invalid_row gaps. Metadata or requested-representation absence returns 404. HTTP 200 and metadata-absent 404 responses are shared-cacheable for 30 seconds. This display series is not an execution quote or transaction input. The Lambda does not call a subgraph or RPC. basis=token_market_reference explicitly selects a display-only line of matching TokenHourData or TokenDayData close ratios for 7d/30d/90d/180d. The reference has no 1d/5m series, no pair OHLC, and no automatic fallback. Component close trades need not be simultaneous. Historical venue independence is unknown and must not be presented as independent fair value.
170
173
  */
171
174
  get: operations["getEngineMarketCandles"];
172
175
  put?: never;
@@ -206,7 +209,7 @@ export interface paths {
206
209
  };
207
210
  /**
208
211
  * List curated Aegis v4 pools with explicit metric availability
209
- * @description Opt-in market reads for all curated-data chains. Unavailable or unproven metrics are null; measured zero remains zero. TVL availability is independent of rolling history. A retained Lens TVL marked stale keeps its last value; observations.tvl reports its source time (null when unknown) and the recorded stale flag (any recorded value other than false is stale), not an age-based freshness verdict. observations is optional and additive: clients must tolerate its absence. Fee APR and indexed history require explicit v4HistoryAvailable=true or, when the flag is absent, v4-subgraph provenance. Ink volume can independently use qualified first-party PoolManager RPC volume (producer policy version 1, window end at most three hours old); its USD valuation is an estimate, unqualified values remain null, and it does not enable fee APR. Frozen /v1/markets serves the same qualified Ink volume, else 0. Data-only chains return disabled swap status and swap-unavailable; this route does not enable quoting or execution. Swap status requires a visible, unpaused market; on Ink it also requires a positive recorded uint128 V4 liquidity snapshot. feeApr7d is annualized percentage points and dynamic-fee APR is an estimate, not realized LP earnings. Existing core clients must continue using /v1/markets until they support this nullable contract.
212
+ * @description Opt-in market reads for all curated-data chains. Unavailable or unproven metrics are null; measured zero remains zero. TVL availability is independent of rolling history. A retained Lens TVL marked stale keeps its last value; observations.tvl reports its source time (null when unknown) and the recorded stale flag (any recorded value other than false is stale), not an age-based freshness verdict. observations is optional and additive: clients must tolerate its absence. Indexed fee APR and history require explicit v4HistoryAvailable=true or, when the flag is absent, v4-subgraph provenance. Ink volume can independently use qualified first-party PoolManager RPC volume (producer policy version 1, window end at most three hours old); its USD valuation is an estimate, unqualified values remain null, and it does not enable fee APR. Optional metrics.flowHistory adds processor-recorded Uniswap LiquidityService analytics on Ink: policyVersion 1, matching chain/pool identity, seven complete UTC daily volumeUsd/feesUsd points and their sums, windowStart/windowEnd/resolution in Unix seconds, and asOf as provider fetch time (not an indexed head or canonicality proof). The current completed seven-day window ending at today UTC midnight and fetched within three hours is admitted; before 00:30 UTC, the immediately previous window is also admitted with its actual dates unchanged and the same fetch-age limit. Malformed, stale or incomplete history is omitted without hiding TVL. This adds no polling. Charts use flowHistory.volumeUsd and its daily points. Both market versions retain rolling 168h indexed/RPC volumeUsd7d; daily history never overrides a rolling positive, zero or unavailable value (0 in frozen v1, null in v2). Fees are provider USD estimates, not verified LP earnings. Without indexed history, feeApr7d may derive from flowHistory; see metrics.feeApr7dSource. Provider flow history is v2-only. Data-only chains return disabled swap status and swap-unavailable; this route does not enable quoting or execution. Swap status requires a visible, unpaused market; on Ink it also requires a positive recorded uint128 V4 liquidity snapshot. feeApr7d is annualized percentage points and dynamic-fee APR is an estimate, not realized LP earnings. Existing core clients must continue using /v1/markets until they support this nullable contract.
210
213
  */
211
214
  get: operations["listMarketsV2"];
212
215
  put?: never;
@@ -912,7 +915,57 @@ export interface components {
912
915
  MarketMetricsV2: {
913
916
  tvlUsd: number | null;
914
917
  volumeUsd7d: number | null;
918
+ /** @description Annualized percentage points (12.3 means 12.3%). From indexed history when available; otherwise derived from flowHistory (see feeApr7dSource). An estimate, not realized LP earnings. Null when unavailable; measured zero stays zero. */
915
919
  feeApr7d: number | null;
920
+ /**
921
+ * @description Present only when feeApr7d is derived from flowHistory: its feesUsd over windowStart..windowEnd annualized over non-stale, dated Lens TVL, in percentage points: feesUsd / 7 * 365 / tvlUsd * 100. Gross pool fees (including any protocol share) over current TVL, so a pool whose TVL changed during the window can be skewed. Absent, with feeApr7d null, for stale, undated, future-dated, unavailable or zero TVL, or a rate above 1000 (withheld as implausible); also absent when feeApr7d comes from indexed history.
922
+ * @enum {string}
923
+ */
924
+ feeApr7dSource?: "flow-history";
925
+ /** @description Optional Ink daily volume and fee history from Uniswap provider analytics over the last seven completed UTC days. Omitted when unavailable, stale, malformed or incomplete. Provider estimates; does not affect volumeUsd7d. Without indexed history, its feesUsd derives feeApr7d (see feeApr7dSource). */
926
+ flowHistory?: {
927
+ /**
928
+ * @description Ink chain ID.
929
+ * @enum {number}
930
+ */
931
+ chainId: 57073;
932
+ /** @description Uniswap v4 pool ID (bytes32 PoolKey hash). */
933
+ poolId: string;
934
+ /**
935
+ * @description Uniswap LiquidityService pool history, recorded by the processor.
936
+ * @enum {string}
937
+ */
938
+ source: "uniswap-liquidity-service";
939
+ /**
940
+ * @description Producer policy version; consumers gate on this value.
941
+ * @enum {number}
942
+ */
943
+ policyVersion: 1;
944
+ /** @description Unix seconds when the processor fetched the provider. A fetch time, not an indexed chain head or completeness proof; admitted for at most three hours. */
945
+ asOf: number;
946
+ /** @description Inclusive window start in Unix seconds (UTC midnight), windowEnd minus seven days. */
947
+ windowStart: number;
948
+ /** @description Exclusive window end in Unix seconds: the UTC midnight ending the last completed day. Today is excluded. The current window is admitted, plus the previous one before 00:30 UTC. */
949
+ windowEnd: number;
950
+ /**
951
+ * @description Seconds per daily point (86400).
952
+ * @enum {number}
953
+ */
954
+ resolution: 86400;
955
+ /** @description Sum of the seven daily volumeUsd points. Uniswap provider estimate of swap volume in USD (historical analytics valuation). Separate from the rolling 168-hour volumeUsd7d. */
956
+ volumeUsd: number;
957
+ /** @description Sum of the seven daily feesUsd points. Uniswap provider estimate of swap fees in USD, including any protocol share; not LP fees, wallet earnings or APR. */
958
+ feesUsd: number;
959
+ /** @description Seven contiguous completed UTC days, oldest first, from windowStart. */
960
+ daily: {
961
+ /** @description UTC midnight starting this day, in Unix seconds. */
962
+ timestamp: number;
963
+ /** @description Uniswap provider estimate of swap volume in USD (historical analytics valuation). */
964
+ volumeUsd: number;
965
+ /** @description Uniswap provider estimate of swap fees in USD, including any protocol share; not LP fees, wallet earnings or APR. */
966
+ feesUsd: number;
967
+ }[];
968
+ };
916
969
  };
917
970
  MarketV2: {
918
971
  id: string;
@@ -944,7 +997,57 @@ export interface components {
944
997
  metrics: {
945
998
  tvlUsd: number | null;
946
999
  volumeUsd7d: number | null;
1000
+ /** @description Annualized percentage points (12.3 means 12.3%). From indexed history when available; otherwise derived from flowHistory (see feeApr7dSource). An estimate, not realized LP earnings. Null when unavailable; measured zero stays zero. */
947
1001
  feeApr7d: number | null;
1002
+ /**
1003
+ * @description Present only when feeApr7d is derived from flowHistory: its feesUsd over windowStart..windowEnd annualized over non-stale, dated Lens TVL, in percentage points: feesUsd / 7 * 365 / tvlUsd * 100. Gross pool fees (including any protocol share) over current TVL, so a pool whose TVL changed during the window can be skewed. Absent, with feeApr7d null, for stale, undated, future-dated, unavailable or zero TVL, or a rate above 1000 (withheld as implausible); also absent when feeApr7d comes from indexed history.
1004
+ * @enum {string}
1005
+ */
1006
+ feeApr7dSource?: "flow-history";
1007
+ /** @description Optional Ink daily volume and fee history from Uniswap provider analytics over the last seven completed UTC days. Omitted when unavailable, stale, malformed or incomplete. Provider estimates; does not affect volumeUsd7d. Without indexed history, its feesUsd derives feeApr7d (see feeApr7dSource). */
1008
+ flowHistory?: {
1009
+ /**
1010
+ * @description Ink chain ID.
1011
+ * @enum {number}
1012
+ */
1013
+ chainId: 57073;
1014
+ /** @description Uniswap v4 pool ID (bytes32 PoolKey hash). */
1015
+ poolId: string;
1016
+ /**
1017
+ * @description Uniswap LiquidityService pool history, recorded by the processor.
1018
+ * @enum {string}
1019
+ */
1020
+ source: "uniswap-liquidity-service";
1021
+ /**
1022
+ * @description Producer policy version; consumers gate on this value.
1023
+ * @enum {number}
1024
+ */
1025
+ policyVersion: 1;
1026
+ /** @description Unix seconds when the processor fetched the provider. A fetch time, not an indexed chain head or completeness proof; admitted for at most three hours. */
1027
+ asOf: number;
1028
+ /** @description Inclusive window start in Unix seconds (UTC midnight), windowEnd minus seven days. */
1029
+ windowStart: number;
1030
+ /** @description Exclusive window end in Unix seconds: the UTC midnight ending the last completed day. Today is excluded. The current window is admitted, plus the previous one before 00:30 UTC. */
1031
+ windowEnd: number;
1032
+ /**
1033
+ * @description Seconds per daily point (86400).
1034
+ * @enum {number}
1035
+ */
1036
+ resolution: 86400;
1037
+ /** @description Sum of the seven daily volumeUsd points. Uniswap provider estimate of swap volume in USD (historical analytics valuation). Separate from the rolling 168-hour volumeUsd7d. */
1038
+ volumeUsd: number;
1039
+ /** @description Sum of the seven daily feesUsd points. Uniswap provider estimate of swap fees in USD, including any protocol share; not LP fees, wallet earnings or APR. */
1040
+ feesUsd: number;
1041
+ /** @description Seven contiguous completed UTC days, oldest first, from windowStart. */
1042
+ daily: {
1043
+ /** @description UTC midnight starting this day, in Unix seconds. */
1044
+ timestamp: number;
1045
+ /** @description Uniswap provider estimate of swap volume in USD (historical analytics valuation). */
1046
+ volumeUsd: number;
1047
+ /** @description Uniswap provider estimate of swap fees in USD, including any protocol share; not LP fees, wallet earnings or APR. */
1048
+ feesUsd: number;
1049
+ }[];
1050
+ };
948
1051
  };
949
1052
  warnings: ("paused" | "surge-active" | "cap-event" | "swap-unavailable")[];
950
1053
  observations?: {
@@ -985,7 +1088,57 @@ export interface components {
985
1088
  metrics: {
986
1089
  tvlUsd: number | null;
987
1090
  volumeUsd7d: number | null;
1091
+ /** @description Annualized percentage points (12.3 means 12.3%). From indexed history when available; otherwise derived from flowHistory (see feeApr7dSource). An estimate, not realized LP earnings. Null when unavailable; measured zero stays zero. */
988
1092
  feeApr7d: number | null;
1093
+ /**
1094
+ * @description Present only when feeApr7d is derived from flowHistory: its feesUsd over windowStart..windowEnd annualized over non-stale, dated Lens TVL, in percentage points: feesUsd / 7 * 365 / tvlUsd * 100. Gross pool fees (including any protocol share) over current TVL, so a pool whose TVL changed during the window can be skewed. Absent, with feeApr7d null, for stale, undated, future-dated, unavailable or zero TVL, or a rate above 1000 (withheld as implausible); also absent when feeApr7d comes from indexed history.
1095
+ * @enum {string}
1096
+ */
1097
+ feeApr7dSource?: "flow-history";
1098
+ /** @description Optional Ink daily volume and fee history from Uniswap provider analytics over the last seven completed UTC days. Omitted when unavailable, stale, malformed or incomplete. Provider estimates; does not affect volumeUsd7d. Without indexed history, its feesUsd derives feeApr7d (see feeApr7dSource). */
1099
+ flowHistory?: {
1100
+ /**
1101
+ * @description Ink chain ID.
1102
+ * @enum {number}
1103
+ */
1104
+ chainId: 57073;
1105
+ /** @description Uniswap v4 pool ID (bytes32 PoolKey hash). */
1106
+ poolId: string;
1107
+ /**
1108
+ * @description Uniswap LiquidityService pool history, recorded by the processor.
1109
+ * @enum {string}
1110
+ */
1111
+ source: "uniswap-liquidity-service";
1112
+ /**
1113
+ * @description Producer policy version; consumers gate on this value.
1114
+ * @enum {number}
1115
+ */
1116
+ policyVersion: 1;
1117
+ /** @description Unix seconds when the processor fetched the provider. A fetch time, not an indexed chain head or completeness proof; admitted for at most three hours. */
1118
+ asOf: number;
1119
+ /** @description Inclusive window start in Unix seconds (UTC midnight), windowEnd minus seven days. */
1120
+ windowStart: number;
1121
+ /** @description Exclusive window end in Unix seconds: the UTC midnight ending the last completed day. Today is excluded. The current window is admitted, plus the previous one before 00:30 UTC. */
1122
+ windowEnd: number;
1123
+ /**
1124
+ * @description Seconds per daily point (86400).
1125
+ * @enum {number}
1126
+ */
1127
+ resolution: 86400;
1128
+ /** @description Sum of the seven daily volumeUsd points. Uniswap provider estimate of swap volume in USD (historical analytics valuation). Separate from the rolling 168-hour volumeUsd7d. */
1129
+ volumeUsd: number;
1130
+ /** @description Sum of the seven daily feesUsd points. Uniswap provider estimate of swap fees in USD, including any protocol share; not LP fees, wallet earnings or APR. */
1131
+ feesUsd: number;
1132
+ /** @description Seven contiguous completed UTC days, oldest first, from windowStart. */
1133
+ daily: {
1134
+ /** @description UTC midnight starting this day, in Unix seconds. */
1135
+ timestamp: number;
1136
+ /** @description Uniswap provider estimate of swap volume in USD (historical analytics valuation). */
1137
+ volumeUsd: number;
1138
+ /** @description Uniswap provider estimate of swap fees in USD, including any protocol share; not LP fees, wallet earnings or APR. */
1139
+ feesUsd: number;
1140
+ }[];
1141
+ };
989
1142
  };
990
1143
  warnings: ("paused" | "surge-active" | "cap-event" | "swap-unavailable")[];
991
1144
  observations?: {
@@ -7098,6 +7251,7 @@ export interface operations {
7098
7251
  /** @description Curated token metadata */
7099
7252
  200: {
7100
7253
  headers: {
7254
+ "Cache-Control"?: "public, max-age=60, stale-while-revalidate=60";
7101
7255
  [name: string]: unknown;
7102
7256
  };
7103
7257
  content: {
@@ -7132,6 +7286,7 @@ export interface operations {
7132
7286
  /** @description Curated token metadata */
7133
7287
  200: {
7134
7288
  headers: {
7289
+ "Cache-Control"?: "public, max-age=60, stale-while-revalidate=60";
7135
7290
  [name: string]: unknown;
7136
7291
  };
7137
7292
  content: {
@@ -7294,6 +7449,8 @@ export interface operations {
7294
7449
  window?: components["parameters"]["EngineCandleWindowQuery"];
7295
7450
  /** @description pool is the default. token_market_reference selects a display-only line of matching hourly/daily token USD close ratios for 7d/30d/90d/180d; 1d is unsupported. No automatic fallback. */
7296
7451
  basis?: components["parameters"]["EngineCandleBasisQuery"];
7452
+ /** @description Opt into exact swap candles. For 7d/30d/90d/180d, requires qualified dense pool_manager_rpc rollups; absent keeps copied Uniswap semantics. Existing exact 1d/5m remains unchanged. Incompatible with token_market_reference. Never synthesizes OHLC for quiet buckets. */
7453
+ aggregation?: "exact_swaps";
7297
7454
  /** @description price_line opts into a versioned envelope with the unchanged history response and verified price-hold segments. Only pool/1d is supported. No value is inferred before a retained close or verified pool-state checkpoint; seed lookback is bounded to one additional day. */
7298
7455
  format?: "candles" | "price_line";
7299
7456
  };
@@ -7711,7 +7868,7 @@ export interface operations {
7711
7868
  getEnginePositionAccounting: {
7712
7869
  parameters: {
7713
7870
  query: {
7714
- chainId: "1" | "56" | "130" | "8453" | "4663";
7871
+ chainId: "1" | "56" | "130" | "8453" | "4663" | "57073";
7715
7872
  account: string;
7716
7873
  poolId: string;
7717
7874
  kind: "lend_shares" | "borrow_vault";
@@ -7901,7 +8058,7 @@ export interface operations {
7901
8058
  */
7902
8059
  account: components["parameters"]["AccountQuery"];
7903
8060
  /**
7904
- * @description One to five distinct supported chains; order is normalized.
8061
+ * @description One to six distinct supported chains, including Ink (57073); order is normalized.
7905
8062
  * @example 8453,4663
7906
8063
  */
7907
8064
  chainIds: string;
@@ -7969,7 +8126,7 @@ export interface operations {
7969
8126
  };
7970
8127
  header?: never;
7971
8128
  path: {
7972
- chainId: 1 | 56 | 130 | 8453 | 4663;
8129
+ chainId: 1 | 56 | 130 | 8453 | 4663 | 57073;
7973
8130
  txHash: string;
7974
8131
  };
7975
8132
  cookie?: never;
@@ -8034,7 +8191,7 @@ export interface operations {
8034
8191
  };
8035
8192
  header?: never;
8036
8193
  path: {
8037
- chainId: 1 | 56 | 130 | 8453 | 4663;
8194
+ chainId: 1 | 56 | 130 | 8453 | 4663 | 57073;
8038
8195
  txHash: string;
8039
8196
  };
8040
8197
  cookie?: never;
@@ -8232,7 +8389,7 @@ export interface operations {
8232
8389
  */
8233
8390
  account: components["parameters"]["AccountQuery"];
8234
8391
  /**
8235
- * @description One to five distinct supported chains, comma separated: 1,56,130,8453,4663. Order is normalized.
8392
+ * @description One to six distinct supported chains, comma separated: 1,56,130,8453,4663,57073. Order is normalized.
8236
8393
  * @example 8453,4663
8237
8394
  */
8238
8395
  chainIds: string;
@@ -8290,7 +8447,7 @@ export interface operations {
8290
8447
  */
8291
8448
  account: components["parameters"]["AccountQuery"];
8292
8449
  /**
8293
- * @description One to five distinct supported chains, comma separated: 1,56,130,8453,4663. Order is normalized.
8450
+ * @description One to six distinct supported chains, comma separated: 1,56,130,8453,4663,57073. Order is normalized.
8294
8451
  * @example 8453,4663
8295
8452
  */
8296
8453
  chainIds: string;