@gearbox-protocol/sdk 18.2.0-next.1 → 18.2.0-next.10

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.
Files changed (81) hide show
  1. package/dist/cjs/abi/compressors/subcompressors/liquidation/treehouseLiquidationSubcompressor.js +179 -0
  2. package/dist/cjs/abi/compressors/subcompressors/withdrawal/treehouseWithdrawalSubcompressor.js +534 -0
  3. package/dist/cjs/abi/router/treehouseWorker.js +885 -0
  4. package/dist/cjs/onchain/market/adapters/abi/actionAbi.js +1 -0
  5. package/dist/cjs/onchain/market/adapters/abi/conctructorAbi.js +3 -0
  6. package/dist/cjs/onchain/market/adapters/types.js +3 -0
  7. package/dist/cjs/permissionless/api/oracles/PermissionlessOracles.js +397 -50
  8. package/dist/cjs/permissionless/api/oracles/enrich.js +99 -0
  9. package/dist/cjs/permissionless/api/oracles/schemas.js +85 -35
  10. package/dist/cjs/permissionless/api/schemas.js +0 -3
  11. package/dist/cjs/permissionless/bindings/index.js +1 -1
  12. package/dist/cjs/permissionless/index.js +2 -1
  13. package/dist/cjs/permissionless/utils/index.js +1 -0
  14. package/dist/cjs/permissionless/utils/price-update/get-prices.js +25 -0
  15. package/dist/cjs/permissionless/utils/price-update/index.js +1 -0
  16. package/dist/cjs/testnets/TestnetsAPI.js +179 -0
  17. package/dist/cjs/testnets/errors/TestnetNotFoundError.js +15 -0
  18. package/dist/cjs/testnets/errors/TestnetRequestFailedError.js +24 -0
  19. package/dist/cjs/testnets/errors/TestnetStatusError.js +19 -0
  20. package/dist/cjs/testnets/errors/TestnetValidationError.js +24 -0
  21. package/dist/cjs/testnets/errors/TestnetWaitTimeoutError.js +30 -0
  22. package/dist/cjs/testnets/errors/TestnetsError.js +34 -0
  23. package/dist/cjs/testnets/errors/index.js +13 -0
  24. package/dist/cjs/testnets/index.js +32 -0
  25. package/dist/cjs/testnets/package.json +1 -0
  26. package/dist/cjs/testnets/schemas.js +242 -0
  27. package/dist/cjs/testnets/types.js +1 -0
  28. package/dist/esm/abi/compressors/subcompressors/liquidation/treehouseLiquidationSubcompressor.js +178 -0
  29. package/dist/esm/abi/compressors/subcompressors/withdrawal/treehouseWithdrawalSubcompressor.js +533 -0
  30. package/dist/esm/abi/router/treehouseWorker.js +884 -0
  31. package/dist/esm/onchain/market/adapters/abi/actionAbi.js +1 -0
  32. package/dist/esm/onchain/market/adapters/abi/conctructorAbi.js +3 -0
  33. package/dist/esm/onchain/market/adapters/types.js +3 -0
  34. package/dist/esm/permissionless/api/oracles/PermissionlessOracles.js +399 -52
  35. package/dist/esm/permissionless/api/oracles/enrich.js +94 -0
  36. package/dist/esm/permissionless/api/oracles/schemas.js +80 -35
  37. package/dist/esm/permissionless/api/schemas.js +2 -4
  38. package/dist/esm/permissionless/bindings/index.js +1 -1
  39. package/dist/esm/permissionless/index.js +3 -3
  40. package/dist/esm/permissionless/utils/index.js +2 -2
  41. package/dist/esm/permissionless/utils/price-update/get-prices.js +25 -1
  42. package/dist/esm/permissionless/utils/price-update/index.js +2 -2
  43. package/dist/esm/testnets/TestnetsAPI.js +178 -0
  44. package/dist/esm/testnets/errors/TestnetNotFoundError.js +14 -0
  45. package/dist/esm/testnets/errors/TestnetRequestFailedError.js +23 -0
  46. package/dist/esm/testnets/errors/TestnetStatusError.js +18 -0
  47. package/dist/esm/testnets/errors/TestnetValidationError.js +23 -0
  48. package/dist/esm/testnets/errors/TestnetWaitTimeoutError.js +29 -0
  49. package/dist/esm/testnets/errors/TestnetsError.js +33 -0
  50. package/dist/esm/testnets/errors/index.js +7 -0
  51. package/dist/esm/testnets/index.js +11 -0
  52. package/dist/esm/testnets/package.json +1 -0
  53. package/dist/esm/testnets/schemas.js +228 -0
  54. package/dist/esm/testnets/types.js +1 -0
  55. package/dist/types/abi/compressors/subcompressors/liquidation/treehouseLiquidationSubcompressor.d.ts +148 -0
  56. package/dist/types/abi/compressors/subcompressors/withdrawal/treehouseWithdrawalSubcompressor.d.ts +440 -0
  57. package/dist/types/abi/router/treehouseWorker.d.ts +728 -0
  58. package/dist/types/onchain/market/adapters/types.d.ts +4 -1
  59. package/dist/types/permissionless/api/index.d.ts +2 -2
  60. package/dist/types/permissionless/api/oracles/PermissionlessOracles.d.ts +120 -37
  61. package/dist/types/permissionless/api/oracles/enrich.d.ts +59 -0
  62. package/dist/types/permissionless/api/oracles/index.d.ts +2 -2
  63. package/dist/types/permissionless/api/oracles/schemas.d.ts +164 -24
  64. package/dist/types/permissionless/api/oracles/types.d.ts +350 -63
  65. package/dist/types/permissionless/api/schemas.d.ts +0 -2
  66. package/dist/types/permissionless/index.d.ts +3 -3
  67. package/dist/types/permissionless/utils/index.d.ts +2 -2
  68. package/dist/types/permissionless/utils/price-update/get-prices.d.ts +17 -0
  69. package/dist/types/permissionless/utils/price-update/index.d.ts +2 -2
  70. package/dist/types/testnets/TestnetsAPI.d.ts +108 -0
  71. package/dist/types/testnets/errors/TestnetNotFoundError.d.ts +12 -0
  72. package/dist/types/testnets/errors/TestnetRequestFailedError.d.ts +11 -0
  73. package/dist/types/testnets/errors/TestnetStatusError.d.ts +15 -0
  74. package/dist/types/testnets/errors/TestnetValidationError.d.ts +16 -0
  75. package/dist/types/testnets/errors/TestnetWaitTimeoutError.d.ts +21 -0
  76. package/dist/types/testnets/errors/TestnetsError.d.ts +47 -0
  77. package/dist/types/testnets/errors/index.d.ts +7 -0
  78. package/dist/types/testnets/index.d.ts +11 -0
  79. package/dist/types/testnets/schemas.d.ts +554 -0
  80. package/dist/types/testnets/types.d.ts +717 -0
  81. package/package.json +9 -3
