@1delta/margin-fetcher 0.0.278 → 0.0.280
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/README.md +104 -0
- package/dist/abis/compound-v2/Comptroller.d.ts +20 -0
- package/dist/abis/compound-v2/Comptroller.d.ts.map +1 -1
- package/dist/ccip-VFYF2C5F.js +5 -0
- package/dist/{ccip-XQNAHYUN.js.map → ccip-VFYF2C5F.js.map} +1 -1
- package/dist/{chunk-H6U3H7VY.js → chunk-Z3MGRQJR.js} +11 -6
- package/dist/chunk-Z3MGRQJR.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +948 -75
- package/dist/index.js.map +1 -1
- package/dist/lending/public-data/aave-v2-type/publicCallParse.d.ts.map +1 -1
- package/dist/lending/public-data/aave-v3-type/publicCallParse.d.ts.map +1 -1
- package/dist/lending/public-data/aave-v4-type/fetcher/normalize.d.ts +16 -0
- package/dist/lending/public-data/aave-v4-type/fetcher/normalize.d.ts.map +1 -1
- package/dist/lending/public-data/compound-v2/convert/benqi.d.ts +3 -0
- package/dist/lending/public-data/compound-v2/convert/benqi.d.ts.map +1 -1
- package/dist/lending/public-data/compound-v2/convert/kinetic.d.ts +3 -0
- package/dist/lending/public-data/compound-v2/convert/kinetic.d.ts.map +1 -1
- package/dist/lending/public-data/compound-v2/convert/risk.d.ts +3 -0
- package/dist/lending/public-data/compound-v2/convert/risk.d.ts.map +1 -0
- package/dist/lending/public-data/compound-v2/convert/standard.d.ts +5 -0
- package/dist/lending/public-data/compound-v2/convert/standard.d.ts.map +1 -1
- package/dist/lending/public-data/compound-v2/convert/sumer.d.ts +1 -0
- package/dist/lending/public-data/compound-v2/convert/sumer.d.ts.map +1 -1
- package/dist/lending/public-data/compound-v2/convert/takara.d.ts +3 -0
- package/dist/lending/public-data/compound-v2/convert/takara.d.ts.map +1 -1
- package/dist/lending/public-data/compound-v2/convert/tectonic.d.ts +3 -0
- package/dist/lending/public-data/compound-v2/convert/tectonic.d.ts.map +1 -1
- package/dist/lending/public-data/compound-v2/publicCallBuild.d.ts.map +1 -1
- package/dist/lending/public-data/compound-v2/publicCallParse.d.ts.map +1 -1
- package/dist/lending/public-data/compound-v3/publicCallBuild.d.ts.map +1 -1
- package/dist/lending/public-data/compound-v3/publicCallParse.d.ts.map +1 -1
- package/dist/lending/public-data/dolomite/emodeConfig.d.ts +2 -0
- package/dist/lending/public-data/dolomite/emodeConfig.d.ts.map +1 -1
- package/dist/lending/public-data/dolomite/fetchFromSubgraph.d.ts.map +1 -1
- package/dist/lending/public-data/dolomite/publicCallParse.d.ts.map +1 -1
- package/dist/lending/public-data/euler/fetcher/normalize.d.ts +7 -0
- package/dist/lending/public-data/euler/fetcher/normalize.d.ts.map +1 -1
- package/dist/lending/public-data/euler/publicCallParse.d.ts.map +1 -1
- package/dist/lending/public-data/gearbox/publicCallParse.d.ts.map +1 -1
- package/dist/lending/public-data/init/publicCallParse.d.ts.map +1 -1
- package/dist/lending/public-data/lista/getMarketsFromChain.d.ts.map +1 -1
- package/dist/lending/public-data/lista/listaBroker.d.ts +67 -0
- package/dist/lending/public-data/lista/listaBroker.d.ts.map +1 -0
- package/dist/lending/public-data/lista/publicCallBuild.d.ts.map +1 -1
- package/dist/lending/public-data/morpho/convertPublic.d.ts.map +1 -1
- package/dist/lending/public-data/morpho/getMarketsFromChain.d.ts.map +1 -1
- package/dist/lending/public-data/morpho/utils/parsers.d.ts +8 -0
- package/dist/lending/public-data/morpho/utils/parsers.d.ts.map +1 -1
- package/dist/lending/public-data/silo-v2/convertPublic.d.ts.map +1 -1
- package/dist/lending/public-data/silo-v2/publicCallParse.d.ts.map +1 -1
- package/dist/lending/public-data/silo-v3/convertPublic.d.ts.map +1 -1
- package/dist/lending/public-data/silo-v3/publicCallParse.d.ts.map +1 -1
- package/dist/lending/user-data/morpho/userCallBuild.d.ts +2 -2
- package/dist/lending/user-data/morpho/userCallBuild.d.ts.map +1 -1
- package/dist/lending/user-data/morpho/userCallParse.d.ts +10 -1
- package/dist/lending/user-data/morpho/userCallParse.d.ts.map +1 -1
- package/dist/lending/user-data/utils/types.d.ts +10 -0
- package/dist/lending/user-data/utils/types.d.ts.map +1 -1
- package/dist/types/apiReturnType.d.ts +38 -0
- package/dist/types/apiReturnType.d.ts.map +1 -1
- package/dist/types/lender/morpho-types.d.ts +17 -2
- package/dist/types/lender/morpho-types.d.ts.map +1 -1
- package/dist/types/lenderTypes.d.ts +66 -0
- package/dist/types/lenderTypes.d.ts.map +1 -1
- package/dist/vaults/lst/celoValidatorGroups.d.ts +40 -0
- package/dist/vaults/lst/celoValidatorGroups.d.ts.map +1 -0
- package/dist/vaults/lst/fetchPublic.d.ts +7 -1
- package/dist/vaults/lst/fetchPublic.d.ts.map +1 -1
- package/dist/vaults/lst/index.d.ts +2 -0
- package/dist/vaults/lst/index.d.ts.map +1 -1
- package/dist/vaults/lst/types.d.ts +12 -0
- package/dist/vaults/lst/types.d.ts.map +1 -1
- package/dist/vaults/lst/validators.d.ts +65 -0
- package/dist/vaults/lst/validators.d.ts.map +1 -0
- package/package.json +5 -5
- package/dist/ccip-XQNAHYUN.js +0 -5
- package/dist/chunk-H6U3H7VY.js.map +0 -1
|
@@ -16,6 +16,29 @@ export interface ConfigEntry {
|
|
|
16
16
|
borrowCollateralFactor: number;
|
|
17
17
|
collateralFactor: number;
|
|
18
18
|
borrowFactor: number;
|
|
19
|
+
/**
|
|
20
|
+
* Liquidation penalty for this mode, as a fraction of the repaid debt that
|
|
21
|
+
* the liquidator receives on top of par (e.g. `0.05` = 5% bonus). Mode-/
|
|
22
|
+
* e-mode-specific where the protocol supports it (Aave e-modes, Dolomite
|
|
23
|
+
* categories, Euler vaults). `0` when the asset cannot be liquidated in this
|
|
24
|
+
* mode or the protocol does not expose a penalty.
|
|
25
|
+
*/
|
|
26
|
+
liquidationPenalty: number;
|
|
27
|
+
/**
|
|
28
|
+
* Max fraction of debt repayable in a single liquidation (0..1). Mirrors the
|
|
29
|
+
* pool-level {@link PoolData.closeFactor}; not e-mode-specific in any
|
|
30
|
+
* supported protocol, so this is the same value across every mode of a
|
|
31
|
+
* market — duplicated here for per-mode consumer convenience.
|
|
32
|
+
*/
|
|
33
|
+
closeFactor: number;
|
|
34
|
+
/**
|
|
35
|
+
* Liquidation target health factor (e.g. 1.05). Set only by protocols whose
|
|
36
|
+
* liquidation engine repays just enough debt to restore a position to a
|
|
37
|
+
* target HF instead of using a fixed close factor (Aave V4, spoke-level).
|
|
38
|
+
* Mirrors {@link PoolData.targetHealthFactor}; `undefined` where the protocol
|
|
39
|
+
* has no such parameter.
|
|
40
|
+
*/
|
|
41
|
+
targetHealthFactor?: number;
|
|
19
42
|
collateralDisabled?: boolean;
|
|
20
43
|
debtDisabled?: boolean;
|
|
21
44
|
}
|
|
@@ -59,6 +82,21 @@ export interface PoolData {
|
|
|
59
82
|
borrowCap: number;
|
|
60
83
|
supplyCap: number;
|
|
61
84
|
debtCeiling: string;
|
|
85
|
+
/**
|
|
86
|
+
* Max fraction of a borrower's debt that can be repaid in a single
|
|
87
|
+
* liquidation (0..1). Protocol-level constant for most lenders:
|
|
88
|
+
* `0.5` for Aave (rises to `1` once health factor drops below the
|
|
89
|
+
* close-factor threshold) and Compound V2's `closeFactorMantissa`.
|
|
90
|
+
* `1` (full liquidation) for isolated / credit-account protocols
|
|
91
|
+
* (Compound V3, Morpho, Euler, Fluid, Gearbox, Dolomite, Silo).
|
|
92
|
+
*/
|
|
93
|
+
closeFactor: number;
|
|
94
|
+
/**
|
|
95
|
+
* Liquidation target health factor (e.g. 1.05) for protocols that liquidate
|
|
96
|
+
* to a target HF rather than by a fixed close factor (Aave V4, spoke-level).
|
|
97
|
+
* `undefined` where the protocol has no such parameter.
|
|
98
|
+
*/
|
|
99
|
+
targetHealthFactor?: number;
|
|
62
100
|
}
|
|
63
101
|
export type LenderData = {
|
|
64
102
|
[chainId: string]: {
|
|
@@ -1 +1 @@
|
|
|
1
|
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H,WAAW,EAAE,MAAM,CAAA;IACnB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC5B;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,CAAC,OAAO,EAAE,MAAM,GAAG;QACjB,IAAI,EAAE;YACJ,CAAC,MAAM,EAAE,MAAM,GAAG;gBAChB,IAAI,EAAE;oBACJ,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAA;iBAC3B,CAAA;gBACD,OAAO,EAAE,MAAM,CAAA;aAChB,CAAA;SACF,CAAA;QACD,WAAW,EAAE,MAAM,CAAA;KACpB,CAAA;CACF,CAAA"}
|
|
@@ -85,6 +85,14 @@ export interface MorphoMarket {
|
|
|
85
85
|
rateCap?: string;
|
|
86
86
|
/** IRM rate floor */
|
|
87
87
|
rateFloor?: string;
|
|
88
|
+
/** Lista broker term menu — available term products (brokered markets only) */
|
|
89
|
+
terms?: {
|
|
90
|
+
termId: number;
|
|
91
|
+
durationSecs: number;
|
|
92
|
+
durationDays: number;
|
|
93
|
+
/** annualised borrow rate in PERCENT (e.g. 3.857 = 3.857% APR) */
|
|
94
|
+
apr: number;
|
|
95
|
+
}[];
|
|
88
96
|
}
|
|
89
97
|
export interface MorphoGeneralPublicResponse {
|
|
90
98
|
data: {
|
|
@@ -109,7 +117,8 @@ export interface MorphoGeneralPublicResponse {
|
|
|
109
117
|
depositRate: number;
|
|
110
118
|
variableBorrowRate: number;
|
|
111
119
|
intrinsicYield: number;
|
|
112
|
-
|
|
120
|
+
/** fixed-term (broker) borrow rate in percent; 0 for non-brokered Morpho-type markets */
|
|
121
|
+
stableBorrowRate: number;
|
|
113
122
|
rewards?: RewardsList;
|
|
114
123
|
decimals: number;
|
|
115
124
|
config: {
|
|
@@ -118,14 +127,20 @@ export interface MorphoGeneralPublicResponse {
|
|
|
118
127
|
borrowCollateralFactor: number;
|
|
119
128
|
collateralFactor: number;
|
|
120
129
|
borrowFactor: 1;
|
|
130
|
+
liquidationPenalty: number;
|
|
131
|
+
closeFactor: number;
|
|
121
132
|
collateralDisabled: boolean;
|
|
122
133
|
debtDisabled: boolean;
|
|
123
134
|
};
|
|
124
135
|
};
|
|
136
|
+
closeFactor: number;
|
|
125
137
|
collateralActive: boolean;
|
|
126
138
|
borrowingEnabled: boolean;
|
|
127
139
|
depositsEnabled: boolean;
|
|
128
|
-
hasStable:
|
|
140
|
+
hasStable: boolean;
|
|
141
|
+
/** Lista fixed-term broker markets: variable (flexible) borrowing is not available — borrow
|
|
142
|
+
* is fixed-term only (via the broker). Supply yield stays variable. False/absent otherwise. */
|
|
143
|
+
variableBorrowDisabled?: boolean;
|
|
129
144
|
isActive: true;
|
|
130
145
|
isFrozen: false;
|
|
131
146
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"morpho-types.d.ts","sourceRoot":"","sources":["../../../src/types/lender/morpho-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAE5C,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE;QACP,KAAK,EAAE;YACL,SAAS,EAAE,MAAM,CAAA;YACjB,UAAU,EAAE,MAAM,CAAA;YAClB,aAAa,EAAE,MAAM,CAAA;YACrB,IAAI,EAAE,MAAM,CAAA;YACZ,WAAW,EAAE,OAAO,CAAA;YACpB,SAAS,EAAE;gBACT,OAAO,EAAE,MAAM,CAAA;gBACf,IAAI,EAAE,MAAM,CAAA;gBACZ,MAAM,EAAE,MAAM,CAAA;gBACd,QAAQ,EAAE,MAAM,CAAA;gBAChB,QAAQ,EAAE,MAAM,CAAA;aACjB,CAAA;YACD,eAAe,EAAE;gBACf,OAAO,EAAE,MAAM,CAAA;gBACf,IAAI,EAAE,MAAM,CAAA;gBACZ,MAAM,EAAE,MAAM,CAAA;gBACd,QAAQ,EAAE,MAAM,CAAA;gBAChB,QAAQ,EAAE,MAAM,CAAA;aACjB,CAAA;YACD,KAAK,EAAE;gBACL,SAAS,EAAE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,WAAW,EAAE,MAAM,CAAA;YACnB,kBAAkB,EAAE,MAAM,CAAA;YAC1B,cAAc,EAAE,MAAM,CAAA;YACtB,yFAAyF;YACzF,gBAAgB,EAAE,MAAM,CAAA;YAGxB,OAAO,CAAC,EAAE,WAAW,CAAA;YAGrB,QAAQ,EAAE,MAAM,CAAA;YAEhB,MAAM,EAAE;gBACN,CAAC,CAAC,CAAC,EAAE;oBACH,QAAQ,EAAE,MAAM,CAAA;oBAEhB,sBAAsB,EAAE,MAAM,CAAA;oBAC9B,gBAAgB,EAAE,MAAM,CAAA;oBACxB,YAAY,EAAE,CAAC,CAAA;oBACf,kBAAkB,EAAE,MAAM,CAAA;oBAC1B,WAAW,EAAE,MAAM,CAAA;oBACnB,kBAAkB,EAAE,OAAO,CAAA;oBAC3B,YAAY,EAAE,OAAO,CAAA;iBACtB,CAAA;aACF,CAAA;YAGD,WAAW,EAAE,MAAM,CAAA;YAGnB,gBAAgB,EAAE,OAAO,CAAA;YACzB,gBAAgB,EAAE,OAAO,CAAA;YACzB,eAAe,EAAE,OAAO,CAAA;YACxB,SAAS,EAAE,OAAO,CAAA;YAClB;4GACgG;YAChG,sBAAsB,CAAC,EAAE,OAAO,CAAA;YAChC,QAAQ,EAAE,IAAI,CAAA;YACd,QAAQ,EAAE,KAAK,CAAA;SAChB,CAAA;KACF,CAAA;IACD,yBAAyB;IACzB,MAAM,EAAE;QACN,MAAM,EAAE,YAAY,CAAA;KACrB,CAAA;IACD,OAAO,EAAE,MAAM,CAAA;CAChB"}
|
|
@@ -87,6 +87,11 @@ export interface CompoundV2UserReserveResponse extends AaveV2UserReserveResponse
|
|
|
87
87
|
}
|
|
88
88
|
export interface BaseLendingPositions {
|
|
89
89
|
marketUid: string;
|
|
90
|
+
/**
|
|
91
|
+
* Optional loan binding. Absent ⇒ the position applies to ALL loans (e.g. shared collateral);
|
|
92
|
+
* present ⇒ the position is strictly tied to that loan. (Distinct from sub-account `accountId`.)
|
|
93
|
+
*/
|
|
94
|
+
loanId?: string;
|
|
90
95
|
deposits: string;
|
|
91
96
|
debt: string;
|
|
92
97
|
debtStable: string;
|
|
@@ -117,8 +122,37 @@ export interface BaseLendingPositions {
|
|
|
117
122
|
/** Collateral share exchange rate: assets per 10^decimals shares */
|
|
118
123
|
collateralRate?: string;
|
|
119
124
|
}
|
|
125
|
+
/** A Lista loan, attached to its own entry in the positions array. */
|
|
126
|
+
export interface ListaTermLoan {
|
|
127
|
+
/** loanId — the repay target for the LISTA_BROKER_REPAY composer op. For fixed loans this is the
|
|
128
|
+
* posId; for the dynamic (flexible) loan it is the dynamic sentinel (type(uint128).max). */
|
|
129
|
+
loanId: string;
|
|
130
|
+
/** true for the flexible (dynamic / variable-rate) loan; fixed loans omit it */
|
|
131
|
+
isDynamic?: boolean;
|
|
132
|
+
/** best-effort term product id (matched from duration vs the current menu); may be undefined */
|
|
133
|
+
termId?: number;
|
|
134
|
+
/** outstanding debt in loan-token units (principal + accrued interest) */
|
|
135
|
+
debt: string;
|
|
136
|
+
/** locked annualised borrow rate in PERCENT (e.g. 3.857 = 3.857% APR) */
|
|
137
|
+
apr?: number;
|
|
138
|
+
/** unix maturity timestamp */
|
|
139
|
+
maturity?: number;
|
|
140
|
+
termDays?: number;
|
|
141
|
+
/** outstanding accrued interest in loan-token units */
|
|
142
|
+
accruedInterest?: string;
|
|
143
|
+
/** early-repayment penalty (loan-token units) to close the loan now; 0 once matured */
|
|
144
|
+
earlyRepayPenalty?: string;
|
|
145
|
+
isMatured?: boolean;
|
|
146
|
+
}
|
|
120
147
|
interface MorphoLendingPositions extends BaseLendingPositions {
|
|
121
148
|
isWhitelisted?: boolean;
|
|
149
|
+
/**
|
|
150
|
+
* Lista fixed-term loan detail. A brokered market emits, under the same accountId, one extra
|
|
151
|
+
* positions[] entry per fixed-term loan carrying this `term` (with termId + term data); its
|
|
152
|
+
* debt sits in `debtStable` and `loanId` is the repay target. The aggregate loan position
|
|
153
|
+
* (no `term`) carries the rollup `debtStable` total for health.
|
|
154
|
+
*/
|
|
155
|
+
term?: ListaTermLoan;
|
|
122
156
|
}
|
|
123
157
|
export interface AaveV3UserReserveResponse {
|
|
124
158
|
chainId: string;
|
|
@@ -176,6 +210,19 @@ export interface AaveV3Public extends LenderPublicBase {
|
|
|
176
210
|
export interface LenderPublicBase extends LenderYields, LenderTotalAmounts {
|
|
177
211
|
borrowingEnabled: boolean;
|
|
178
212
|
depositsEnabled: boolean;
|
|
213
|
+
/**
|
|
214
|
+
* Max fraction of a borrower's debt repayable in one liquidation (0..1).
|
|
215
|
+
* Protocol-level constant for most lenders (Aave `0.5`, Compound V2
|
|
216
|
+
* `closeFactorMantissa`); `1` (full liquidation) for isolated /
|
|
217
|
+
* credit-account protocols. Defaults to `1` when not applicable.
|
|
218
|
+
*/
|
|
219
|
+
closeFactor: number;
|
|
220
|
+
/**
|
|
221
|
+
* Liquidation target health factor (e.g. 1.05) for protocols that liquidate
|
|
222
|
+
* to a target HF rather than by a fixed close factor (Aave V4, spoke-level).
|
|
223
|
+
* `undefined` where the protocol has no such parameter.
|
|
224
|
+
*/
|
|
225
|
+
targetHealthFactor?: number;
|
|
179
226
|
config: LenderConfigMap;
|
|
180
227
|
}
|
|
181
228
|
export interface LenderYields extends BaseYields {
|
|
@@ -205,6 +252,25 @@ export interface LenderConfigData {
|
|
|
205
252
|
borrowCollateralFactor: number;
|
|
206
253
|
collateralFactor: number;
|
|
207
254
|
borrowFactor: number;
|
|
255
|
+
/**
|
|
256
|
+
* Liquidation penalty for this mode, as a fraction of repaid debt the
|
|
257
|
+
* liquidator receives on top of par (e.g. `0.05` = 5% bonus). Mode-specific
|
|
258
|
+
* where the protocol supports it (Aave e-modes, Dolomite categories, Euler
|
|
259
|
+
* vaults); `0` when not liquidatable in this mode or unsupported.
|
|
260
|
+
*/
|
|
261
|
+
liquidationPenalty: number;
|
|
262
|
+
/**
|
|
263
|
+
* Max fraction of debt repayable in a single liquidation (0..1). Mirrors the
|
|
264
|
+
* pool-level {@link LenderPublicBase.closeFactor}; identical across every mode
|
|
265
|
+
* of a market (no supported protocol varies close factor by e-mode).
|
|
266
|
+
*/
|
|
267
|
+
closeFactor: number;
|
|
268
|
+
/**
|
|
269
|
+
* Liquidation target health factor (e.g. 1.05) for protocols that liquidate
|
|
270
|
+
* to a target HF rather than by a fixed close factor (Aave V4, spoke-level).
|
|
271
|
+
* Mirrors {@link LenderPublicBase.targetHealthFactor}; `undefined` otherwise.
|
|
272
|
+
*/
|
|
273
|
+
targetHealthFactor?: number;
|
|
208
274
|
collateralDisabled?: boolean;
|
|
209
275
|
debtDisabled?: boolean;
|
|
210
276
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lenderTypes.d.ts","sourceRoot":"","sources":["../../src/types/lenderTypes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AACzD,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAA;AACxC,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAA;AAErC,MAAM,WAAW,eAAe;IAC9B,6FAA6F;IAC7F,MAAM,EAAE,GAAG,CAAA;IACX,mBAAmB;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,+DAA+D;IAC/D,MAAM,CAAC,EAAE,GAAG,EAAE,CAAA;IACd,8CAA8C;IAC9C,MAAM,CAAC,EAAE,GAAG,EAAE,CAAA;CACf;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,eAAe,EAAE,qBA0C7D;AAED,MAAM,WAAW,mBAAmB;IAElC,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,MAAM,CAAA;IAElB,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,aAAa,EAAE,MAAM,CAAA;IAErB,iBAAiB,EAAE,OAAO,CAAA;IAC1B,gBAAgB,EAAE,MAAM,C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1B,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type Address } from 'viem';
|
|
2
|
+
export interface StCeloValidatorGroup {
|
|
3
|
+
/** Validator-group address (checksummed) to pass as the deposit's
|
|
4
|
+
* `options.validatorGroup`. */
|
|
5
|
+
group: Address;
|
|
6
|
+
/** Receivable-vote capacity, raw CELO (wei) as string. The amount of new
|
|
7
|
+
* stake this group can still absorb before it overflows. */
|
|
8
|
+
receivableVotes: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Fetch the currently-depositable StakedCelo validator groups on-chain,
|
|
12
|
+
* ranked by remaining capacity (descending).
|
|
13
|
+
*
|
|
14
|
+
* Rotates through the configured Celo RPCs (`maxRpcTries`) so one flaky
|
|
15
|
+
* endpoint doesn't fail the read. Throws only if every RPC fails.
|
|
16
|
+
*/
|
|
17
|
+
export declare const getStCeloValidatorGroups: (maxRpcTries?: number) => Promise<StCeloValidatorGroup[]>;
|
|
18
|
+
/** StakedCelo `Manager` on Celo mainnet (42220), lowercased. */
|
|
19
|
+
export declare const STCELO_MANAGER_ADDRESS = "0x0239b96d10a434a56cc9e09383077a0490cf9398";
|
|
20
|
+
/**
|
|
21
|
+
* Decide which validator group (if any) a stCELO deposit should set via
|
|
22
|
+
* `changeStrategy` before `deposit()` — the value to pass as the builder's
|
|
23
|
+
* `options.validatorGroup`. Resolution order:
|
|
24
|
+
*
|
|
25
|
+
* 1. An explicit `requestedGroup` is honoured verbatim (the zero address
|
|
26
|
+
* means "use the default strategy" → returns `undefined`, no
|
|
27
|
+
* `changeStrategy`). `changeStrategy` validates eligibility on-chain.
|
|
28
|
+
* 2. Otherwise the caller's current strategy is read: if it is already a
|
|
29
|
+
* specific group (`getAddressStrategy != 0`, which the Manager keeps
|
|
30
|
+
* non-zero only while the group stays healthy), the plain `deposit()`
|
|
31
|
+
* works and `undefined` is returned.
|
|
32
|
+
* 3. If the caller is on the **default** strategy — which currently reverts
|
|
33
|
+
* `Not validator group` on mainnet — the best-capacity eligible group is
|
|
34
|
+
* returned so the deposit is routed somewhere valid.
|
|
35
|
+
*
|
|
36
|
+
* Best-effort: returns `undefined` if the chain reads fail, leaving the
|
|
37
|
+
* deposit unchanged rather than throwing.
|
|
38
|
+
*/
|
|
39
|
+
export declare const resolveStCeloDepositGroup: (user: Address, requestedGroup?: string, maxRpcTries?: number) => Promise<Address | undefined>;
|
|
40
|
+
//# sourceMappingURL=celoValidatorGroups.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"celoValidatorGroups.d.ts","sourceRoot":"","sources":["../../../src/vaults/lst/celoValidatorGroups.ts"],"names":[],"mappings":"AAEA,OAAO,EAAsC,KAAK,OAAO,EAAE,MAAM,MAAM,CAAA;AAkFvE,MAAM,WAAW,oBAAoB;IACnC;oCACgC;IAChC,KAAK,EAAE,OAAO,CAAA;IACd;iEAC6D;IAC7D,eAAe,EAAE,MAAM,CAAA;CACxB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,GACnC,oBAAe,KACd,OAAO,CAAC,oBAAoB,EAAE,CA4EhC,CAAA;AAED,gEAAgE;AAChE,eAAO,MAAM,sBAAsB,+CACW,CAAA;AAE9C;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,yBAAyB,GACpC,MAAM,OAAO,EACb,iBAAiB,MAAM,EACvB,oBAAe,KACd,OAAO,CAAC,OAAO,GAAG,SAAS,CAgC7B,CAAA"}
|
|
@@ -21,5 +21,11 @@ import type { LstShareTokens } from './types';
|
|
|
21
21
|
*/
|
|
22
22
|
export declare const fetchLstShareTokens: (chainId: string, multicallRetry: MulticallRetryFunction, prices?: {
|
|
23
23
|
[asset: string]: number;
|
|
24
|
-
}, tokenList?: GenericTokenList
|
|
24
|
+
}, tokenList?: GenericTokenList, opts?: {
|
|
25
|
+
/** Fetch the **live** validator set for delegation LSTs (Core, Celo).
|
|
26
|
+
* These reads go via standalone RPC (`getEvmClient`), separate from the
|
|
27
|
+
* injected multicall, so they're opt-in to keep the hot data path cheap.
|
|
28
|
+
* The `delegation` descriptor is always attached regardless. */
|
|
29
|
+
includeValidators?: boolean;
|
|
30
|
+
}) => Promise<LstShareTokens>;
|
|
25
31
|
//# sourceMappingURL=fetchPublic.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchPublic.d.ts","sourceRoot":"","sources":["../../../src/vaults/lst/fetchPublic.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"fetchPublic.d.ts","sourceRoot":"","sources":["../../../src/vaults/lst/fetchPublic.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAgBtE,OAAO,KAAK,EAAiB,cAAc,EAAE,MAAM,SAAS,CAAA;AA6C5D;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,mBAAmB,GAC9B,SAAS,MAAM,EACf,gBAAgB,sBAAsB,EACtC,SAAQ;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAO,EACxC,YAAW,gBAAqB,EAChC,OAAM;IACJ;;;qEAGiE;IACjE,iBAAiB,CAAC,EAAE,OAAO,CAAA;CACvB,KACL,OAAO,CAAC,cAAc,CAwPxB,CAAA"}
|
|
@@ -3,4 +3,6 @@ export type { LstShareToken, LstShareTokens, LstWithdrawalMode } from './types';
|
|
|
3
3
|
export { getLstRegistry, LST_REGISTRY, type LstRegistryEntry, type LstReaderKind, } from './registry';
|
|
4
4
|
export { getLstWithdrawalRequests, getVaultWithdrawalRequests, getLstWithdrawalRegistry, LST_WITHDRAWAL_REGISTRY, type LstWithdrawalFetchOptions, type LstWithdrawalRegistryEntry, type LstWithdrawalRequest, type LstWithdrawalRequestsByLst, type LstWithdrawalStatus, type LstWithdrawalReaderKind, } from './withdrawals';
|
|
5
5
|
export { getCoreValidators, type CoreValidators } from './coreValidators';
|
|
6
|
+
export { getStCeloValidatorGroups, resolveStCeloDepositGroup, STCELO_MANAGER_ADDRESS, type StCeloValidatorGroup, } from './celoValidatorGroups';
|
|
7
|
+
export { getLstDelegation, getLstValidators, type LstDelegation, type LstDelegationKind, type LstValidator, } from './validators';
|
|
6
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/vaults/lst/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AACnD,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAC/E,OAAO,EACL,cAAc,EACd,YAAY,EACZ,KAAK,gBAAgB,EACrB,KAAK,aAAa,GACnB,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,uBAAuB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAC/B,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,GAC7B,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,iBAAiB,EAAE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/vaults/lst/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AACnD,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAC/E,OAAO,EACL,cAAc,EACd,YAAY,EACZ,KAAK,gBAAgB,EACrB,KAAK,aAAa,GACnB,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,uBAAuB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAC/B,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,GAC7B,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,iBAAiB,EAAE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACzE,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,sBAAsB,EACtB,KAAK,oBAAoB,GAC1B,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,YAAY,GAClB,MAAM,cAAc,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { LstAcceptedInput } from '@1delta/calldata-sdk';
|
|
2
2
|
import { GenericCurrency } from '../../types/general';
|
|
3
3
|
import type { VaultClassificationFields } from '../classification';
|
|
4
|
+
import type { LstDelegation, LstValidator } from './validators';
|
|
4
5
|
/**
|
|
5
6
|
* Withdrawal exit mode for an LST. Drives downstream UX: queued LSTs
|
|
6
7
|
* need a withdrawal-request flow, instant ones can burn-to-asset right
|
|
@@ -106,6 +107,17 @@ export interface LstShareToken extends VaultClassificationFields {
|
|
|
106
107
|
* Empty when `isMintable === false`. Use this to drive the deposit-action
|
|
107
108
|
* request (`payAsset` + the per-path `needs` options). */
|
|
108
109
|
acceptedInputs: LstAcceptedInput[];
|
|
110
|
+
/** Validator-selection descriptor — present only for LSTs that require or
|
|
111
|
+
* allow the depositor to pick a validator / group / node / pool the stake
|
|
112
|
+
* is delegated to (Core, Celo, Solv, …). Absent for pooled LSTs (the
|
|
113
|
+
* majority). Mirrors `acceptedInputs` — the machine-readable "do I have to
|
|
114
|
+
* choose a validator, and from where". See `validators`. */
|
|
115
|
+
delegation?: LstDelegation;
|
|
116
|
+
/** The live, selectable validator set for `delegation.optionKey`, when the
|
|
117
|
+
* descriptor's `source` is `endpoint`. Each `id` is the value to pass back
|
|
118
|
+
* as the deposit option. Empty/absent for pooled or off-chain-selected
|
|
119
|
+
* (Solv poolId) LSTs. */
|
|
120
|
+
validators?: LstValidator[];
|
|
109
121
|
/** Withdrawal mechanism — see `LstWithdrawalMode`. */
|
|
110
122
|
withdrawalMode: LstWithdrawalMode;
|
|
111
123
|
/** Fixed cooldown in seconds for `fixed-cooldown` mode. Undefined
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/vaults/lst/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/vaults/lst/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAE/D;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GACzB,QAAQ,GACR,gBAAgB,GAChB,mBAAmB,GACnB,eAAe,GACf,WAAW,GACX,UAAU,CAAA;AAEd;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,aAAc,SAAQ,yBAAyB;IAC9D,gDAAgD;IAChD,OAAO,EAAE,MAAM,CAAA;IACf;;gCAE4B;IAC5B,UAAU,EAAE,MAAM,CAAA;I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CAAC,EAAE,MAAM,CAAA;IAElC,oEAAoE;IACpE,KAAK,CAAC,EAAE,eAAe,CAAA;IACvB,iEAAiE;IACjE,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,mEAAmE;IACnE,oBAAoB,EAAE,MAAM,CAAA;IAC5B,2CAA2C;IAC3C,cAAc,EAAE,MAAM,CAAA;IAEtB;;;;;;;;kFAQ8E;IAC9E,SAAS,EAAE,MAAM,CAAA;IACjB,2EAA2E;IAC3E,kBAAkB,EAAE,MAAM,CAAA;IAC1B,qDAAqD;IACrD,YAAY,EAAE,MAAM,CAAA;CACrB;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,CAAC,YAAY,EAAE,MAAM,GAAG,aAAa,CAAA;CACtC,CAAA"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validator / delegation dataset for LST deposits.
|
|
3
|
+
*
|
|
4
|
+
* A few LSTs require (or allow) the depositor to pick the validator,
|
|
5
|
+
* validator-group, node, or pool the staked asset is delegated to — unlike
|
|
6
|
+
* the pooled majority (Lido, Rocket Pool, EtherFi, …) where the protocol
|
|
7
|
+
* decides. This module is the single source of truth for:
|
|
8
|
+
*
|
|
9
|
+
* 1. **the descriptor** ({@link LstDelegation}) — *whether* a selection is
|
|
10
|
+
* needed, the deposit option key to send the choice back as, whether a
|
|
11
|
+
* safe default exists, and where the list comes from; and
|
|
12
|
+
* 2. **the live set** ({@link LstValidator}) — the selectable validators with
|
|
13
|
+
* status + capacity, normalised across protocols.
|
|
14
|
+
*
|
|
15
|
+
* The descriptor mirrors `acceptedInputs` (the pay-asset accept-set): a
|
|
16
|
+
* machine-readable answer to "do I have to pick a validator, and from where".
|
|
17
|
+
* Both are attached to each LST by the vault fetcher (`fetchLstShareTokens`).
|
|
18
|
+
*/
|
|
19
|
+
export type LstDelegationKind = 'validator' | 'validatorGroup' | 'node' | 'pool' | 'vault';
|
|
20
|
+
/** Descriptor of an LST's validator-selection requirement. */
|
|
21
|
+
export interface LstDelegation {
|
|
22
|
+
/** The integrator MUST supply a choice — no safe auto/default. (Core,
|
|
23
|
+
* Solv.) When `false`, omitting the choice still produces a working tx
|
|
24
|
+
* via `default` or server-side auto-resolution (Celo, Lair, TruFin). */
|
|
25
|
+
required: boolean;
|
|
26
|
+
/** What kind of target is being chosen. */
|
|
27
|
+
kind: LstDelegationKind;
|
|
28
|
+
/** The deposit option query param to send the chosen `id` back as
|
|
29
|
+
* (e.g. `validator`, `validatorGroup`, `node`, `poolId`, `vault`). */
|
|
30
|
+
optionKey: string;
|
|
31
|
+
/** A working default `id` when `required` is false; `'auto'` when the
|
|
32
|
+
* server resolves one (Celo); `null` when the protocol picks internally
|
|
33
|
+
* or a value is mandatory. */
|
|
34
|
+
default?: string | null;
|
|
35
|
+
/** `endpoint` ⇒ the live set is on-chain and returned in `validators`;
|
|
36
|
+
* `offchain` ⇒ the value comes from the protocol's docs/API (Solv
|
|
37
|
+
* poolId), so `validators` is empty. */
|
|
38
|
+
source: 'endpoint' | 'offchain';
|
|
39
|
+
}
|
|
40
|
+
/** A normalised, selectable delegation target. `id` is the opaque value to
|
|
41
|
+
* pass back as the deposit option named by {@link LstDelegation.optionKey}. */
|
|
42
|
+
export interface LstValidator {
|
|
43
|
+
/** Value to pass back to the deposit endpoint (validator / group / node
|
|
44
|
+
* address, or pool id). */
|
|
45
|
+
id: string;
|
|
46
|
+
/** Operational status. Only `active` targets are `selectable`. */
|
|
47
|
+
status: 'active' | 'inactive' | 'jailed' | 'full';
|
|
48
|
+
/** Passes the protocol's eligibility (healthy + not blocked + has room). */
|
|
49
|
+
selectable: boolean;
|
|
50
|
+
/** Our default pick (best capacity / health) — lets a UI preselect. */
|
|
51
|
+
recommended: boolean;
|
|
52
|
+
/** Remaining stake the target can absorb, raw underlying as string.
|
|
53
|
+
* Populated where the protocol exposes it (Celo `getReceivableVotesForGroup`). */
|
|
54
|
+
receivableVotes?: string;
|
|
55
|
+
}
|
|
56
|
+
/** The delegation descriptor for an LST, or `undefined` when it is pooled
|
|
57
|
+
* (no validator selection — the vast majority). */
|
|
58
|
+
export declare const getLstDelegation: (chainId: string, shareToken: string) => LstDelegation | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Fetch the live, selectable validator set for an LST, normalised across
|
|
61
|
+
* protocols. Returns `[]` for pooled LSTs, off-chain selections (Solv), or
|
|
62
|
+
* when the on-chain read fails (best-effort, never throws).
|
|
63
|
+
*/
|
|
64
|
+
export declare const getLstValidators: (chainId: string, shareToken: string) => Promise<LstValidator[]>;
|
|
65
|
+
//# sourceMappingURL=validators.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../../src/vaults/lst/validators.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,MAAM,iBAAiB,GACzB,WAAW,GACX,gBAAgB,GAChB,MAAM,GACN,MAAM,GACN,OAAO,CAAA;AAEX,8DAA8D;AAC9D,MAAM,WAAW,aAAa;IAC5B;;6EAEyE;IACzE,QAAQ,EAAE,OAAO,CAAA;IACjB,2CAA2C;IAC3C,IAAI,EAAE,iBAAiB,CAAA;IACvB;2EACuE;IACvE,SAAS,EAAE,MAAM,CAAA;IACjB;;mCAE+B;IAC/B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB;;6CAEyC;IACzC,MAAM,EAAE,UAAU,GAAG,UAAU,CAAA;CAChC;AAED;gFACgF;AAChF,MAAM,WAAW,YAAY;IAC3B;gCAC4B;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,kEAAkE;IAClE,MAAM,EAAE,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,MAAM,CAAA;IACjD,4EAA4E;IAC5E,UAAU,EAAE,OAAO,CAAA;IACnB,uEAAuE;IACvE,WAAW,EAAE,OAAO,CAAA;IACpB;uFACmF;IACnF,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB;AA0DD;oDACoD;AACpD,eAAO,MAAM,gBAAgB,GAC3B,SAAS,MAAM,EACf,YAAY,MAAM,KACjB,aAAa,GAAG,SACkC,CAAA;AAErD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAC3B,SAAS,MAAM,EACf,YAAY,MAAM,KACjB,OAAO,CAAC,YAAY,EAAE,CA6BxB,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.280",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"async-retry": "^1.3.3",
|
|
24
24
|
"lodash": "^4.17.23",
|
|
25
|
-
"@1delta/
|
|
26
|
-
"@1delta/
|
|
25
|
+
"@1delta/calldata-sdk": "0.0.152",
|
|
26
|
+
"@1delta/lender-registry": "0.0.32",
|
|
27
|
+
"@1delta/abis": "0.0.20",
|
|
27
28
|
"@1delta/dex-registry": "0.0.101",
|
|
28
29
|
"@1delta/providers": "0.0.59",
|
|
29
|
-
"@1delta/proxy-fetch": "0.0.1"
|
|
30
|
-
"@1delta/lender-registry": "0.0.32"
|
|
30
|
+
"@1delta/proxy-fetch": "0.0.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/async-retry": "^1.4.9",
|
package/dist/ccip-XQNAHYUN.js
DELETED