@avaprotocol/protocols 0.7.1 → 0.8.0
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/CHANGELOG.md +12 -0
- package/README.md +23 -1
- package/dist/index.cjs +114 -0
- package/dist/index.js +114 -0
- package/dist/protocols/aave-v3.d.ts +61 -0
- package/dist/protocols/aave-v3.d.ts.map +1 -1
- package/dist/protocols/index.d.ts +61 -0
- package/dist/protocols/index.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @avaprotocol/protocols
|
|
2
2
|
|
|
3
|
+
## 0.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- b8bcb3f: Ship AAVE V3 reserve-config read surface (issue #19, the scale optimization).
|
|
8
|
+
|
|
9
|
+
- Add `aaveV3.poolAddressesProvider` and `aaveV3.uiPoolDataProvider` per-chain address maps (Mainnet, Sepolia, Base, Base Sepolia, BNB). Each `PoolAddressesProvider` was verified on-chain — `getPool()` returns the catalog's existing `pool` address — and each `UiPoolDataProvider` verified as deployed bytecode.
|
|
10
|
+
- Extend `aaveV3.poolMethodsAbi` with the version-stable Pool config reads: `getConfiguration(asset)`, `getUserConfiguration(user)`, and `getReserveData(asset)` (`ReserveDataLegacy`). These cover a health-factor / liquidation solver's per-reserve risk config, a user's collateral/borrow flags, and the indices needed to scale balances — on every chain, with no periphery-version pinning.
|
|
11
|
+
- Export `aaveV3.reserveConfigurationBits` and `aaveV3.userConfigurationBits` — the `ReserveConfigurationMap` / `UserConfigurationMap` bit layouts — so consumers decode the on-chain bitmaps without hardcoding offsets. Only the version-stable low bits (0–167) are exported; higher bits shift across deployed V3 versions and are intentionally omitted.
|
|
12
|
+
|
|
13
|
+
Non-goal (unchanged): governance-mutable, HF-critical values (`ltv` / `liquidationThreshold` / `usageAsCollateralEnabled`) are **not** baked into the static `AaveV3Reserve` catalog — the catalog ships the address to read from, not the values. The `UiPoolDataProvider` address is shipped without its return-struct ABI on purpose: that tuple is periphery-version-specific and already differs across covered chains (Ethereum/Base/BNB/Base Sepolia return the v3.3 layout, Sepolia an earlier one), so pair the address with a version-aware ABI at the call site.
|
|
14
|
+
|
|
3
15
|
## 0.7.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ const sig = Protocols.aaveV3.eventTopics.Borrow;
|
|
|
23
23
|
|
|
24
24
|
| Protocol | Contracts | Chains |
|
|
25
25
|
|---|---|---|
|
|
26
|
-
| **AAVE V3** | Pool, Oracle, WETH Gateway + Pool methods/events ABI + topics | Mainnet, Sepolia, Base, Base Sepolia, **BNB** (no WETH Gateway on BNB) |
|
|
26
|
+
| **AAVE V3** | Pool, Oracle, WETH Gateway, PoolAddressesProvider, UiPoolDataProvider + Pool methods/events ABI (incl. config reads) + reserve/user config bit layouts + topics | Mainnet, Sepolia, Base, Base Sepolia, **BNB** (no WETH Gateway on BNB) |
|
|
27
27
|
| **Aerodrome** | Router | Base |
|
|
28
28
|
| **Chainlink** | ETH/USD + BTC/USD + BNB/USD feeds + AggregatorV3 ABI | Mainnet, Sepolia, **BNB** (BNB/USD is BNB-only) |
|
|
29
29
|
| **Compound V3** | USDC Comet market | Mainnet, Base |
|
|
@@ -91,6 +91,28 @@ await wallet.contractWrite({
|
|
|
91
91
|
});
|
|
92
92
|
```
|
|
93
93
|
|
|
94
|
+
### Read a reserve's risk config (health-factor math)
|
|
95
|
+
|
|
96
|
+
Risk parameters (`ltv`, `liquidationThreshold`, `active`/`frozen`/`paused`, …) are **governance-mutable** — the catalog deliberately does **not** bake their values into the static `reserves` list. Ship the address to read from, not the value; the live read stays in the consumer. Decode the on-chain bitmap with the exported bit layout, which is version-stable across every deployed AAVE V3 market:
|
|
97
|
+
|
|
98
|
+
```ts
|
|
99
|
+
import { Protocols, Chains } from "@avaprotocol/protocols";
|
|
100
|
+
|
|
101
|
+
// Pool.getConfiguration(asset) → ReserveConfigurationMap { data: uint256 }
|
|
102
|
+
const raw = BigInt(configData); // the `data` field of the returned struct
|
|
103
|
+
const { ltv, liquidationThreshold, decimals } = Protocols.aaveV3.reserveConfigurationBits;
|
|
104
|
+
const field = (f: { offset: number; bits: number }) =>
|
|
105
|
+
(raw >> BigInt(f.offset)) & ((1n << BigInt(f.bits)) - 1n);
|
|
106
|
+
|
|
107
|
+
const ltvBps = Number(field(ltv)); // e.g. 8050 = 80.50%
|
|
108
|
+
const liqThresholdBps = Number(field(liquidationThreshold));
|
|
109
|
+
const tokenDecimals = Number(field(decimals));
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
For a whole-market sweep in one round-trip, use `Protocols.aaveV3.uiPoolDataProvider[chainId]` with `PoolAddressesProvider` — note the SDK ships the **addresses** but not the periphery return-struct ABI, which is version-specific per chain; pair it with a version-aware ABI (e.g. `@bgd-labs/aave-address-book`). `Protocols.aaveV3.poolMethodsAbi` carries the version-stable `getConfiguration` / `getUserConfiguration` / `getReserveData` reads for the per-asset path on any chain.
|
|
113
|
+
|
|
114
|
+
> **Caveat — `liquidationThreshold` alone doesn't fully determine collateral.** The exported bits cover only the version-stable low bits (0–167); isolation-mode / eMode live in the omitted higher bits. A freshly-supplied **isolation-mode** asset may not count as collateral at all, and eMode raises the effective threshold for correlated assets — so a top-up solver sizing a health-factor lift off `liquidationThreshold` alone can over- or under-estimate it in those cases. Also read the user's collateral flags (`getUserConfiguration` + `userConfigurationBits`) and, where isolation/eMode is in play, the market's own contracts for those bits.
|
|
115
|
+
|
|
94
116
|
### Filter on an event topic
|
|
95
117
|
|
|
96
118
|
```ts
|
package/dist/index.cjs
CHANGED
|
@@ -193,6 +193,20 @@ var wethGateway = {
|
|
|
193
193
|
[Chains.BaseMainnet]: "0xa0d9C1E9E48Ca30c8d8C3B5D69FF5dc1f6DFfC24",
|
|
194
194
|
[Chains.BaseSepolia]: "0x0568130e794429D2eEBC4dafE18f25Ff1a1ed8b6"
|
|
195
195
|
};
|
|
196
|
+
var poolAddressesProvider = {
|
|
197
|
+
[Chains.EthereumMainnet]: "0x2f39d218133AFaB8F2B819B1066c7E434Ad94E9e",
|
|
198
|
+
[Chains.Sepolia]: "0x012bAC54348C0E635dCAc9D5FB99f06F24136C9A",
|
|
199
|
+
[Chains.BaseMainnet]: "0xe20fCBdBfFC4Dd138cE8b2E6FBb6CB49777ad64D",
|
|
200
|
+
[Chains.BaseSepolia]: "0xE4C23309117Aa30342BFaae6c95c6478e0A4Ad00",
|
|
201
|
+
[Chains.BnbMainnet]: "0xff75B6da14FfbbfD355Daf7a2731456b3562Ba6D"
|
|
202
|
+
};
|
|
203
|
+
var uiPoolDataProvider = {
|
|
204
|
+
[Chains.EthereumMainnet]: "0x2dAd8162A989cd99D673dE4425Bb2298Db1E1aA2",
|
|
205
|
+
[Chains.Sepolia]: "0x69529987FA4A075D0C00B0128fa848dc9ebbE9CE",
|
|
206
|
+
[Chains.BaseMainnet]: "0x0C6BC4a12039788be08F87e87Cff87FEDbd1D386",
|
|
207
|
+
[Chains.BaseSepolia]: "0x3cB7B00B6C09B71998124196691e8bF2694De863",
|
|
208
|
+
[Chains.BnbMainnet]: "0x68100bD5345eA474D93577127C11F39FF8463e93"
|
|
209
|
+
};
|
|
196
210
|
var eventTopics = Object.freeze({
|
|
197
211
|
Supply: "0x2b627736bca15cd5381dcf80b0bf11fd197d01a037c52b927a881a10fb73ba61",
|
|
198
212
|
Withdraw: "0x3115d1449a7b732c986cba18244e897a450f61e1bb8d589cd2e69e6c8924f9f7",
|
|
@@ -337,8 +351,104 @@ var poolMethodsAbi = Object.freeze([
|
|
|
337
351
|
outputs: [],
|
|
338
352
|
stateMutability: "nonpayable",
|
|
339
353
|
type: "function"
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
// Returns the reserve's ReserveConfigurationMap — a single uint256
|
|
357
|
+
// bitmap. Decode with `reserveConfigurationBits`.
|
|
358
|
+
inputs: [{ internalType: "address", name: "asset", type: "address" }],
|
|
359
|
+
name: "getConfiguration",
|
|
360
|
+
outputs: [
|
|
361
|
+
{
|
|
362
|
+
components: [{ internalType: "uint256", name: "data", type: "uint256" }],
|
|
363
|
+
internalType: "struct DataTypes.ReserveConfigurationMap",
|
|
364
|
+
name: "",
|
|
365
|
+
type: "tuple"
|
|
366
|
+
}
|
|
367
|
+
],
|
|
368
|
+
stateMutability: "view",
|
|
369
|
+
type: "function"
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
// Returns the user's UserConfigurationMap — a single uint256 bitmap
|
|
373
|
+
// packing, per reserve index, an is-borrowing and a
|
|
374
|
+
// use-as-collateral flag. Decode with `userConfigurationBits`.
|
|
375
|
+
inputs: [{ internalType: "address", name: "user", type: "address" }],
|
|
376
|
+
name: "getUserConfiguration",
|
|
377
|
+
outputs: [
|
|
378
|
+
{
|
|
379
|
+
components: [{ internalType: "uint256", name: "data", type: "uint256" }],
|
|
380
|
+
internalType: "struct DataTypes.UserConfigurationMap",
|
|
381
|
+
name: "",
|
|
382
|
+
type: "tuple"
|
|
383
|
+
}
|
|
384
|
+
],
|
|
385
|
+
stateMutability: "view",
|
|
386
|
+
type: "function"
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
// ReserveDataLegacy — kept ABI-stable across V3 versions for
|
|
390
|
+
// back-compat. Carries the config bitmap (`configuration.data`), the
|
|
391
|
+
// liquidity / variable-borrow indices (to scale a user's aToken /
|
|
392
|
+
// debt balances to underlying), and the reserve's aToken /
|
|
393
|
+
// variable-debt token addresses + `id` (its index in the user
|
|
394
|
+
// configuration bitmap). Note: `stableDebtTokenAddress` is deprecated
|
|
395
|
+
// (stable-rate borrowing is removed on V3.1+ markets — it reads as the
|
|
396
|
+
// zero address there); a repay path should use `variableDebtTokenAddress`.
|
|
397
|
+
inputs: [{ internalType: "address", name: "asset", type: "address" }],
|
|
398
|
+
name: "getReserveData",
|
|
399
|
+
outputs: [
|
|
400
|
+
{
|
|
401
|
+
components: [
|
|
402
|
+
{
|
|
403
|
+
components: [{ internalType: "uint256", name: "data", type: "uint256" }],
|
|
404
|
+
internalType: "struct DataTypes.ReserveConfigurationMap",
|
|
405
|
+
name: "configuration",
|
|
406
|
+
type: "tuple"
|
|
407
|
+
},
|
|
408
|
+
{ internalType: "uint128", name: "liquidityIndex", type: "uint128" },
|
|
409
|
+
{ internalType: "uint128", name: "currentLiquidityRate", type: "uint128" },
|
|
410
|
+
{ internalType: "uint128", name: "variableBorrowIndex", type: "uint128" },
|
|
411
|
+
{ internalType: "uint128", name: "currentVariableBorrowRate", type: "uint128" },
|
|
412
|
+
{ internalType: "uint128", name: "currentStableBorrowRate", type: "uint128" },
|
|
413
|
+
{ internalType: "uint40", name: "lastUpdateTimestamp", type: "uint40" },
|
|
414
|
+
{ internalType: "uint16", name: "id", type: "uint16" },
|
|
415
|
+
{ internalType: "address", name: "aTokenAddress", type: "address" },
|
|
416
|
+
{ internalType: "address", name: "stableDebtTokenAddress", type: "address" },
|
|
417
|
+
{ internalType: "address", name: "variableDebtTokenAddress", type: "address" },
|
|
418
|
+
{ internalType: "address", name: "interestRateStrategyAddress", type: "address" },
|
|
419
|
+
{ internalType: "uint128", name: "accruedToTreasury", type: "uint128" },
|
|
420
|
+
{ internalType: "uint128", name: "unbacked", type: "uint128" },
|
|
421
|
+
{ internalType: "uint128", name: "isolationModeTotalDebt", type: "uint128" }
|
|
422
|
+
],
|
|
423
|
+
internalType: "struct DataTypes.ReserveDataLegacy",
|
|
424
|
+
name: "",
|
|
425
|
+
type: "tuple"
|
|
426
|
+
}
|
|
427
|
+
],
|
|
428
|
+
stateMutability: "view",
|
|
429
|
+
type: "function"
|
|
340
430
|
}
|
|
341
431
|
]);
|
|
432
|
+
var reserveConfigurationBits = Object.freeze({
|
|
433
|
+
ltv: { offset: 0, bits: 16 },
|
|
434
|
+
liquidationThreshold: { offset: 16, bits: 16 },
|
|
435
|
+
liquidationBonus: { offset: 32, bits: 16 },
|
|
436
|
+
decimals: { offset: 48, bits: 8 },
|
|
437
|
+
active: { offset: 56, bits: 1 },
|
|
438
|
+
frozen: { offset: 57, bits: 1 },
|
|
439
|
+
borrowingEnabled: { offset: 58, bits: 1 },
|
|
440
|
+
paused: { offset: 60, bits: 1 },
|
|
441
|
+
flashLoanEnabled: { offset: 63, bits: 1 },
|
|
442
|
+
reserveFactor: { offset: 64, bits: 16 },
|
|
443
|
+
borrowCap: { offset: 80, bits: 36 },
|
|
444
|
+
supplyCap: { offset: 116, bits: 36 },
|
|
445
|
+
liquidationProtocolFee: { offset: 152, bits: 16 }
|
|
446
|
+
});
|
|
447
|
+
var userConfigurationBits = Object.freeze({
|
|
448
|
+
bitsPerReserve: 2,
|
|
449
|
+
borrowingOffset: 0,
|
|
450
|
+
collateralOffset: 1
|
|
451
|
+
});
|
|
342
452
|
var tokens = Object.freeze({
|
|
343
453
|
LINK: {
|
|
344
454
|
[Chains.Sepolia]: "0xf8Fb3713D459D7C1018BD0A49D19b4C44290EBE5"
|
|
@@ -349,9 +459,13 @@ var aaveV3 = Object.freeze({
|
|
|
349
459
|
pool,
|
|
350
460
|
oracle,
|
|
351
461
|
wethGateway,
|
|
462
|
+
poolAddressesProvider,
|
|
463
|
+
uiPoolDataProvider,
|
|
352
464
|
eventTopics,
|
|
353
465
|
poolEventsAbi,
|
|
354
466
|
poolMethodsAbi,
|
|
467
|
+
reserveConfigurationBits,
|
|
468
|
+
userConfigurationBits,
|
|
355
469
|
tokens,
|
|
356
470
|
reserves
|
|
357
471
|
});
|
package/dist/index.js
CHANGED
|
@@ -147,6 +147,20 @@ var wethGateway = {
|
|
|
147
147
|
[Chains.BaseMainnet]: "0xa0d9C1E9E48Ca30c8d8C3B5D69FF5dc1f6DFfC24",
|
|
148
148
|
[Chains.BaseSepolia]: "0x0568130e794429D2eEBC4dafE18f25Ff1a1ed8b6"
|
|
149
149
|
};
|
|
150
|
+
var poolAddressesProvider = {
|
|
151
|
+
[Chains.EthereumMainnet]: "0x2f39d218133AFaB8F2B819B1066c7E434Ad94E9e",
|
|
152
|
+
[Chains.Sepolia]: "0x012bAC54348C0E635dCAc9D5FB99f06F24136C9A",
|
|
153
|
+
[Chains.BaseMainnet]: "0xe20fCBdBfFC4Dd138cE8b2E6FBb6CB49777ad64D",
|
|
154
|
+
[Chains.BaseSepolia]: "0xE4C23309117Aa30342BFaae6c95c6478e0A4Ad00",
|
|
155
|
+
[Chains.BnbMainnet]: "0xff75B6da14FfbbfD355Daf7a2731456b3562Ba6D"
|
|
156
|
+
};
|
|
157
|
+
var uiPoolDataProvider = {
|
|
158
|
+
[Chains.EthereumMainnet]: "0x2dAd8162A989cd99D673dE4425Bb2298Db1E1aA2",
|
|
159
|
+
[Chains.Sepolia]: "0x69529987FA4A075D0C00B0128fa848dc9ebbE9CE",
|
|
160
|
+
[Chains.BaseMainnet]: "0x0C6BC4a12039788be08F87e87Cff87FEDbd1D386",
|
|
161
|
+
[Chains.BaseSepolia]: "0x3cB7B00B6C09B71998124196691e8bF2694De863",
|
|
162
|
+
[Chains.BnbMainnet]: "0x68100bD5345eA474D93577127C11F39FF8463e93"
|
|
163
|
+
};
|
|
150
164
|
var eventTopics = Object.freeze({
|
|
151
165
|
Supply: "0x2b627736bca15cd5381dcf80b0bf11fd197d01a037c52b927a881a10fb73ba61",
|
|
152
166
|
Withdraw: "0x3115d1449a7b732c986cba18244e897a450f61e1bb8d589cd2e69e6c8924f9f7",
|
|
@@ -291,8 +305,104 @@ var poolMethodsAbi = Object.freeze([
|
|
|
291
305
|
outputs: [],
|
|
292
306
|
stateMutability: "nonpayable",
|
|
293
307
|
type: "function"
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
// Returns the reserve's ReserveConfigurationMap — a single uint256
|
|
311
|
+
// bitmap. Decode with `reserveConfigurationBits`.
|
|
312
|
+
inputs: [{ internalType: "address", name: "asset", type: "address" }],
|
|
313
|
+
name: "getConfiguration",
|
|
314
|
+
outputs: [
|
|
315
|
+
{
|
|
316
|
+
components: [{ internalType: "uint256", name: "data", type: "uint256" }],
|
|
317
|
+
internalType: "struct DataTypes.ReserveConfigurationMap",
|
|
318
|
+
name: "",
|
|
319
|
+
type: "tuple"
|
|
320
|
+
}
|
|
321
|
+
],
|
|
322
|
+
stateMutability: "view",
|
|
323
|
+
type: "function"
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
// Returns the user's UserConfigurationMap — a single uint256 bitmap
|
|
327
|
+
// packing, per reserve index, an is-borrowing and a
|
|
328
|
+
// use-as-collateral flag. Decode with `userConfigurationBits`.
|
|
329
|
+
inputs: [{ internalType: "address", name: "user", type: "address" }],
|
|
330
|
+
name: "getUserConfiguration",
|
|
331
|
+
outputs: [
|
|
332
|
+
{
|
|
333
|
+
components: [{ internalType: "uint256", name: "data", type: "uint256" }],
|
|
334
|
+
internalType: "struct DataTypes.UserConfigurationMap",
|
|
335
|
+
name: "",
|
|
336
|
+
type: "tuple"
|
|
337
|
+
}
|
|
338
|
+
],
|
|
339
|
+
stateMutability: "view",
|
|
340
|
+
type: "function"
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
// ReserveDataLegacy — kept ABI-stable across V3 versions for
|
|
344
|
+
// back-compat. Carries the config bitmap (`configuration.data`), the
|
|
345
|
+
// liquidity / variable-borrow indices (to scale a user's aToken /
|
|
346
|
+
// debt balances to underlying), and the reserve's aToken /
|
|
347
|
+
// variable-debt token addresses + `id` (its index in the user
|
|
348
|
+
// configuration bitmap). Note: `stableDebtTokenAddress` is deprecated
|
|
349
|
+
// (stable-rate borrowing is removed on V3.1+ markets — it reads as the
|
|
350
|
+
// zero address there); a repay path should use `variableDebtTokenAddress`.
|
|
351
|
+
inputs: [{ internalType: "address", name: "asset", type: "address" }],
|
|
352
|
+
name: "getReserveData",
|
|
353
|
+
outputs: [
|
|
354
|
+
{
|
|
355
|
+
components: [
|
|
356
|
+
{
|
|
357
|
+
components: [{ internalType: "uint256", name: "data", type: "uint256" }],
|
|
358
|
+
internalType: "struct DataTypes.ReserveConfigurationMap",
|
|
359
|
+
name: "configuration",
|
|
360
|
+
type: "tuple"
|
|
361
|
+
},
|
|
362
|
+
{ internalType: "uint128", name: "liquidityIndex", type: "uint128" },
|
|
363
|
+
{ internalType: "uint128", name: "currentLiquidityRate", type: "uint128" },
|
|
364
|
+
{ internalType: "uint128", name: "variableBorrowIndex", type: "uint128" },
|
|
365
|
+
{ internalType: "uint128", name: "currentVariableBorrowRate", type: "uint128" },
|
|
366
|
+
{ internalType: "uint128", name: "currentStableBorrowRate", type: "uint128" },
|
|
367
|
+
{ internalType: "uint40", name: "lastUpdateTimestamp", type: "uint40" },
|
|
368
|
+
{ internalType: "uint16", name: "id", type: "uint16" },
|
|
369
|
+
{ internalType: "address", name: "aTokenAddress", type: "address" },
|
|
370
|
+
{ internalType: "address", name: "stableDebtTokenAddress", type: "address" },
|
|
371
|
+
{ internalType: "address", name: "variableDebtTokenAddress", type: "address" },
|
|
372
|
+
{ internalType: "address", name: "interestRateStrategyAddress", type: "address" },
|
|
373
|
+
{ internalType: "uint128", name: "accruedToTreasury", type: "uint128" },
|
|
374
|
+
{ internalType: "uint128", name: "unbacked", type: "uint128" },
|
|
375
|
+
{ internalType: "uint128", name: "isolationModeTotalDebt", type: "uint128" }
|
|
376
|
+
],
|
|
377
|
+
internalType: "struct DataTypes.ReserveDataLegacy",
|
|
378
|
+
name: "",
|
|
379
|
+
type: "tuple"
|
|
380
|
+
}
|
|
381
|
+
],
|
|
382
|
+
stateMutability: "view",
|
|
383
|
+
type: "function"
|
|
294
384
|
}
|
|
295
385
|
]);
|
|
386
|
+
var reserveConfigurationBits = Object.freeze({
|
|
387
|
+
ltv: { offset: 0, bits: 16 },
|
|
388
|
+
liquidationThreshold: { offset: 16, bits: 16 },
|
|
389
|
+
liquidationBonus: { offset: 32, bits: 16 },
|
|
390
|
+
decimals: { offset: 48, bits: 8 },
|
|
391
|
+
active: { offset: 56, bits: 1 },
|
|
392
|
+
frozen: { offset: 57, bits: 1 },
|
|
393
|
+
borrowingEnabled: { offset: 58, bits: 1 },
|
|
394
|
+
paused: { offset: 60, bits: 1 },
|
|
395
|
+
flashLoanEnabled: { offset: 63, bits: 1 },
|
|
396
|
+
reserveFactor: { offset: 64, bits: 16 },
|
|
397
|
+
borrowCap: { offset: 80, bits: 36 },
|
|
398
|
+
supplyCap: { offset: 116, bits: 36 },
|
|
399
|
+
liquidationProtocolFee: { offset: 152, bits: 16 }
|
|
400
|
+
});
|
|
401
|
+
var userConfigurationBits = Object.freeze({
|
|
402
|
+
bitsPerReserve: 2,
|
|
403
|
+
borrowingOffset: 0,
|
|
404
|
+
collateralOffset: 1
|
|
405
|
+
});
|
|
296
406
|
var tokens = Object.freeze({
|
|
297
407
|
LINK: {
|
|
298
408
|
[Chains.Sepolia]: "0xf8Fb3713D459D7C1018BD0A49D19b4C44290EBE5"
|
|
@@ -303,9 +413,13 @@ var aaveV3 = Object.freeze({
|
|
|
303
413
|
pool,
|
|
304
414
|
oracle,
|
|
305
415
|
wethGateway,
|
|
416
|
+
poolAddressesProvider,
|
|
417
|
+
uiPoolDataProvider,
|
|
306
418
|
eventTopics,
|
|
307
419
|
poolEventsAbi,
|
|
308
420
|
poolMethodsAbi,
|
|
421
|
+
reserveConfigurationBits,
|
|
422
|
+
userConfigurationBits,
|
|
309
423
|
tokens,
|
|
310
424
|
reserves
|
|
311
425
|
});
|
|
@@ -3,6 +3,8 @@ export declare const aaveV3: Readonly<{
|
|
|
3
3
|
pool: Partial<Record<number, `0x${string}`>>;
|
|
4
4
|
oracle: Partial<Record<number, `0x${string}`>>;
|
|
5
5
|
wethGateway: Partial<Record<number, `0x${string}`>>;
|
|
6
|
+
poolAddressesProvider: Partial<Record<number, `0x${string}`>>;
|
|
7
|
+
uiPoolDataProvider: Partial<Record<number, `0x${string}`>>;
|
|
6
8
|
eventTopics: Readonly<{
|
|
7
9
|
readonly Supply: "0x2b627736bca15cd5381dcf80b0bf11fd197d01a037c52b927a881a10fb73ba61";
|
|
8
10
|
readonly Withdraw: "0x3115d1449a7b732c986cba18244e897a450f61e1bb8d589cd2e69e6c8924f9f7";
|
|
@@ -12,6 +14,65 @@ export declare const aaveV3: Readonly<{
|
|
|
12
14
|
}>;
|
|
13
15
|
poolEventsAbi: readonly AbiFragment[];
|
|
14
16
|
poolMethodsAbi: readonly AbiFragment[];
|
|
17
|
+
reserveConfigurationBits: Readonly<{
|
|
18
|
+
readonly ltv: {
|
|
19
|
+
readonly offset: 0;
|
|
20
|
+
readonly bits: 16;
|
|
21
|
+
};
|
|
22
|
+
readonly liquidationThreshold: {
|
|
23
|
+
readonly offset: 16;
|
|
24
|
+
readonly bits: 16;
|
|
25
|
+
};
|
|
26
|
+
readonly liquidationBonus: {
|
|
27
|
+
readonly offset: 32;
|
|
28
|
+
readonly bits: 16;
|
|
29
|
+
};
|
|
30
|
+
readonly decimals: {
|
|
31
|
+
readonly offset: 48;
|
|
32
|
+
readonly bits: 8;
|
|
33
|
+
};
|
|
34
|
+
readonly active: {
|
|
35
|
+
readonly offset: 56;
|
|
36
|
+
readonly bits: 1;
|
|
37
|
+
};
|
|
38
|
+
readonly frozen: {
|
|
39
|
+
readonly offset: 57;
|
|
40
|
+
readonly bits: 1;
|
|
41
|
+
};
|
|
42
|
+
readonly borrowingEnabled: {
|
|
43
|
+
readonly offset: 58;
|
|
44
|
+
readonly bits: 1;
|
|
45
|
+
};
|
|
46
|
+
readonly paused: {
|
|
47
|
+
readonly offset: 60;
|
|
48
|
+
readonly bits: 1;
|
|
49
|
+
};
|
|
50
|
+
readonly flashLoanEnabled: {
|
|
51
|
+
readonly offset: 63;
|
|
52
|
+
readonly bits: 1;
|
|
53
|
+
};
|
|
54
|
+
readonly reserveFactor: {
|
|
55
|
+
readonly offset: 64;
|
|
56
|
+
readonly bits: 16;
|
|
57
|
+
};
|
|
58
|
+
readonly borrowCap: {
|
|
59
|
+
readonly offset: 80;
|
|
60
|
+
readonly bits: 36;
|
|
61
|
+
};
|
|
62
|
+
readonly supplyCap: {
|
|
63
|
+
readonly offset: 116;
|
|
64
|
+
readonly bits: 36;
|
|
65
|
+
};
|
|
66
|
+
readonly liquidationProtocolFee: {
|
|
67
|
+
readonly offset: 152;
|
|
68
|
+
readonly bits: 16;
|
|
69
|
+
};
|
|
70
|
+
}>;
|
|
71
|
+
userConfigurationBits: Readonly<{
|
|
72
|
+
readonly bitsPerReserve: 2;
|
|
73
|
+
readonly borrowingOffset: 0;
|
|
74
|
+
readonly collateralOffset: 1;
|
|
75
|
+
}>;
|
|
15
76
|
tokens: Readonly<{
|
|
16
77
|
LINK: {
|
|
17
78
|
11155111: "0xf8Fb3713D459D7C1018BD0A49D19b4C44290EBE5";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aave-v3.d.ts","sourceRoot":"","sources":["../../src/protocols/aave-v3.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"aave-v3.d.ts","sourceRoot":"","sources":["../../src/protocols/aave-v3.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,KAAK,WAAW,EAAuB,MAAM,SAAS,CAAC;AAmbhE,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAajB,CAAC"}
|
|
@@ -37,6 +37,8 @@ export declare const Protocols: Readonly<{
|
|
|
37
37
|
pool: Partial<Record<number, `0x${string}`>>;
|
|
38
38
|
oracle: Partial<Record<number, `0x${string}`>>;
|
|
39
39
|
wethGateway: Partial<Record<number, `0x${string}`>>;
|
|
40
|
+
poolAddressesProvider: Partial<Record<number, `0x${string}`>>;
|
|
41
|
+
uiPoolDataProvider: Partial<Record<number, `0x${string}`>>;
|
|
40
42
|
eventTopics: Readonly<{
|
|
41
43
|
readonly Supply: "0x2b627736bca15cd5381dcf80b0bf11fd197d01a037c52b927a881a10fb73ba61";
|
|
42
44
|
readonly Withdraw: "0x3115d1449a7b732c986cba18244e897a450f61e1bb8d589cd2e69e6c8924f9f7";
|
|
@@ -46,6 +48,65 @@ export declare const Protocols: Readonly<{
|
|
|
46
48
|
}>;
|
|
47
49
|
poolEventsAbi: readonly import("./types").AbiFragment[];
|
|
48
50
|
poolMethodsAbi: readonly import("./types").AbiFragment[];
|
|
51
|
+
reserveConfigurationBits: Readonly<{
|
|
52
|
+
readonly ltv: {
|
|
53
|
+
readonly offset: 0;
|
|
54
|
+
readonly bits: 16;
|
|
55
|
+
};
|
|
56
|
+
readonly liquidationThreshold: {
|
|
57
|
+
readonly offset: 16;
|
|
58
|
+
readonly bits: 16;
|
|
59
|
+
};
|
|
60
|
+
readonly liquidationBonus: {
|
|
61
|
+
readonly offset: 32;
|
|
62
|
+
readonly bits: 16;
|
|
63
|
+
};
|
|
64
|
+
readonly decimals: {
|
|
65
|
+
readonly offset: 48;
|
|
66
|
+
readonly bits: 8;
|
|
67
|
+
};
|
|
68
|
+
readonly active: {
|
|
69
|
+
readonly offset: 56;
|
|
70
|
+
readonly bits: 1;
|
|
71
|
+
};
|
|
72
|
+
readonly frozen: {
|
|
73
|
+
readonly offset: 57;
|
|
74
|
+
readonly bits: 1;
|
|
75
|
+
};
|
|
76
|
+
readonly borrowingEnabled: {
|
|
77
|
+
readonly offset: 58;
|
|
78
|
+
readonly bits: 1;
|
|
79
|
+
};
|
|
80
|
+
readonly paused: {
|
|
81
|
+
readonly offset: 60;
|
|
82
|
+
readonly bits: 1;
|
|
83
|
+
};
|
|
84
|
+
readonly flashLoanEnabled: {
|
|
85
|
+
readonly offset: 63;
|
|
86
|
+
readonly bits: 1;
|
|
87
|
+
};
|
|
88
|
+
readonly reserveFactor: {
|
|
89
|
+
readonly offset: 64;
|
|
90
|
+
readonly bits: 16;
|
|
91
|
+
};
|
|
92
|
+
readonly borrowCap: {
|
|
93
|
+
readonly offset: 80;
|
|
94
|
+
readonly bits: 36;
|
|
95
|
+
};
|
|
96
|
+
readonly supplyCap: {
|
|
97
|
+
readonly offset: 116;
|
|
98
|
+
readonly bits: 36;
|
|
99
|
+
};
|
|
100
|
+
readonly liquidationProtocolFee: {
|
|
101
|
+
readonly offset: 152;
|
|
102
|
+
readonly bits: 16;
|
|
103
|
+
};
|
|
104
|
+
}>;
|
|
105
|
+
userConfigurationBits: Readonly<{
|
|
106
|
+
readonly bitsPerReserve: 2;
|
|
107
|
+
readonly borrowingOffset: 0;
|
|
108
|
+
readonly collateralOffset: 1;
|
|
109
|
+
}>;
|
|
49
110
|
tokens: Readonly<{
|
|
50
111
|
LINK: {
|
|
51
112
|
11155111: "0xf8Fb3713D459D7C1018BD0A49D19b4C44290EBE5";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/protocols/index.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC5D,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAkBjG;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/protocols/index.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC5D,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAkBjG;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBpB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avaprotocol/protocols",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Multi-chain catalog of DeFi protocol contract addresses, ABI fragments, and event topic hashes — covers AAVE V3, Uniswap V3, Chainlink, Lido, Morpho, and more.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"defi",
|