@@ -15,7 +15,7 @@ export interface IAdapterContract extends IBaseContract {
15
15
  openingCalls(): Promise<MultiCall[]>;
16
16
  }
17
17
  export type VersionedAbi = Record<number, readonly AbiParameter[]>;
18
- export type AdapterContractType = "ADAPTER::ACCOUNT_MIGRATOR" | "ADAPTER::BALANCER_V3_ROUTER" | "ADAPTER::BALANCER_V3_WRAPPER" | "ADAPTER::CAMELOT_V3_ROUTER" | "ADAPTER::CURVE_STABLE_NG" | "ADAPTER::CURVE_V1_2ASSETS" | "ADAPTER::CURVE_V1_3ASSETS" | "ADAPTER::CURVE_V1_4ASSETS" | "ADAPTER::CURVE_V1_STECRV_POOL" | "ADAPTER::CVX_V1_BASE_REWARD_POOL" | "ADAPTER::CVX_V1_BOOSTER" | "ADAPTER::DAI_USDS_EXCHANGE" | "ADAPTER::ERC4626_VAULT" | "ADAPTER::ERC4626_VAULT_REFERRAL" | "ADAPTER::FLUID_DEX" | "ADAPTER::INFINIFI_GATEWAY" | "ADAPTER::INFINIFI_UNWINDING" | "ADAPTER::KELP_DEPOSIT_POOL" | "ADAPTER::KELP_WITHDRAWAL" | "ADAPTER::LIDO_V1" | "ADAPTER::LIDO_WSTETH_V1" | "ADAPTER::MELLOW_CLAIMER" | "ADAPTER::MELLOW_DVV" | "ADAPTER::MELLOW_ERC4626_VAULT" | "ADAPTER::MELLOW_WRAPPER" | "ADAPTER::MIDAS_GATEWAY" | "ADAPTER::MIDAS_ISSUANCE_VAULT" | "ADAPTER::MIDAS_REDEMPTION_VAULT" | "ADAPTER::PENDLE_ROUTER" | "ADAPTER::SECURITIZE_ONRAMP" | "ADAPTER::SECURITIZE_REDEMPTION" | "ADAPTER::STAKING_REWARDS" | "ADAPTER::TRADERJOE_ROUTER" | "ADAPTER::UNISWAP_V2_ROUTER" | "ADAPTER::UNISWAP_V3_ROUTER" | "ADAPTER::UNISWAP_V4_GATEWAY" | "ADAPTER::UPSHIFT_VAULT" | "ADAPTER::VELODROME_V2_ROUTER";
18
+ export type AdapterContractType = "ADAPTER::ACCOUNT_MIGRATOR" | "ADAPTER::BALANCER_V3_ROUTER" | "ADAPTER::BALANCER_V3_WRAPPER" | "ADAPTER::CAMELOT_V3_ROUTER" | "ADAPTER::CURVE_STABLE_NG" | "ADAPTER::CURVE_V1_2ASSETS" | "ADAPTER::CURVE_V1_3ASSETS" | "ADAPTER::CURVE_V1_4ASSETS" | "ADAPTER::CURVE_V1_STECRV_POOL" | "ADAPTER::CVX_V1_BASE_REWARD_POOL" | "ADAPTER::CVX_V1_BOOSTER" | "ADAPTER::DAI_USDS_EXCHANGE" | "ADAPTER::ERC4626_VAULT" | "ADAPTER::ERC4626_VAULT_REFERRAL" | "ADAPTER::FLUID_DEX" | "ADAPTER::INFINIFI_GATEWAY" | "ADAPTER::INFINIFI_UNWINDING" | "ADAPTER::KELP_DEPOSIT_POOL" | "ADAPTER::KELP_WITHDRAWAL" | "ADAPTER::LIDO_V1" | "ADAPTER::LIDO_WSTETH_V1" | "ADAPTER::MELLOW_CLAIMER" | "ADAPTER::MELLOW_DVV" | "ADAPTER::MELLOW_ERC4626_VAULT" | "ADAPTER::MELLOW_WRAPPER" | "ADAPTER::MIDAS_GATEWAY" | "ADAPTER::MIDAS_ISSUANCE_VAULT" | "ADAPTER::MIDAS_REDEMPTION_VAULT" | "ADAPTER::PENDLE_ROUTER" | "ADAPTER::SECURITIZE_ONRAMP" | "ADAPTER::SECURITIZE_REDEMPTION" | "ADAPTER::STAKING_REWARDS" | "ADAPTER::TRADERJOE_ROUTER" | "ADAPTER::TREEHOUSE_FASTLANE" | "ADAPTER::TREEHOUSE_GATEWAY" | "ADAPTER::TREEHOUSE_ROUTER" | "ADAPTER::UNISWAP_V2_ROUTER" | "ADAPTER::UNISWAP_V3_ROUTER" | "ADAPTER::UNISWAP_V4_GATEWAY" | "ADAPTER::UPSHIFT_VAULT" | "ADAPTER::VELODROME_V2_ROUTER";
19
19
  export declare enum AdapterType {
20
20
  ACCOUNT_MIGRATOR = "ACCOUNT_MIGRATOR",
21
21
  BALANCER_V3_ROUTER = "BALANCER_V3_ROUTER",
@@ -50,6 +50,9 @@ export declare enum AdapterType {
50
50
  SECURITIZE_REDEMPTION = "SECURITIZE_REDEMPTION",
51
51
  STAKING_REWARDS = "STAKING_REWARDS",
52
52
  TRADERJOE_ROUTER = "TRADERJOE_ROUTER",
53
+ TREEHOUSE_FASTLANE = "TREEHOUSE_FASTLANE",
54
+ TREEHOUSE_GATEWAY = "TREEHOUSE_GATEWAY",
55
+ TREEHOUSE_ROUTER = "TREEHOUSE_ROUTER",
53
56
  UNISWAP_V2_ROUTER = "UNISWAP_V2_ROUTER",
54
57
  UNISWAP_V3_ROUTER = "UNISWAP_V3_ROUTER",
55
58
  UNISWAP_V4_GATEWAY = "UNISWAP_V4_GATEWAY",
@@ -5,7 +5,7 @@ import { AttachChainsArgs, ChainScope, ChainSummaryArgs, PermissionlessChain, Pe
5
5
  import { ChainsNamespace } from "./chains/ChainsNamespace.js";
6
6
  import { DeployArgs, DeployContractArgs, DeployPriceFeedArgs, PreparedDeployment, PreparedPriceFeedDeployment } from "./deploy/types.js";
7
7
  import { DEFAULT_DEPLOY_SALT, PermissionlessDeploy, priceFeedSalt } from "./deploy/PermissionlessDeploy.js";
8
- import { GetPricesArgs, PermissionlessAsset, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PriceFeedArgs } from "./oracles/types.js";
8
+ import { AssetArgs, AssetCap, AssetsArgs, FeedCap, MarketCap, PermissionlessAsset, PermissionlessAssetDetails, PermissionlessAssetMarket, PermissionlessAssetMarketFeed, PermissionlessAssetQuota, PermissionlessAssetSummary, PermissionlessIndexedAssetDetails, PermissionlessIndexedAssetSummary, PermissionlessIndexedPriceFeedDetails, PermissionlessIndexedPriceFeedMarket, PermissionlessMarket, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedStore, PermissionlessQuotaTotals, PriceFeedArgs, PriceFeedPrice, PriceFeedRef } from "./oracles/types.js";
9
9
  import { GET_PRICES_CHUNK_SIZE, GET_PRICES_GAS_LIMIT_BY_CHAIN_ID, PermissionlessOracles } from "./oracles/PermissionlessOracles.js";
10
10
  import { AddFeedsArgs, ChangeNamesArgs, ChangeStalenessPeriodsArgs, ForbidFeedsArgs, InstanceTxsArgs, PriceFeedPair } from "./transactions/types.js";
11
11
  import { InstanceOwnerTransactions } from "./transactions/InstanceOwnerTransactions.js";
@@ -17,4 +17,4 @@ import "./deploy/index.js";
17
17
  import { PermissionlessChainUnreachableError, PermissionlessNotAttachedError, PriceFeedNotInStoreError, PriceFeedSaltMissingError, PriceFeedStalenessUnknownError } from "./errors.js";
18
18
  import "./oracles/index.js";
19
19
  import "./transactions/index.js";
20
- export { AddFeedsArgs, AttachChainsArgs, ChainScope, ChainSummaryArgs, ChainsNamespace, ChangeNamesArgs, ChangeStalenessPeriodsArgs, DEFAULT_DEPLOY_SALT, DeployArgs, DeployContractArgs, DeployPriceFeedArgs, ForbidFeedsArgs, GET_PRICES_CHUNK_SIZE, GET_PRICES_GAS_LIMIT_BY_CHAIN_ID, GearboxPermissionless, GearboxPermissionlessOptions, GetPricesArgs, InstanceOwnerTransactions, InstanceTxsArgs, PermissionlessAnalytics, PermissionlessAsset, PermissionlessChain, PermissionlessChainSummary, PermissionlessChainUnreachableError, PermissionlessDeploy, PermissionlessNotAttachedError, PermissionlessOracles, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PreparedDeployment, PreparedPriceFeedDeployment, PriceChartArgs, PriceFeedArgs, PriceFeedChartPoint, PriceFeedNotInStoreError, PriceFeedPair, PriceFeedPriceChart, PriceFeedSaltMissingError, PriceFeedStalenessUnknownError, deriveEffectiveStalenessPeriod, priceFeedSalt };
20
+ export { AddFeedsArgs, AssetArgs, AssetCap, AssetsArgs, AttachChainsArgs, ChainScope, ChainSummaryArgs, ChainsNamespace, ChangeNamesArgs, ChangeStalenessPeriodsArgs, DEFAULT_DEPLOY_SALT, DeployArgs, DeployContractArgs, DeployPriceFeedArgs, FeedCap, ForbidFeedsArgs, GET_PRICES_CHUNK_SIZE, GET_PRICES_GAS_LIMIT_BY_CHAIN_ID, GearboxPermissionless, GearboxPermissionlessOptions, InstanceOwnerTransactions, InstanceTxsArgs, MarketCap, PermissionlessAnalytics, PermissionlessAsset, PermissionlessAssetDetails, PermissionlessAssetMarket, PermissionlessAssetMarketFeed, PermissionlessAssetQuota, PermissionlessAssetSummary, PermissionlessChain, PermissionlessChainSummary, PermissionlessChainUnreachableError, PermissionlessDeploy, PermissionlessIndexedAssetDetails, PermissionlessIndexedAssetSummary, PermissionlessIndexedPriceFeedDetails, PermissionlessIndexedPriceFeedMarket, PermissionlessMarket, PermissionlessNotAttachedError, PermissionlessOracles, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedStore, PermissionlessQuotaTotals, PreparedDeployment, PreparedPriceFeedDeployment, PriceChartArgs, PriceFeedArgs, PriceFeedChartPoint, PriceFeedNotInStoreError, PriceFeedPair, PriceFeedPrice, PriceFeedPriceChart, PriceFeedRef, PriceFeedSaltMissingError, PriceFeedStalenessUnknownError, deriveEffectiveStalenessPeriod, priceFeedSalt };
@@ -2,8 +2,7 @@ import { PriceFeedData } from "../../../model/opportunities.js";
2
2
  import { AbstractOffchainNamespace } from "../../../offchain/AbstractOffchainNamespace.js";
3
3
  import { GearboxPermissionlessOptions } from "../types.js";
4
4
  import { ChainsNamespace } from "../chains/ChainsNamespace.js";
5
- import { GetPricesArgs, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PriceFeedArgs } from "./types.js";
6
- import { Address } from "viem";
5
+ import { AssetArgs, AssetCap, AssetsArgs, FeedCap, MarketCap, PermissionlessAssetDetails, PermissionlessAssetSummary, PermissionlessPriceFeedDetails, PermissionlessPriceFeedStore, PriceFeedArgs, PriceFeedPrice, PriceFeedRef } from "./types.js";
7
6
  //#region src/permissionless/api/oracles/PermissionlessOracles.d.ts
8
7
  export declare const GET_PRICES_GAS_LIMIT_BY_CHAIN_ID: Record<number, bigint>;
9
8
  export declare const GET_PRICES_CHUNK_SIZE = 200;
@@ -13,9 +12,17 @@ export declare const GET_PRICES_CHUNK_SIZE = 200;
13
12
  *
14
13
  * ```ts
15
14
  * const store = await permissionless.oracles.store({ chainId: 1 });
16
- * const { prices } = await permissionless.oracles.prices({ chainId: 1 });
15
+ * const prices = await permissionless.oracles.getPrices(
16
+ * store.priceFeeds.map(({ address }) => ({ chainId: 1, address })),
17
+ * );
17
18
  * ```
18
19
  *
20
+ * The backend answers what it has indexed; anything that is only true at a
21
+ * block — a price, a market cap, a quota in one currency, the period an
22
+ * oracle holds for a slot — is read here, off the chain, and folded into what
23
+ * it answered. That is why these reads mix a request with a multicall rather
24
+ * than being either one.
25
+ *
19
26
  * Read-only. What the store carries is decided on chain, so putting a feed
20
27
  * there is a batch the instance owner executes — see
21
28
  * {@link InstanceOwnerTransactions} — not a row a client writes here.
@@ -25,10 +32,33 @@ export declare class PermissionlessOracles extends AbstractOffchainNamespace {
25
32
  constructor(options: GearboxPermissionlessOptions, chains: ChainsNamespace);
26
33
  /**
27
34
  * The store with the assets and feeds of one chain.
35
+ *
36
+ * {@link stores} narrowed to one and unwrapped, which is the whole of it:
37
+ * there is one route either way, and a chain the backend does not serve has
38
+ * no store to answer with rather than an empty one.
39
+ *
40
+ * @throws When the backend serves no store for the chain.
28
41
  **/
29
42
  store({ chainId }: {
30
43
  chainId: number;
31
44
  }): Promise<PermissionlessPriceFeedStore>;
45
+ /**
46
+ * The same stores for every chain the backend serves.
47
+ *
48
+ * One request rather than {@link store} per chain, which is what a page
49
+ * showing all of them would otherwise do: the backend assembles them in the
50
+ * same few queries it assembles one in, so the chains cost little more than
51
+ * the largest of them.
52
+ *
53
+ * Each entry names its own chain, so a store is never attributed by
54
+ * position. `chainId` narrows it to one, for a caller that wants the list
55
+ * shape either way.
56
+ *
57
+ * ```ts
58
+ * const stores = await permissionless.oracles.stores();
59
+ * ```
60
+ **/
61
+ stores({ chainId }?: AssetsArgs): Promise<PermissionlessPriceFeedStore[]>;
32
62
  /**
33
63
  * One feed of the store: what it is, which assets it may price, and which
34
64
  * market slots it currently fills.
@@ -44,10 +74,59 @@ export declare class PermissionlessOracles extends AbstractOffchainNamespace {
44
74
  * });
45
75
  * ```
46
76
  *
77
+ * Each market row also carries the staleness period that market's own
78
+ * oracle holds for the slot, read off the chain here — see
79
+ * {@link PermissionlessPriceFeedMarket.marketStalenessPeriod}.
80
+ *
47
81
  * @throws When the store does not carry the feed. A private draft is not
48
82
  * here — it lives in whichever app wrote it.
49
83
  **/
50
84
  feed({ chainId, address }: PriceFeedArgs): Promise<PermissionlessPriceFeedDetails>;
85
+ /**
86
+ * One asset of the store: the feeds allowed for it, and the markets that
87
+ * take it as collateral.
88
+ *
89
+ * The mirror of {@link feed}, and the call to reach for when the question is
90
+ * "what prices this token and what is it backing" rather than "where is this
91
+ * feed used". Both read the same market slots; which end they are indexed
92
+ * from is the difference.
93
+ *
94
+ * ```ts
95
+ * const { priceFeeds, markets, quotaUsedUsd } =
96
+ * await permissionless.oracles.asset({ chainId: 1, address: token });
97
+ * ```
98
+ *
99
+ * The quota totals are worked out here, over the very market rows this
100
+ * answers with — see {@link PermissionlessQuotaTotals}.
101
+ *
102
+ * @throws When the chain has no metadata for the address. An asset nothing
103
+ * was indexed for has no symbol or decimals, so there is no row to answer.
104
+ **/
105
+ asset({ chainId, address }: AssetArgs): Promise<PermissionlessAssetDetails>;
106
+ /**
107
+ * Every asset the store carries, with what its markets make of it.
108
+ *
109
+ * Enough on its own to render a list of assets: the alternative is the
110
+ * store's whole read for the names plus a call per row for the quotas, and
111
+ * this is one request either way you scope it.
112
+ *
113
+ * Ordered by how central each asset is — the markets it underlies first,
114
+ * then what is quoted against it, then what it is allowed — so a consumer
115
+ * renders the rows as they arrive. Omit `chainId` for every chain the
116
+ * backend serves, ordered the same way across all of them.
117
+ *
118
+ * Each row also carries its quota totals and what this SDK's tables say the
119
+ * asset is, neither of which is served — see
120
+ * {@link PermissionlessAssetSummary}. The totals are what the last two terms
121
+ * of the order are over, so this waits for them rather than handing back a
122
+ * list that would reshuffle a moment later.
123
+ *
124
+ * ```ts
125
+ * const assets = await permissionless.oracles.assets({ chainId: 1 });
126
+ * const everywhere = await permissionless.oracles.assets();
127
+ * ```
128
+ **/
129
+ assets({ chainId }?: AssetsArgs): Promise<PermissionlessAssetSummary[]>;
51
130
  /**
52
131
  * The feeds one feed reads from, recursively.
53
132
  *
@@ -64,54 +143,58 @@ export declare class PermissionlessOracles extends AbstractOffchainNamespace {
64
143
  **/
65
144
  dependencies({ chainId, address }: PriceFeedArgs): Promise<PriceFeedData>;
66
145
  /**
67
- * What the market values each of one feed's assets at.
146
+ * What the named feeds price, read off the chain.
68
147
  *
69
- * Prefer this over {@link prices} whenever the caller is looking at a single
70
- * feed. That one prices the whole store, which costs the backend one
71
- * `totalSupply` call per asset of every market on the chain; this costs it
72
- * one price lookup and one multicall over the feed's own assets.
148
+ * Prices exactly what is asked for, at the current block, across as many
149
+ * chains as the list names — one read per chain, so a screen listing every
150
+ * chain's feeds pays per chain and not per row. A feed the store does not
151
+ * carry prices the same way, which is what makes this the call to reach for
152
+ * after a deploy, or while a form is still choosing between candidates.
153
+ *
154
+ * Read in two passes. The first asks every feed what it reports as it
155
+ * stands, which is one multicall per chain; a feed that will not answer
156
+ * until it has been given a fresh one is then priced inside a simulation
157
+ * that updates it first, so a push-based feed prices as readily as a
158
+ * pull-based one. The second pass costs an `OnchainSDK` to attach, hence
159
+ * only the feeds that need it rather than all of them.
160
+ *
161
+ * `null` is a feed neither pass could read, and a chain with no client
162
+ * configured is every one of its feeds reading `null` rather than a failed
163
+ * call — the figures built on them are floors either way.
73
164
  *
74
165
  * ```ts
75
- * const { marketCaps } = await permissionless.oracles.feedMarketCaps({
76
- * chainId: 1,
77
- * address: feed,
78
- * });
166
+ * const [{ price }] = await permissionless.oracles.getPrices([
167
+ * { chainId: 1, address: feed },
168
+ * ]);
79
169
  * ```
80
- **/
81
- feedMarketCaps({ chainId, address }: PriceFeedArgs): Promise<PermissionlessPriceFeedMarketCaps>;
82
- /**
83
- * A price per feed, and a market cap per feed and asset. The feeds the
84
- * indexer has not seen are read off the chain by the backend, so the store
85
- * is priced whole.
86
170
  *
87
- * Chain-wide, and priced accordingly — see {@link feedMarketCaps} for one
88
- * feed.
171
+ * @returns One entry per feed asked for, in the order asked, each price in
172
+ * the 8 decimals every Gearbox feed reports.
89
173
  **/
90
- prices({ chainId }: {
91
- chainId: number;
92
- }): Promise<PermissionlessPrices>;
174
+ getPrices(feeds: PriceFeedRef[]): Promise<PriceFeedPrice[]>;
93
175
  /**
94
- * The price each of the named feeds reports, read off the chain.
176
+ * What one chain's feeds value one chain's assets at: `price × totalSupply`
177
+ * per pair.
95
178
  *
96
- * Where {@link prices} answers for the store as a whole and at whatever
97
- * moment the backend priced it, this prices exactly the feeds asked for, at
98
- * the current block. A feed the store does not carry prices the same way,
99
- * which is what makes this the call to reach for after a deploy, or while a
100
- * form is still choosing between candidates.
179
+ * Asked from whichever side the caller is looking at — one asset through
180
+ * each of its feeds, or one feed over each of the assets it prices — because
181
+ * a screen shows one row per feed or one row per asset, never the full
182
+ * cross product. Both answer the same pairs in the same shape.
101
183
  *
102
- * Feeds needing a fresh answer before they can be read are updated inside
103
- * the same simulation, so a push-based feed prices as readily as a
104
- * pull-based one. `null` is a feed whose read reverted, not a zero.
184
+ * Two reads per chain: the prices, and one multicall for the assets'
185
+ * supplies and decimals. Several scopes can be asked at once, which is how a
186
+ * table of every asset's feeds pays per chain rather than per row; the pairs
187
+ * come back in the order the scopes named them. A pair neither read could
188
+ * resolve has a `null` cap, which is not a zero.
105
189
  *
106
190
  * ```ts
107
- * const prices = await permissionless.oracles.getPrices({
191
+ * const caps = await permissionless.oracles.getMarketCap({
108
192
  * chainId: 1,
109
- * priceFeeds: [feed],
193
+ * asset: token,
194
+ * priceFeeds: [main, reserve],
110
195
  * });
111
196
  * ```
112
- *
113
- * @returns A price per feed, in the 8 decimals every Gearbox feed reports.
114
197
  **/
115
- getPrices({ chainId, priceFeeds }: GetPricesArgs): Promise<Record<Address, bigint | null>>;
198
+ getMarketCap(scope: AssetCap | FeedCap | Array<AssetCap | FeedCap>): Promise<MarketCap[]>;
116
199
  }
117
200
  //#endregion
@@ -0,0 +1,59 @@
1
+ import { PermissionlessAssetQuota, PermissionlessIndexedAssetSummary, PermissionlessQuotaTotals, PriceFeedPrice } from "./types.js";
2
+ import { Address } from "viem";
3
+ //#region src/permissionless/api/oracles/enrich.d.ts
4
+ /**
5
+ * What the oracles namespace works out for itself once the backend has
6
+ * answered.
7
+ *
8
+ * All of it used to be the backend's, and all of it needs the chain: a quota
9
+ * is denominated in its market's own underlying and a market cap is a supply
10
+ * times a price, so none of these can be indexed — they can only be read at
11
+ * the block the reader is on. Keeping them here means one description of each
12
+ * rule rather than one per service that wants it, and a backend that holds no
13
+ * viem client at all.
14
+ **/
15
+ /** Identifies a feed across chains, since an address alone does not. */
16
+ export declare function feedKey(chainId: number, address: Address): string;
17
+ /** Prices looked up the way {@link totalQuotas} and the caps need them. */
18
+ export declare function pricesByFeed(prices: PriceFeedPrice[]): Map<string, bigint | null>;
19
+ /**
20
+ * The asset's quota across its markets, totalled in USD.
21
+ *
22
+ * Each market's figures are converted at the price that market's own oracle
23
+ * holds for its underlying, which is the same number that market's accounting
24
+ * uses.
25
+ *
26
+ * Limits count only the markets still running, because a shut down market's
27
+ * limit is not borrowable; what is already quoted counts everywhere, because
28
+ * debt outstanding is exposure either way. A market whose underlying could not
29
+ * be priced is skipped, which makes both figures floors, and `null` is nothing
30
+ * to total rather than a zero.
31
+ *
32
+ * @param priceOf - The price each underlying feed reports, in the 8 decimals
33
+ * every Gearbox feed uses.
34
+ */
35
+ export declare function totalQuotas(quotas: PermissionlessAssetQuota[], priceOf: (feed: Address) => bigint | null | undefined): PermissionlessQuotaTotals;
36
+ /**
37
+ * What one feed values one asset's supply at: `price × totalSupply`.
38
+ *
39
+ * Multiplied as integers and formatted once, rather than through two floats:
40
+ * an 8-decimal price times an 18-decimal supply loses its small end to a JS
41
+ * number long before it loses the large one, and the figure is a total rather
42
+ * than an estimate.
43
+ *
44
+ * `null` if either side could not be read — an asset nobody could price is
45
+ * not an asset worth nothing.
46
+ */
47
+ export declare function toCap(price: bigint | null | undefined, totalSupply: bigint | null | undefined, decimals: number): string | null;
48
+ /**
49
+ * Assets ordered the way a reader scans them: what the protocol is built on
50
+ * first, then what is actually borrowed against it, then what it is merely
51
+ * allowed to be borrowed against.
52
+ *
53
+ * Applied here and not by the backend because the two middle terms are the
54
+ * converted quotas, which only exist once the chain has been read. The
55
+ * backend orders by the first term and the tie-breakers, so a caller reading
56
+ * the route directly still gets a stable order; this refines it.
57
+ */
58
+ export declare function byCentrality<T extends PermissionlessIndexedAssetSummary & PermissionlessQuotaTotals>(a: T, b: T): number;
59
+ //#endregion
@@ -1,3 +1,3 @@
1
- import { GetPricesArgs, PermissionlessAsset, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PriceFeedArgs } from "./types.js";
1
+ import { AssetArgs, AssetCap, AssetsArgs, FeedCap, MarketCap, PermissionlessAsset, PermissionlessAssetDetails, PermissionlessAssetMarket, PermissionlessAssetMarketFeed, PermissionlessAssetQuota, PermissionlessAssetSummary, PermissionlessIndexedAssetDetails, PermissionlessIndexedAssetSummary, PermissionlessIndexedPriceFeedDetails, PermissionlessIndexedPriceFeedMarket, PermissionlessMarket, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedStore, PermissionlessQuotaTotals, PriceFeedArgs, PriceFeedPrice, PriceFeedRef } from "./types.js";
2
2
  import { GET_PRICES_CHUNK_SIZE, GET_PRICES_GAS_LIMIT_BY_CHAIN_ID, PermissionlessOracles } from "./PermissionlessOracles.js";
3
- export { GET_PRICES_CHUNK_SIZE, GET_PRICES_GAS_LIMIT_BY_CHAIN_ID, GetPricesArgs, PermissionlessAsset, PermissionlessOracles, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PriceFeedArgs };
3
+ export { AssetArgs, AssetCap, AssetsArgs, FeedCap, GET_PRICES_CHUNK_SIZE, GET_PRICES_GAS_LIMIT_BY_CHAIN_ID, MarketCap, PermissionlessAsset, PermissionlessAssetDetails, PermissionlessAssetMarket, PermissionlessAssetMarketFeed, PermissionlessAssetQuota, PermissionlessAssetSummary, PermissionlessIndexedAssetDetails, PermissionlessIndexedAssetSummary, PermissionlessIndexedPriceFeedDetails, PermissionlessIndexedPriceFeedMarket, PermissionlessMarket, PermissionlessOracles, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedStore, PermissionlessQuotaTotals, PriceFeedArgs, PriceFeedPrice, PriceFeedRef };
@@ -17,7 +17,18 @@ export declare const priceFeedSchema: z.ZodObject<{
17
17
  stalenessPeriod: z.ZodNumber;
18
18
  name: z.ZodString;
19
19
  }, z.core.$loose>;
20
- /** {@link PermissionlessAsset} */
20
+ /**
21
+ * {@link PermissionlessPriceFeedAsset}
22
+ *
23
+ * What identifies an asset, which is all a feed's own listing of one says.
24
+ **/
25
+ export declare const priceFeedAssetSchema: z.ZodObject<{
26
+ address: z.ZodCustom<`0x${string}`, `0x${string}`>;
27
+ symbol: z.ZodString;
28
+ name: z.ZodString;
29
+ decimals: z.ZodNumber;
30
+ }, z.core.$loose>;
31
+ /** {@link PermissionlessAsset} — identified as above, plus what prices it. */
21
32
  export declare const assetSchema: z.ZodObject<{
22
33
  address: z.ZodCustom<`0x${string}`, `0x${string}`>;
23
34
  symbol: z.ZodString;
@@ -33,7 +44,12 @@ export declare const assetSchema: z.ZodObject<{
33
44
  name: z.ZodString;
34
45
  }, z.core.$loose>>;
35
46
  }, z.core.$loose>;
36
- /** {@link PermissionlessPriceFeedStore} */
47
+ /**
48
+ * {@link PermissionlessPriceFeedStore}
49
+ *
50
+ * A store is a chain's, and is described by the same five fields the chain
51
+ * list answers with, so those are extended rather than restated.
52
+ **/
37
53
  export declare const priceFeedStoreSchema: z.ZodObject<{
38
54
  chainId: z.ZodNumber;
39
55
  name: z.ZodString;
@@ -64,33 +80,56 @@ export declare const priceFeedStoreSchema: z.ZodObject<{
64
80
  name: z.ZodString;
65
81
  }, z.core.$loose>>;
66
82
  }, z.core.$loose>;
67
- /** {@link PermissionlessPrices} */
68
- export declare const pricesSchema: z.ZodObject<{
69
- prices: z.ZodType<Record<`0x${string}`, string | null>, unknown, z.core.$ZodTypeInternals<Record<`0x${string}`, string | null>, unknown>>;
70
- marketCaps: z.ZodType<Record<`0x${string}`, Record<`0x${string}`, string | null>>, unknown, z.core.$ZodTypeInternals<Record<`0x${string}`, Record<`0x${string}`, string | null>>, unknown>>;
71
- time: z.ZodNumber;
72
- }, z.core.$loose>;
73
- /** {@link PermissionlessPriceFeedAsset} */
74
- export declare const priceFeedAssetSchema: z.ZodObject<{
75
- address: z.ZodCustom<`0x${string}`, `0x${string}`>;
76
- symbol: z.ZodString;
83
+ /** Every chain's {@link PermissionlessPriceFeedStore}, one per chain. */
84
+ export declare const priceFeedStoresSchema: z.ZodArray<z.ZodObject<{
85
+ chainId: z.ZodNumber;
77
86
  name: z.ZodString;
78
- decimals: z.ZodNumber;
79
- }, z.core.$loose>;
80
- /** {@link PermissionlessPriceFeedMarket} */
87
+ isPublic: z.ZodBoolean;
88
+ isActivated: z.ZodBoolean;
89
+ explorerUrl: z.ZodString;
90
+ assets: z.ZodArray<z.ZodObject<{
91
+ address: z.ZodCustom<`0x${string}`, `0x${string}`>;
92
+ symbol: z.ZodString;
93
+ name: z.ZodString;
94
+ decimals: z.ZodNumber;
95
+ owner: z.ZodCustom<`0x${string}`, `0x${string}`>;
96
+ priceFeeds: z.ZodArray<z.ZodObject<{
97
+ address: z.ZodCustom<`0x${string}`, `0x${string}`>;
98
+ contractType: z.ZodString;
99
+ version: z.ZodNumber;
100
+ deployedBy: z.ZodCustom<`0x${string}`, `0x${string}`>;
101
+ stalenessPeriod: z.ZodNumber;
102
+ name: z.ZodString;
103
+ }, z.core.$loose>>;
104
+ }, z.core.$loose>>;
105
+ priceFeeds: z.ZodArray<z.ZodObject<{
106
+ address: z.ZodCustom<`0x${string}`, `0x${string}`>;
107
+ contractType: z.ZodString;
108
+ version: z.ZodNumber;
109
+ deployedBy: z.ZodCustom<`0x${string}`, `0x${string}`>;
110
+ stalenessPeriod: z.ZodNumber;
111
+ name: z.ZodString;
112
+ }, z.core.$loose>>;
113
+ }, z.core.$loose>>;
114
+ /**
115
+ * {@link PermissionlessIndexedPriceFeedMarket} — the market as the feed's slot
116
+ * in it, before the oracle is asked what period it holds for the slot.
117
+ **/
81
118
  export declare const priceFeedMarketSchema: z.ZodObject<{
82
119
  market: z.ZodCustom<`0x${string}`, `0x${string}`>;
83
120
  marketConfigurator: z.ZodCustom<`0x${string}`, `0x${string}`>;
84
121
  curatorName: z.ZodNullable<z.ZodString>;
85
122
  marketName: z.ZodNullable<z.ZodString>;
86
- token: z.ZodCustom<`0x${string}`, `0x${string}`>;
87
- tokenSymbol: z.ZodNullable<z.ZodString>;
88
123
  underlyingSymbol: z.ZodNullable<z.ZodString>;
89
- reserve: z.ZodBoolean;
90
124
  isUnderlying: z.ZodBoolean;
91
125
  quotaLimit: z.ZodNullable<z.ZodNumber>;
126
+ quotaUsed: z.ZodNullable<z.ZodNumber>;
127
+ token: z.ZodCustom<`0x${string}`, `0x${string}`>;
128
+ tokenSymbol: z.ZodNullable<z.ZodString>;
129
+ reserve: z.ZodBoolean;
130
+ priceOracle: z.ZodCustom<`0x${string}`, `0x${string}`>;
92
131
  }, z.core.$loose>;
93
- /** {@link PermissionlessPriceFeedDetails} */
132
+ /** {@link PermissionlessIndexedPriceFeedDetails} */
94
133
  export declare const priceFeedDetailsSchema: z.ZodObject<{
95
134
  chainId: z.ZodNumber;
96
135
  priceFeed: z.ZodObject<{
@@ -112,17 +151,118 @@ export declare const priceFeedDetailsSchema: z.ZodObject<{
112
151
  marketConfigurator: z.ZodCustom<`0x${string}`, `0x${string}`>;
113
152
  curatorName: z.ZodNullable<z.ZodString>;
114
153
  marketName: z.ZodNullable<z.ZodString>;
154
+ underlyingSymbol: z.ZodNullable<z.ZodString>;
155
+ isUnderlying: z.ZodBoolean;
156
+ quotaLimit: z.ZodNullable<z.ZodNumber>;
157
+ quotaUsed: z.ZodNullable<z.ZodNumber>;
115
158
  token: z.ZodCustom<`0x${string}`, `0x${string}`>;
116
159
  tokenSymbol: z.ZodNullable<z.ZodString>;
117
- underlyingSymbol: z.ZodNullable<z.ZodString>;
118
160
  reserve: z.ZodBoolean;
161
+ priceOracle: z.ZodCustom<`0x${string}`, `0x${string}`>;
162
+ }, z.core.$loose>>;
163
+ }, z.core.$loose>;
164
+ /** {@link PermissionlessAssetMarketFeed} */
165
+ export declare const assetMarketFeedSchema: z.ZodObject<{
166
+ address: z.ZodCustom<`0x${string}`, `0x${string}`>;
167
+ name: z.ZodNullable<z.ZodString>;
168
+ inStore: z.ZodBoolean;
169
+ }, z.core.$loose>;
170
+ /** {@link PermissionlessAssetMarket} — the market as what prices the asset in it. */
171
+ export declare const assetMarketSchema: z.ZodObject<{
172
+ market: z.ZodCustom<`0x${string}`, `0x${string}`>;
173
+ marketConfigurator: z.ZodCustom<`0x${string}`, `0x${string}`>;
174
+ curatorName: z.ZodNullable<z.ZodString>;
175
+ marketName: z.ZodNullable<z.ZodString>;
176
+ underlyingSymbol: z.ZodNullable<z.ZodString>;
177
+ isUnderlying: z.ZodBoolean;
178
+ quotaLimit: z.ZodNullable<z.ZodNumber>;
179
+ quotaUsed: z.ZodNullable<z.ZodNumber>;
180
+ underlyingToken: z.ZodCustom<`0x${string}`, `0x${string}`>;
181
+ underlyingPriceFeed: z.ZodNullable<z.ZodCustom<`0x${string}`, `0x${string}`>>;
182
+ isShutdown: z.ZodBoolean;
183
+ mainFeed: z.ZodNullable<z.ZodObject<{
184
+ address: z.ZodCustom<`0x${string}`, `0x${string}`>;
185
+ name: z.ZodNullable<z.ZodString>;
186
+ inStore: z.ZodBoolean;
187
+ }, z.core.$loose>>;
188
+ reserveFeed: z.ZodNullable<z.ZodObject<{
189
+ address: z.ZodCustom<`0x${string}`, `0x${string}`>;
190
+ name: z.ZodNullable<z.ZodString>;
191
+ inStore: z.ZodBoolean;
192
+ }, z.core.$loose>>;
193
+ }, z.core.$loose>;
194
+ /** {@link PermissionlessIndexedAssetDetails} */
195
+ export declare const assetDetailsSchema: z.ZodObject<{
196
+ chainId: z.ZodNumber;
197
+ asset: z.ZodObject<{
198
+ address: z.ZodCustom<`0x${string}`, `0x${string}`>;
199
+ symbol: z.ZodString;
200
+ name: z.ZodString;
201
+ decimals: z.ZodNumber;
202
+ }, z.core.$loose>;
203
+ priceFeeds: z.ZodArray<z.ZodObject<{
204
+ address: z.ZodCustom<`0x${string}`, `0x${string}`>;
205
+ contractType: z.ZodString;
206
+ version: z.ZodNumber;
207
+ deployedBy: z.ZodCustom<`0x${string}`, `0x${string}`>;
208
+ stalenessPeriod: z.ZodNumber;
209
+ name: z.ZodString;
210
+ }, z.core.$loose>>;
211
+ markets: z.ZodArray<z.ZodObject<{
212
+ market: z.ZodCustom<`0x${string}`, `0x${string}`>;
213
+ marketConfigurator: z.ZodCustom<`0x${string}`, `0x${string}`>;
214
+ curatorName: z.ZodNullable<z.ZodString>;
215
+ marketName: z.ZodNullable<z.ZodString>;
216
+ underlyingSymbol: z.ZodNullable<z.ZodString>;
119
217
  isUnderlying: z.ZodBoolean;
120
218
  quotaLimit: z.ZodNullable<z.ZodNumber>;
219
+ quotaUsed: z.ZodNullable<z.ZodNumber>;
220
+ underlyingToken: z.ZodCustom<`0x${string}`, `0x${string}`>;
221
+ underlyingPriceFeed: z.ZodNullable<z.ZodCustom<`0x${string}`, `0x${string}`>>;
222
+ isShutdown: z.ZodBoolean;
223
+ mainFeed: z.ZodNullable<z.ZodObject<{
224
+ address: z.ZodCustom<`0x${string}`, `0x${string}`>;
225
+ name: z.ZodNullable<z.ZodString>;
226
+ inStore: z.ZodBoolean;
227
+ }, z.core.$loose>>;
228
+ reserveFeed: z.ZodNullable<z.ZodObject<{
229
+ address: z.ZodCustom<`0x${string}`, `0x${string}`>;
230
+ name: z.ZodNullable<z.ZodString>;
231
+ inStore: z.ZodBoolean;
232
+ }, z.core.$loose>>;
121
233
  }, z.core.$loose>>;
122
234
  }, z.core.$loose>;
123
- /** {@link PermissionlessPriceFeedMarketCaps} */
124
- export declare const priceFeedMarketCapsSchema: z.ZodObject<{
125
- marketCaps: z.ZodType<Record<`0x${string}`, string | null>, unknown, z.core.$ZodTypeInternals<Record<`0x${string}`, string | null>, unknown>>;
126
- time: z.ZodNumber;
235
+ /** {@link PermissionlessAssetQuota} */
236
+ export declare const assetQuotaSchema: z.ZodObject<{
237
+ quotaLimit: z.ZodNullable<z.ZodNumber>;
238
+ quotaUsed: z.ZodNullable<z.ZodNumber>;
239
+ isShutdown: z.ZodBoolean;
240
+ underlyingPriceFeed: z.ZodNullable<z.ZodCustom<`0x${string}`, `0x${string}`>>;
127
241
  }, z.core.$loose>;
242
+ /** {@link PermissionlessIndexedAssetSummary} */
243
+ export declare const assetSummarySchema: z.ZodObject<{
244
+ chainId: z.ZodNumber;
245
+ address: z.ZodCustom<`0x${string}`, `0x${string}`>;
246
+ symbol: z.ZodString;
247
+ underlyingMarketCount: z.ZodNumber;
248
+ marketQuotas: z.ZodArray<z.ZodObject<{
249
+ quotaLimit: z.ZodNullable<z.ZodNumber>;
250
+ quotaUsed: z.ZodNullable<z.ZodNumber>;
251
+ isShutdown: z.ZodBoolean;
252
+ underlyingPriceFeed: z.ZodNullable<z.ZodCustom<`0x${string}`, `0x${string}`>>;
253
+ }, z.core.$loose>>;
254
+ }, z.core.$loose>;
255
+ /** The list of {@link PermissionlessAssetSummary}, already ordered. */
256
+ export declare const assetSummariesSchema: z.ZodArray<z.ZodObject<{
257
+ chainId: z.ZodNumber;
258
+ address: z.ZodCustom<`0x${string}`, `0x${string}`>;
259
+ symbol: z.ZodString;
260
+ underlyingMarketCount: z.ZodNumber;
261
+ marketQuotas: z.ZodArray<z.ZodObject<{
262
+ quotaLimit: z.ZodNullable<z.ZodNumber>;
263
+ quotaUsed: z.ZodNullable<z.ZodNumber>;
264
+ isShutdown: z.ZodBoolean;
265
+ underlyingPriceFeed: z.ZodNullable<z.ZodCustom<`0x${string}`, `0x${string}`>>;
266
+ }, z.core.$loose>>;
267
+ }, z.core.$loose>>;
128
268
  //#endregion