@defisaver/positions-sdk 2.1.92 → 2.1.94-dev
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/cjs/aaveV3/index.js +2 -5
- package/cjs/config/contracts.d.ts +8307 -1910
- package/cjs/config/contracts.js +37 -13
- package/cjs/contracts.d.ts +299 -1619
- package/cjs/types/common.d.ts +2 -2
- package/cjs/types/common.js +2 -2
- package/esm/aaveV3/index.js +3 -6
- package/esm/config/contracts.d.ts +8307 -1910
- package/esm/config/contracts.js +37 -13
- package/esm/contracts.d.ts +299 -1619
- package/esm/types/common.d.ts +2 -2
- package/esm/types/common.js +2 -2
- package/package.json +1 -1
- package/src/aaveV3/index.ts +2 -6
- package/src/config/contracts.ts +37 -13
- package/src/types/common.ts +2 -2
package/cjs/types/common.d.ts
CHANGED
|
@@ -3,10 +3,10 @@ export declare enum IncentiveKind {
|
|
|
3
3
|
Reward = "reward"
|
|
4
4
|
}
|
|
5
5
|
export declare enum IncentiveEligibilityId {
|
|
6
|
-
AaveV3EthenaLiquidLeverage = "
|
|
6
|
+
AaveV3EthenaLiquidLeverage = "0xa3a69b037797708422b49b4B1A200d5f79C518DBBORROW_BL",
|
|
7
7
|
AaveV3ArbitrumEthSupply = "0x5d16261c6715a653248269861bbacf68a9774cde",
|
|
8
8
|
AaveV3ArbitrumETHLSBorrow = "0x0c84331e39d6658Cd6e6b9ba04736cC4c4734351",
|
|
9
|
-
AaveV3EthenaLiquidLeveragePlasma = "
|
|
9
|
+
AaveV3EthenaLiquidLeveragePlasma = "0xb8A354b1CdC7537d0d92cc2f5C2596670558F7EFBORROW_BL",
|
|
10
10
|
AaveV3EthenaLiquidLeveragePlasmaGHO = "2b2f6fefcd3df634"
|
|
11
11
|
}
|
|
12
12
|
export declare enum LeverageType {
|
package/cjs/types/common.js
CHANGED
|
@@ -8,10 +8,10 @@ var IncentiveKind;
|
|
|
8
8
|
})(IncentiveKind || (exports.IncentiveKind = IncentiveKind = {}));
|
|
9
9
|
var IncentiveEligibilityId;
|
|
10
10
|
(function (IncentiveEligibilityId) {
|
|
11
|
-
IncentiveEligibilityId["AaveV3EthenaLiquidLeverage"] = "
|
|
11
|
+
IncentiveEligibilityId["AaveV3EthenaLiquidLeverage"] = "0xa3a69b037797708422b49b4B1A200d5f79C518DBBORROW_BL";
|
|
12
12
|
IncentiveEligibilityId["AaveV3ArbitrumEthSupply"] = "0x5d16261c6715a653248269861bbacf68a9774cde";
|
|
13
13
|
IncentiveEligibilityId["AaveV3ArbitrumETHLSBorrow"] = "0x0c84331e39d6658Cd6e6b9ba04736cC4c4734351";
|
|
14
|
-
IncentiveEligibilityId["AaveV3EthenaLiquidLeveragePlasma"] = "
|
|
14
|
+
IncentiveEligibilityId["AaveV3EthenaLiquidLeveragePlasma"] = "0xb8A354b1CdC7537d0d92cc2f5C2596670558F7EFBORROW_BL";
|
|
15
15
|
IncentiveEligibilityId["AaveV3EthenaLiquidLeveragePlasmaGHO"] = "2b2f6fefcd3df634";
|
|
16
16
|
})(IncentiveEligibilityId || (exports.IncentiveEligibilityId = IncentiveEligibilityId = {}));
|
|
17
17
|
var LeverageType;
|
package/esm/aaveV3/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import { AaveIncentiveDataProviderV3ContractViem, AaveIncentivesControllerViem,
|
|
|
13
13
|
import { aaveAnyGetAggregatedPositionData, aaveV3IsInIsolationMode, aaveV3IsInSiloedMode } from '../helpers/aaveHelpers';
|
|
14
14
|
import { AAVE_V3 } from '../markets/aave';
|
|
15
15
|
import { aprToApy, calculateBorrowingAssetLimit } from '../moneymarket';
|
|
16
|
-
import { getWrappedNativeAssetFromUnwrapped, isEnabledOnBitmap,
|
|
16
|
+
import { getWrappedNativeAssetFromUnwrapped, isEnabledOnBitmap, wethToEth, wethToEthByAddress, } from '../services/utils';
|
|
17
17
|
import { getStakingApy, STAKING_ASSETS } from '../staking';
|
|
18
18
|
import { IncentiveKind, NetworkNumber, } from '../types/common';
|
|
19
19
|
import { getViemProvider, setViemBlockNumber } from '../services/viem';
|
|
@@ -48,21 +48,18 @@ export const aaveV3EmodeCategoriesMapping = (extractedState, usedAssets) => {
|
|
|
48
48
|
export function _getAaveV3MarketData(provider_1, network_1, market_1) {
|
|
49
49
|
return __awaiter(this, arguments, void 0, function* (provider, network, market, blockNumber = 'latest') {
|
|
50
50
|
const _addresses = market.assets.map(a => getAssetInfo(getWrappedNativeAssetFromUnwrapped(a), network).address);
|
|
51
|
-
const isL2 = isLayer2Network(network);
|
|
52
51
|
const loanInfoContract = AaveV3ViewContractViem(provider, network);
|
|
53
52
|
const aaveIncentivesContract = AaveIncentiveDataProviderV3ContractViem(provider, network);
|
|
54
53
|
const marketAddress = market.providerAddress;
|
|
55
54
|
const networksWithIncentives = [NetworkNumber.Eth, NetworkNumber.Arb, NetworkNumber.Opt, NetworkNumber.Linea, NetworkNumber.Plasma];
|
|
56
55
|
// eslint-disable-next-line prefer-const
|
|
57
|
-
let [loanInfo, eModesInfo,
|
|
56
|
+
let [loanInfo, eModesInfo, rewardInfo, merkleRewardsMap, meritRewardsMap] = yield Promise.all([
|
|
58
57
|
loanInfoContract.read.getFullTokensInfo([marketAddress, _addresses], setViemBlockNumber(blockNumber)),
|
|
59
58
|
loanInfoContract.read.getAllEmodes([marketAddress], setViemBlockNumber(blockNumber)),
|
|
60
|
-
loanInfoContract.read.isBorrowAllowed([marketAddress], setViemBlockNumber(blockNumber)), // Used on L2s check for PriceOracleSentinel (mainnet will always return true)
|
|
61
59
|
networksWithIncentives.includes(network) ? aaveIncentivesContract.read.getReservesIncentivesData([marketAddress], setViemBlockNumber(blockNumber)) : null,
|
|
62
60
|
getMerkleCampaigns(network),
|
|
63
61
|
getMeritCampaigns(network, market.value),
|
|
64
62
|
]);
|
|
65
|
-
isBorrowAllowed = isLayer2Network(network) ? isBorrowAllowed : true;
|
|
66
63
|
// same break logic as view contract
|
|
67
64
|
let missCounter = 0;
|
|
68
65
|
const eModeCategoriesData = {};
|
|
@@ -143,7 +140,7 @@ export function _getAaveV3MarketData(provider_1, network_1, market_1) {
|
|
|
143
140
|
isInactive: !tokenMarket.isActive,
|
|
144
141
|
isFrozen: tokenMarket.isFrozen,
|
|
145
142
|
isPaused: tokenMarket.isPaused,
|
|
146
|
-
canBeBorrowed: tokenMarket.isActive && !tokenMarket.isPaused && !tokenMarket.isFrozen && tokenMarket.borrowingEnabled
|
|
143
|
+
canBeBorrowed: tokenMarket.isActive && !tokenMarket.isPaused && !tokenMarket.isFrozen && tokenMarket.borrowingEnabled,
|
|
147
144
|
canBeSupplied: tokenMarket.isActive && !tokenMarket.isPaused && !tokenMarket.isFrozen,
|
|
148
145
|
canBeWithdrawn: tokenMarket.isActive && !tokenMarket.isPaused,
|
|
149
146
|
canBePayBacked: tokenMarket.isActive && !tokenMarket.isPaused,
|