@1delta/margin-fetcher 0.0.242 → 0.0.245
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.
- package/dist/index.js +533 -21
- package/dist/index.js.map +1 -1
- package/dist/lending/public-data/fetchLender.d.ts.map +1 -1
- package/dist/lending/public-data/gearbox/index.d.ts +3 -0
- package/dist/lending/public-data/gearbox/index.d.ts.map +1 -0
- package/dist/lending/public-data/gearbox/publicCallBuild.d.ts +17 -0
- package/dist/lending/public-data/gearbox/publicCallBuild.d.ts.map +1 -0
- package/dist/lending/public-data/gearbox/publicCallParse.d.ts +27 -0
- package/dist/lending/public-data/gearbox/publicCallParse.d.ts.map +1 -0
- package/dist/lending/user-data/abis.d.ts.map +1 -1
- package/dist/lending/user-data/fetch-balances/parse.d.ts.map +1 -1
- package/dist/lending/user-data/fetch-balances/prepare.d.ts.map +1 -1
- package/dist/lending/user-data/gearbox/index.d.ts +3 -0
- package/dist/lending/user-data/gearbox/index.d.ts.map +1 -0
- package/dist/lending/user-data/gearbox/userCallBuild.d.ts +19 -0
- package/dist/lending/user-data/gearbox/userCallBuild.d.ts.map +1 -0
- package/dist/lending/user-data/gearbox/userCallParse.d.ts +25 -0
- package/dist/lending/user-data/gearbox/userCallParse.d.ts.map +1 -0
- package/dist/prices/oracle-prices/fetchOraclePrices.d.ts.map +1 -1
- package/dist/prices/oracle-prices/fetchers/gearbox.d.ts +601 -0
- package/dist/prices/oracle-prices/fetchers/gearbox.d.ts.map +1 -0
- package/dist/prices/oracle-prices/fetchers/index.d.ts +2 -1
- package/dist/prices/oracle-prices/fetchers/index.d.ts.map +1 -1
- package/dist/prices/oracle-prices/fetchers/morpho.d.ts +9 -0
- package/dist/prices/oracle-prices/fetchers/morpho.d.ts.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/marketName.d.ts.map +1 -1
- package/dist/vaults/gearbox/fetchPublic.d.ts +23 -0
- package/dist/vaults/gearbox/fetchPublic.d.ts.map +1 -0
- package/dist/vaults/gearbox/index.d.ts +5 -0
- package/dist/vaults/gearbox/index.d.ts.map +1 -0
- package/dist/vaults/gearbox/publicCallBuild.d.ts +14 -0
- package/dist/vaults/gearbox/publicCallBuild.d.ts.map +1 -0
- package/dist/vaults/gearbox/publicCallParse.d.ts +13 -0
- package/dist/vaults/gearbox/publicCallParse.d.ts.map +1 -0
- package/dist/vaults/gearbox/types.d.ts +61 -0
- package/dist/vaults/gearbox/types.d.ts.map +1 -0
- package/dist/vaults/index.d.ts +1 -0
- package/dist/vaults/index.d.ts.map +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { MulticallRetryFunction, GenericTokenList } from '../../types';
|
|
2
|
+
import { GearboxV3Pools } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* One-shot fetcher for all Gearbox V3 `PoolV3` passive-lender vaults on a
|
|
5
|
+
* chain.
|
|
6
|
+
*
|
|
7
|
+
* Wraps build + multicall + parse so callers that just want "the pools
|
|
8
|
+
* snapshot" don't need to hand-wire the pipeline. The passive / earn side
|
|
9
|
+
* is NOT part of the lending dispatcher — it's pool-scoped while the
|
|
10
|
+
* lending side is CreditManager-scoped (per-CM isolation).
|
|
11
|
+
*
|
|
12
|
+
* @param chainId target chain
|
|
13
|
+
* @param multicallRetry provider-level multicall executor
|
|
14
|
+
* @param prices optional price map keyed by oracle key / underlying
|
|
15
|
+
* @param tokenList optional token list for hydrating `asset` metadata
|
|
16
|
+
*
|
|
17
|
+
* @returns `GearboxV3Pools` — map keyed by lowercased underlying address,
|
|
18
|
+
* or an empty object if the chain has no Gearbox resolver configured.
|
|
19
|
+
*/
|
|
20
|
+
export declare const fetchGearboxV3Pools: (chainId: string, multicallRetry: MulticallRetryFunction, prices?: {
|
|
21
|
+
[asset: string]: number;
|
|
22
|
+
}, tokenList?: GenericTokenList) => Promise<GearboxV3Pools>;
|
|
23
|
+
//# sourceMappingURL=fetchPublic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetchPublic.d.ts","sourceRoot":"","sources":["../../../src/vaults/gearbox/fetchPublic.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAGtE,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAExC;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,mBAAmB,GAC9B,SAAS,MAAM,EACf,gBAAgB,sBAAsB,EACtC,SAAQ;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAO,EACxC,YAAW,gBAAqB,KAC/B,OAAO,CAAC,cAAc,CAYxB,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { buildGearboxV3PoolsCall } from './publicCallBuild';
|
|
2
|
+
export { getGearboxV3PoolsConverter } from './publicCallParse';
|
|
3
|
+
export { fetchGearboxV3Pools } from './fetchPublic';
|
|
4
|
+
export type { GearboxV3Pool, GearboxV3Pools } from './types';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/vaults/gearbox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAA;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AACnD,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds the multicall descriptor for Gearbox V3 passive-pool data.
|
|
3
|
+
*
|
|
4
|
+
* Reuses `DataCompressorV3.getPoolsV3List()` — the same call the lending
|
|
5
|
+
* public-data fetcher uses. The response carries every pool's underlying,
|
|
6
|
+
* symbol, totals, rates, withdrawFee and diesel rate, so no per-pool
|
|
7
|
+
* follow-up calls are needed.
|
|
8
|
+
*/
|
|
9
|
+
export declare const buildGearboxV3PoolsCall: (chainId: string) => {
|
|
10
|
+
address: string;
|
|
11
|
+
name: string;
|
|
12
|
+
params: never[];
|
|
13
|
+
}[];
|
|
14
|
+
//# sourceMappingURL=publicCallBuild.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publicCallBuild.d.ts","sourceRoot":"","sources":["../../../src/vaults/gearbox/publicCallBuild.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,GAAI,SAAS,MAAM;;;;GAWtD,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { GenericTokenList } from '../../types';
|
|
2
|
+
import { GearboxV3Pools } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Parser for the single-call pool fetch built by `buildGearboxV3PoolsCall`.
|
|
5
|
+
*
|
|
6
|
+
* data[0] = PoolData[] (from DataCompressorV3.getPoolsV3List)
|
|
7
|
+
*
|
|
8
|
+
* Returns a map keyed by lowercased underlying address.
|
|
9
|
+
*/
|
|
10
|
+
export declare const getGearboxV3PoolsConverter: (chainId: string, prices?: {
|
|
11
|
+
[asset: string]: number;
|
|
12
|
+
}, tokenList?: GenericTokenList) => [(data: any[]) => GearboxV3Pools | undefined, number];
|
|
13
|
+
//# sourceMappingURL=publicCallParse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publicCallParse.d.ts","sourceRoot":"","sources":["../../../src/vaults/gearbox/publicCallParse.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,EAAiB,cAAc,EAAE,MAAM,SAAS,CAAA;AAmBvD;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,GACrC,SAAS,MAAM,EACf,SAAQ;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAO,EACxC,YAAW,gBAAqB,KAC/B,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,cAAc,GAAG,SAAS,EAAE,MAAM,CAWtD,CAAA"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { GenericCurrency } from '../../types/general';
|
|
2
|
+
/**
|
|
3
|
+
* Parsed Gearbox V3 `PoolV3` entry — the passive-lender / ERC-4626 side.
|
|
4
|
+
*
|
|
5
|
+
* `PoolV3` contracts are standalone ERC-4626 vaults; the pool contract
|
|
6
|
+
* itself is the Diesel share token. Not a lending market (no collateral,
|
|
7
|
+
* no per-user borrow, no liquidation) — just a deposit → earn shape,
|
|
8
|
+
* funded by draw-downs from attached `CreditManagerV3` suites.
|
|
9
|
+
*
|
|
10
|
+
* Modeled separately from the per-CreditManager credit-side markets
|
|
11
|
+
* (`src/lending/public-data/gearbox/`), which are isolated and each get
|
|
12
|
+
* their own `GEARBOX_V3_<CM_HEX>` lender key.
|
|
13
|
+
*/
|
|
14
|
+
export interface GearboxV3Pool {
|
|
15
|
+
/** Pool (Diesel share) contract address, lowercased. */
|
|
16
|
+
address: string;
|
|
17
|
+
/** Lowercased underlying ERC20 address. WETH is normalized to
|
|
18
|
+
* `zeroAddress` on Ethereum mainnet so downstream code only sees one
|
|
19
|
+
* native-ETH shape — matches the convention in the rest of the stack. */
|
|
20
|
+
underlying: string;
|
|
21
|
+
/** Diesel share symbol, e.g. `dUSDCV3`, `dWETHV3`. */
|
|
22
|
+
symbol: string;
|
|
23
|
+
/** Diesel share name, e.g. `Gearbox USDC V3`. */
|
|
24
|
+
name: string;
|
|
25
|
+
/** Pool / Diesel decimals (ERC-4626 keeps share and asset decimals
|
|
26
|
+
* aligned). */
|
|
27
|
+
decimals: number;
|
|
28
|
+
/** Total underlying assets held by the pool, raw integer as string. */
|
|
29
|
+
totalAssets: string;
|
|
30
|
+
/** Total Diesel shares minted, raw integer as string. */
|
|
31
|
+
totalSupply: string;
|
|
32
|
+
/** Total underlying currently lent out by all attached Credit Managers. */
|
|
33
|
+
totalBorrowed: string;
|
|
34
|
+
/** Underlying freely withdrawable by lenders (totalAssets − totalBorrowed). */
|
|
35
|
+
availableLiquidity: string;
|
|
36
|
+
/** `expectedLiquidity` on-chain — totalAssets accrual-projected. */
|
|
37
|
+
expectedLiquidity: string;
|
|
38
|
+
/** Diesel-per-underlying rate, raw integer — `1 underlying → N shares`. */
|
|
39
|
+
dieselRate: string;
|
|
40
|
+
/** Withdraw-fee in basis points (e.g. `10` = 0.10 %). */
|
|
41
|
+
withdrawFeeBps: number;
|
|
42
|
+
/** Base supply APR in percent (e.g. `3.41` = 3.41 %). Pool-level rate,
|
|
43
|
+
* same value every attached CM sees. */
|
|
44
|
+
supplyRate: number;
|
|
45
|
+
/** Base borrow APR in percent. */
|
|
46
|
+
baseInterestRate: number;
|
|
47
|
+
/** Hydrated asset metadata from the provided token list, if any. */
|
|
48
|
+
asset?: GenericCurrency;
|
|
49
|
+
/** USD price of one underlying unit, if prices were supplied. */
|
|
50
|
+
priceUsd?: number;
|
|
51
|
+
/** Human-formatted total assets (`totalAssets / 10^decimals`). */
|
|
52
|
+
totalAssetsFormatted: number;
|
|
53
|
+
/** Human-formatted total assets in USD. */
|
|
54
|
+
totalAssetsUsd: number;
|
|
55
|
+
}
|
|
56
|
+
/** Full parsed payload: per-underlying map for easy UI lookup. */
|
|
57
|
+
export type GearboxV3Pools = {
|
|
58
|
+
/** Keyed by lowercased underlying address (`zeroAddress` for native ETH). */
|
|
59
|
+
[underlying: string]: GearboxV3Pool;
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/vaults/gearbox/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAErD;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,aAAa;IAC5B,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAA;IACf;;8EAE0E;IAC1E,UAAU,EAAE,MAAM,CAAA;IAClB,sDAAsD;IACtD,MAAM,EAAE,MAAM,CAAA;IACd,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAA;IACZ;oBACgB;IAChB,QAAQ,EAAE,MAAM,CAAA;IAEhB,uEAAuE;IACvE,WAAW,EAAE,MAAM,CAAA;IACnB,yDAAyD;IACzD,WAAW,EAAE,MAAM,CAAA;IACnB,2EAA2E;IAC3E,aAAa,EAAE,MAAM,CAAA;IACrB,+EAA+E;IAC/E,kBAAkB,EAAE,MAAM,CAAA;IAC1B,oEAAoE;IACpE,iBAAiB,EAAE,MAAM,CAAA;IAEzB,2EAA2E;IAC3E,UAAU,EAAE,MAAM,CAAA;IAClB,yDAAyD;IACzD,cAAc,EAAE,MAAM,CAAA;IAEtB;6CACyC;IACzC,UAAU,EAAE,MAAM,CAAA;IAClB,kCAAkC;IAClC,gBAAgB,EAAE,MAAM,CAAA;IAExB,oEAAoE;IACpE,KAAK,CAAC,EAAE,eAAe,CAAA;IACvB,iEAAiE;IACjE,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,kEAAkE;IAClE,oBAAoB,EAAE,MAAM,CAAA;IAC5B,2CAA2C;IAC3C,cAAc,EAAE,MAAM,CAAA;CACvB;AAED,kEAAkE;AAClE,MAAM,MAAM,cAAc,GAAG;IAC3B,6EAA6E;IAC7E,CAAC,UAAU,EAAE,MAAM,GAAG,aAAa,CAAA;CACpC,CAAA"}
|
package/dist/vaults/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vaults/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vaults/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1delta/margin-fetcher",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.245",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -22,18 +22,18 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"async-retry": "^1.3.3",
|
|
24
24
|
"lodash": "^4.17.23",
|
|
25
|
-
"@1delta/
|
|
26
|
-
"@1delta/
|
|
27
|
-
"@1delta/
|
|
25
|
+
"@1delta/dex-registry": "0.0.99",
|
|
26
|
+
"@1delta/lender-registry": "0.0.25",
|
|
27
|
+
"@1delta/abis": "0.0.14",
|
|
28
28
|
"@1delta/providers": "0.0.56",
|
|
29
|
-
"@1delta/
|
|
29
|
+
"@1delta/calldata-sdk": "0.0.144"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/async-retry": "^1.4.9",
|
|
33
33
|
"@types/lodash": "^4.17.23",
|
|
34
34
|
"tsup": "^8.5.1",
|
|
35
35
|
"typescript": "^5.9.3",
|
|
36
|
-
"@1delta/initializer-sdk": "0.0.
|
|
36
|
+
"@1delta/initializer-sdk": "0.0.13"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"build": "tsup src/index.ts --format esm --clean && tsc -p tsconfig.dts.json",
|