@1delta/margin-fetcher 0.0.215 → 0.0.216
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 +282 -42
- package/dist/index.js.map +1 -1
- package/dist/lending/public-data/aave-v4-type/publicCallBuild.d.ts +8 -4
- package/dist/lending/public-data/aave-v4-type/publicCallBuild.d.ts.map +1 -1
- package/dist/lending/public-data/aave-v4-type/publicCallParse.d.ts.map +1 -1
- package/dist/lending/user-data/aave-v4-type/createAaveV4UserState.d.ts +22 -0
- package/dist/lending/user-data/aave-v4-type/createAaveV4UserState.d.ts.map +1 -0
- package/dist/lending/user-data/aave-v4-type/userCallBuild.d.ts +2 -1
- package/dist/lending/user-data/aave-v4-type/userCallBuild.d.ts.map +1 -1
- package/dist/lending/user-data/aave-v4-type/userCallParse.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Number of calls per reserve
|
|
2
|
+
* Number of base calls per reserve (excluding dynamic config calls):
|
|
3
3
|
* 0: getReserve(reserveId)
|
|
4
4
|
* 1: getReserveConfig(reserveId)
|
|
5
5
|
* 2: getReserveSuppliedAssets(reserveId)
|
|
6
6
|
* 3: getReserveDebt(reserveId) → (drawn, premium)
|
|
7
7
|
* 4: getReserveTotalDebt(reserveId)
|
|
8
|
-
*
|
|
8
|
+
*
|
|
9
|
+
* Plus getDynamicReserveConfig(reserveId, key) for each key 0..dynamicConfigKeyMax
|
|
9
10
|
*/
|
|
10
|
-
export declare const
|
|
11
|
+
export declare const BASE_CALLS_PER_RESERVE = 5;
|
|
11
12
|
/**
|
|
12
13
|
* Number of trailing calls per Spoke (after all reserve calls):
|
|
13
14
|
* 0: getLiquidationConfig()
|
|
@@ -21,13 +22,16 @@ export declare const CALLS_PER_SPOKE_TAIL = 2;
|
|
|
21
22
|
* For each spoke:
|
|
22
23
|
* For each reserve:
|
|
23
24
|
* [getReserve, getReserveConfig, getReserveSuppliedAssets,
|
|
24
|
-
* getReserveDebt, getReserveTotalDebt
|
|
25
|
+
* getReserveDebt, getReserveTotalDebt]
|
|
26
|
+
* [getDynamicReserveConfig(rid, 0), ..., getDynamicReserveConfig(rid, max)]
|
|
25
27
|
* getLiquidationConfig()
|
|
26
28
|
* ORACLE()
|
|
27
29
|
* For oracle prices per spoke (if oracle valid):
|
|
28
30
|
* getReservesPrices(reserveIds)
|
|
29
31
|
* For each unique (hub, assetId) pair:
|
|
30
32
|
* hub.getAsset(assetId)
|
|
33
|
+
* hub.getAddedAssets(assetId)
|
|
34
|
+
* hub.getAssetTotalOwed(assetId)
|
|
31
35
|
*/
|
|
32
36
|
export declare const buildAaveV4LenderReserveCall: (chainId: string, lender: string) => any[];
|
|
33
37
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publicCallBuild.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/aave-v4-type/publicCallBuild.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"publicCallBuild.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/aave-v4-type/publicCallBuild.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB,IAAI,CAAA;AAEvC;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,IAAI,CAAA;AA2BrC;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,4BAA4B,GACvC,SAAS,MAAM,EACf,QAAQ,MAAM,UA0If,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,0BAA0B,GACrC,SAAS,MAAM,EACf,QAAQ,MAAM,KACb,MA+CF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publicCallParse.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/aave-v4-type/publicCallParse.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAkBzD,OAAO,EAEL,wBAAwB,EACzB,MAAM,qBAAqB,CAAA;AAgB5B;;GAEG;AACH,eAAO,MAAM,8BAA8B,GACzC,QAAQ,MAAM,EACd,SAAS,MAAM,EACf,QAAQ;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,EACnC,kBAAkB,gBAAgB,EAClC,YAAW,gBAAqB,KAC/B,CACD,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,wBAAwB,GAAG,SAAS,EACrD,MAAM,
|
|
1
|
+
{"version":3,"file":"publicCallParse.d.ts","sourceRoot":"","sources":["../../../../src/lending/public-data/aave-v4-type/publicCallParse.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAkBzD,OAAO,EAEL,wBAAwB,EACzB,MAAM,qBAAqB,CAAA;AAgB5B;;GAEG;AACH,eAAO,MAAM,8BAA8B,GACzC,QAAQ,MAAM,EACd,SAAS,MAAM,EACf,QAAQ;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,EACnC,kBAAkB,gBAAgB,EAClC,YAAW,gBAAqB,KAC/B,CACD,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,wBAAwB,GAAG,SAAS,EACrD,MAAM,CAwPP,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Aave V4 user state builder.
|
|
3
|
+
*
|
|
4
|
+
* Replaces createBaseTypeUserState for V4 because:
|
|
5
|
+
* 1. Config keys are "spokeAddr:dynamicConfigKey", not numeric mode IDs
|
|
6
|
+
* 2. Oracle prices can differ per spoke (config-scoped)
|
|
7
|
+
*
|
|
8
|
+
* Both issues mean we can't use a single `mode` for config lookup or
|
|
9
|
+
* a single price per asset.
|
|
10
|
+
*/
|
|
11
|
+
import { LenderCrossPoolMeta, UserData } from '../utils/types';
|
|
12
|
+
/**
|
|
13
|
+
* Per-spoke price map: spokeAddress → asset → USD price.
|
|
14
|
+
* Allows different price feeds per spoke for the same underlying.
|
|
15
|
+
*/
|
|
16
|
+
export type ConfigPriceMap = {
|
|
17
|
+
[configId: string]: {
|
|
18
|
+
[assetAddress: string]: number;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export declare function createAaveV4UserState(payload: any, lenderData: LenderCrossPoolMeta, totalDeposits24h?: number, totalDebt24h?: number, configPriceMap?: ConfigPriceMap): UserData;
|
|
22
|
+
//# sourceMappingURL=createAaveV4UserState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createAaveV4UserState.d.ts","sourceRoot":"","sources":["../../../../src/lending/user-data/aave-v4-type/createAaveV4UserState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,EAGL,mBAAmB,EAEnB,QAAQ,EACT,MAAM,gBAAgB,CAAA;AAEvB;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,CAAC,QAAQ,EAAE,MAAM,GAAG;QAClB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAAA;KAC/B,CAAA;CACF,CAAA;AAoDD,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,GAAG,EACZ,UAAU,EAAE,mBAAmB,EAC/B,gBAAgB,GAAE,MAAU,EAC5B,YAAY,GAAE,MAAU,EACxB,cAAc,CAAC,EAAE,cAAc,GAC9B,QAAQ,CA4OV"}
|
|
@@ -4,8 +4,9 @@ import { Call } from '../../../utils/multicall';
|
|
|
4
4
|
* 0: getUserSuppliedAssets(reserveId, user)
|
|
5
5
|
* 1: getUserDebt(reserveId, user) → (drawnDebt, premiumDebt)
|
|
6
6
|
* 2: getUserReserveStatus(reserveId, user) → (usingAsCollateral, isBorrowing)
|
|
7
|
+
* 3: getUserPosition(reserveId, user) → UserPosition struct (includes dynamicConfigKey, shares)
|
|
7
8
|
*/
|
|
8
|
-
export declare const USER_CALLS_PER_RESERVE =
|
|
9
|
+
export declare const USER_CALLS_PER_RESERVE = 4;
|
|
9
10
|
/**
|
|
10
11
|
* Builds multicall call list for Aave V4 user data.
|
|
11
12
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userCallBuild.d.ts","sourceRoot":"","sources":["../../../../src/lending/user-data/aave-v4-type/userCallBuild.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AAG/C
|
|
1
|
+
{"version":3,"file":"userCallBuild.d.ts","sourceRoot":"","sources":["../../../../src/lending/user-data/aave-v4-type/userCallBuild.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AAG/C;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,IAAI,CAAA;AAEvC;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,GAC9B,SAAS,MAAM,EACf,QAAQ,MAAM,EACd,SAAS,MAAM,KACd,IAAI,EA4CN,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,8BAA8B,GACzC,SAAS,MAAM,EACf,QAAQ,MAAM,KACb,MAgBF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userCallParse.d.ts","sourceRoot":"","sources":["../../../../src/lending/user-data/aave-v4-type/userCallParse.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"userCallParse.d.ts","sourceRoot":"","sources":["../../../../src/lending/user-data/aave-v4-type/userCallParse.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,mBAAmB,EAEnB,QAAQ,EACT,MAAM,gBAAgB,CAAA;AAKvB;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,0BAA0B,GACrC,QAAQ,MAAM,EACd,SAAS,MAAM,EACf,SAAS,MAAM,EACf,UAAU,mBAAmB,KAC5B,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,QAAQ,GAAG,SAAS,EAAE,MAAM,CA6HhD,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.216",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
"async-retry": "^1.3.3",
|
|
24
24
|
"lodash": "^4.17.23",
|
|
25
25
|
"@1delta/abis": "0.0.9",
|
|
26
|
-
"@1delta/
|
|
27
|
-
"@1delta/lender-registry": "0.0.20",
|
|
26
|
+
"@1delta/dex-registry": "0.0.98",
|
|
28
27
|
"@1delta/providers": "0.0.53",
|
|
29
|
-
"@1delta/
|
|
28
|
+
"@1delta/calldata-sdk": "0.0.140",
|
|
29
|
+
"@1delta/lender-registry": "0.0.20"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/async-retry": "^1.4.9",
|