@1delta/margin-fetcher 0.0.242 → 0.0.244
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 +526 -12
- 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 +1 -0
- package/dist/prices/oracle-prices/fetchers/index.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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchLender.d.ts","sourceRoot":"","sources":["../../../src/lending/public-data/fetchLender.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fetchLender.d.ts","sourceRoot":"","sources":["../../../src/lending/public-data/fetchLender.ts"],"names":[],"mappings":"AAgCA,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAkBtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AA8CtD,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,MAAM,EAAE;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,EAC/B,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,GAAE,gBAAqB,EAChC,eAAe,CAAC,EAAE,MAAM,EAAE,8CAmB3B;AAkLD,eAAO,MAAM,mBAAmB,GAC9B,SAAS,MAAM,EACf,SAAS,MAAM,EAAE,EACjB,QAAQ;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,EACnC,kBAAkB,gBAAgB,EAClC,gBAAgB,sBAAsB,EACtC,YAAW,MAAM,OAAO,CAAC,gBAAgB,CAExC,KACA,OAAO,CAAC;IAAE,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CA+DnC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/gearbox/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds the multicall descriptor for Gearbox V3 public data.
|
|
3
|
+
*
|
|
4
|
+
* Two calls:
|
|
5
|
+
* [0] DataCompressorV3.getPoolsV3List() — pool liquidity, rates, quotas
|
|
6
|
+
* [1] DataCompressorV3.getCreditManagersV3List() — CM metadata: allowed
|
|
7
|
+
* collateral tokens + parallel liquidationThresholds, debt caps, facade
|
|
8
|
+
*
|
|
9
|
+
* The CM list is NOT embedded in PoolData on the deployed DataCompressorV3,
|
|
10
|
+
* so the public-data parser joins the two by `cm.pool` → pool addr.
|
|
11
|
+
*/
|
|
12
|
+
export declare const buildGearboxCall: (chainId: string, _lender?: string) => {
|
|
13
|
+
address: string;
|
|
14
|
+
name: string;
|
|
15
|
+
params: never[];
|
|
16
|
+
}[];
|
|
17
|
+
//# sourceMappingURL=publicCallBuild.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publicCallBuild.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/gearbox/publicCallBuild.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,GAAI,SAAS,MAAM,EAAE,UAAU,MAAM;;;;GAgBjE,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { AdditionalYields, GenericTokenList } from '../../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Parser for the 2-slot Gearbox V3 public data fetch.
|
|
4
|
+
*
|
|
5
|
+
* data[0] = PoolData[] (getPoolsV3List)
|
|
6
|
+
* data[1] = CreditManagerData[] (getCreditManagersV3List)
|
|
7
|
+
*
|
|
8
|
+
* Each CreditManager is an isolated lending venue (positions are per-CA and
|
|
9
|
+
* one CA is bound to exactly one CM — CM-A cannot see positions in CM-B even
|
|
10
|
+
* when both draw from the same pool). We therefore emit one bucket per CM,
|
|
11
|
+
* keyed by `GEARBOX_V3_<CM_HEX>` via `gearboxV3LenderKey`, and join to the
|
|
12
|
+
* pool via `cm.pool` to recover per-pool supply/borrow rates.
|
|
13
|
+
*
|
|
14
|
+
* Inside each CM bucket we emit:
|
|
15
|
+
* - one LOAN entry for the pool's underlying (borrow-side)
|
|
16
|
+
* - one COLLATERAL entry per `collateralTokens[i]`, using the parallel
|
|
17
|
+
* `liquidationThresholds[i]` (BPS) as the collateral factor.
|
|
18
|
+
*
|
|
19
|
+
* The passive ERC-4626 lender side (PoolV3) is NOT modeled here — it's a
|
|
20
|
+
* standalone vault with no borrow and lives under `vaults/gearbox/`.
|
|
21
|
+
*/
|
|
22
|
+
export declare const getGearboxV3PublicDataConverter: (_lender: string, chainId: string, prices: {
|
|
23
|
+
[asset: string]: number;
|
|
24
|
+
}, additionalYields: AdditionalYields, tokenList?: GenericTokenList) => [(data: any[]) => {
|
|
25
|
+
[lender: string]: any;
|
|
26
|
+
} | undefined, number];
|
|
27
|
+
//# sourceMappingURL=publicCallParse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publicCallParse.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/gearbox/publicCallParse.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAmBnE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,+BAA+B,GAC1C,SAAS,MAAM,EACf,SAAS,MAAM,EACf,QAAQ;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,EACnC,kBAAkB,gBAAgB,EAClC,YAAW,gBAAqB,KAC/B,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK;IAAE,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,GAAG,SAAS,EAAE,MAAM,CAoNjE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abis.d.ts","sourceRoot":"","sources":["../../../src/lending/user-data/abis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"abis.d.ts","sourceRoot":"","sources":["../../../src/lending/user-data/abis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AA4ChD,eAAO,MAAM,MAAM,GAAI,QAAQ,MAAM,QAmCpC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../../src/lending/user-data/fetch-balances/parse.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../../src/lending/user-data/fetch-balances/parse.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,eAAe,EAAuB,MAAM,4BAA4B,CAAA;AAcjF,OAAO,EAAE,2BAA2B,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAmFtE;;;;;;;GAOG;AACH,eAAO,MAAM,2BAA2B,GACtC,SAAS,MAAM,EACf,YAAY,eAAe,EAAE,EAC7B,YAAY,GAAG,EAAE,EACjB,aAAa,2BAA2B,KACvC;IAAE,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAA;CAwC9B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepare.d.ts","sourceRoot":"","sources":["../../../../src/lending/user-data/fetch-balances/prepare.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"prepare.d.ts","sourceRoot":"","sources":["../../../../src/lending/user-data/fetch-balances/prepare.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AA4B/C,wBAAsB,aAAa,CACjC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,GAAG,GACX,OAAO,CAAC,IAAI,EAAE,CAAC,CAuBjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lending/user-data/gearbox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAA;AACpF,OAAO,EAAE,6BAA6B,EAAE,MAAM,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Call } from '../../../utils/multicall';
|
|
2
|
+
/**
|
|
3
|
+
* Number of multicall slots consumed by one
|
|
4
|
+
* `getCreditAccountsByBorrower(account)` call.
|
|
5
|
+
*/
|
|
6
|
+
export declare const GEARBOX_V3_USER_CALL_COUNT = 1;
|
|
7
|
+
/**
|
|
8
|
+
* Build the user-data multicall descriptor for Gearbox V3.
|
|
9
|
+
*
|
|
10
|
+
* Single call: `DataCompressorV3.getCreditAccountsByBorrower(account)` returns
|
|
11
|
+
* every Credit Account the borrower owns across every CreditManager on the
|
|
12
|
+
* chain in one shot.
|
|
13
|
+
*
|
|
14
|
+
* The parser groups returned accounts by their `creditManager` address and
|
|
15
|
+
* emits one `UserData` per CM under `GEARBOX_V3_<CM_HEX>` — matching the
|
|
16
|
+
* multi-market isolation pattern (one CA is bound to exactly one CM).
|
|
17
|
+
*/
|
|
18
|
+
export declare const buildGearboxV3UserCall: (chainId: string, _lender: string, account: string) => Call[];
|
|
19
|
+
//# sourceMappingURL=userCallBuild.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userCallBuild.d.ts","sourceRoot":"","sources":["../../../../src/lending/user-data/gearbox/userCallBuild.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AAE/C;;;GAGG;AACH,eAAO,MAAM,0BAA0B,IAAI,CAAA;AAE3C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,GACjC,SAAS,MAAM,EACf,SAAS,MAAM,EACf,SAAS,MAAM,KACd,IAAI,EAaN,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { LenderToLenderCrossPoolMeta, UserData } from '../utils/types';
|
|
2
|
+
/**
|
|
3
|
+
* Returns a [converter, expectedCallCount] tuple for Gearbox V3 user data.
|
|
4
|
+
*
|
|
5
|
+
* Single call `getCreditAccountsByBorrower(account)` returns a
|
|
6
|
+
* `CreditAccountData[]`. Each element is one isolated Credit Account owned
|
|
7
|
+
* by exactly one CreditManager.
|
|
8
|
+
*
|
|
9
|
+
* Output is keyed by `GEARBOX_V3_<CM_HEX>` — one UserData per
|
|
10
|
+
* CreditManager, with each Credit Account appearing as a sub-account
|
|
11
|
+
* (mirrors the Fluid NFT / Init subAccount pattern).
|
|
12
|
+
*
|
|
13
|
+
* Per-sub-account positions:
|
|
14
|
+
* - one entry per non-zero `balances[i]` collateral token (with deposits
|
|
15
|
+
* scaled by the token's own decimals)
|
|
16
|
+
* - one entry for the pool underlying carrying the debt
|
|
17
|
+
*
|
|
18
|
+
* A collateral balance that is NOT `isQuoted` contributes zero to health
|
|
19
|
+
* in Gearbox V3 (quotas gate which tokens count). We still surface it as
|
|
20
|
+
* a deposit entry so the UI can show "held but uncollateralized".
|
|
21
|
+
*/
|
|
22
|
+
export declare const getGearboxV3UserDataConverter: (_lender: string, chainId: string, account: string, meta?: LenderToLenderCrossPoolMeta) => [(data: any[]) => {
|
|
23
|
+
[lender: string]: UserData;
|
|
24
|
+
} | undefined, number];
|
|
25
|
+
//# sourceMappingURL=userCallParse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userCallParse.d.ts","sourceRoot":"","sources":["../../../../src/lending/user-data/gearbox/userCallParse.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,2BAA2B,EAC3B,QAAQ,EACT,MAAM,gBAAgB,CAAA;AAiBvB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,6BAA6B,GACxC,SAAS,MAAM,EACf,SAAS,MAAM,EACf,SAAS,MAAM,EACf,OAAO,2BAA2B,KACjC,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK;IAAE,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAA;CAAE,GAAG,SAAS,EAAE,MAAM,CAuMtE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchOraclePrices.d.ts","sourceRoot":"","sources":["../../../src/prices/oracle-prices/fetchOraclePrices.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,WAAW,EAEX,YAAY,EAKZ,kBAAkB,EAEnB,MAAM,SAAS,CAAA;AAChB,OAAO,
|
|
1
|
+
{"version":3,"file":"fetchOraclePrices.d.ts","sourceRoot":"","sources":["../../../src/prices/oracle-prices/fetchOraclePrices.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,WAAW,EAEX,YAAY,EAKZ,kBAAkB,EAEnB,MAAM,SAAS,CAAA;AAChB,OAAO,EAaL,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EAC1B,MAAM,YAAY,CAAA;AAcnB;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,CAAA;CAChC,CAAA;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,2CAA2C;IAC3C,YAAY,CAAC,EAAE;QAAE,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;KAAE,CAAA;IAC9C,sEAAsE;IACtE,KAAK,CAAC,EAAE,cAAc,CAAA;IACtB,sCAAsC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,mDAAmD;IACnD,SAAS,CAAC,EAAE;QAAE,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;IACzC,gEAAgE;IAChE,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,gEAAgE;IAChE,UAAU,CAAC,EAAE,WAAW,CAAA;IACxB,oDAAoD;IACpD,qBAAqB,CAAC,EAAE,qBAAqB,CAAA;IAC7C,mDAAmD;IACnD,oBAAoB,CAAC,EAAE,oBAAoB,CAAA;IAC3C;;;;OAIG;IACH,yBAAyB,CAAC,EAAE,MAAM,CAAA;IAClC;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;CACxB;AA2KD;;;;;;;;;;GAUG;AACH,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,MAAM,EAAE,EAClB,YAAY,CAAC,EAAE;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAAE,EAC9C,KAAK,GAAE,cAAmB,EAC1B,OAAO,SAAI,EACX,SAAS,GAAE;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GAAG,SAAqB,EAChE,YAAY,UAAO,EACnB,UAAU,GAAE,WAAgB,EAC5B,qBAAqB,CAAC,EAAE,qBAAqB,EAC7C,oBAAoB,CAAC,EAAE,oBAAoB,EAC3C,yBAAyB,SAAO,EAChC,YAAY,CAAC,EAAE,MAAM,EAAE,GACtB,OAAO,CAAC,kBAAkB,CAAC,CAmqB7B"}
|