@defisaver/positions-sdk 2.1.84-aave-v4-max-dev → 2.1.84-aave-v4-max-1-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/aaveV4/index.js +2 -1
- package/esm/aaveV4/index.js +2 -1
- package/package.json +1 -1
- package/src/aaveV4/index.ts +3 -1
package/cjs/aaveV4/index.js
CHANGED
|
@@ -129,7 +129,7 @@ const formatReserveAsset = (reserveAsset, hubAsset, reserveId, oracleDecimals, n
|
|
|
129
129
|
const supplyApr = borrowApr.mul(hubUtilization).mul(premiumMultiplier).mul(new decimal_js_1.default(1).minus(liquidityFee));
|
|
130
130
|
const utilization = hubUtilization.times(100).toString();
|
|
131
131
|
const hubLiquidityRaw = hubAsset.liquidity;
|
|
132
|
-
const hubLiquidity = (0, tokens_1.assetAmountInEth)(hubLiquidityRaw.toString(), symbol);
|
|
132
|
+
const hubLiquidity = (0, utils_1.isMaxUint)(hubLiquidityRaw.toString()) ? hubLiquidityRaw.toString() : (0, tokens_1.assetAmountInEth)(hubLiquidityRaw.toString(), symbol);
|
|
133
133
|
return ({
|
|
134
134
|
symbol,
|
|
135
135
|
underlying: reserveAsset.underlying,
|
|
@@ -176,6 +176,7 @@ function _getAaveV4SpokeData(provider_1, network_1, market_1) {
|
|
|
176
176
|
hubsData[hubAddress] = yield fetchHubData(viewContract, hubAddress);
|
|
177
177
|
})),
|
|
178
178
|
]);
|
|
179
|
+
console.log(spokeData);
|
|
179
180
|
const reserveAssetsArray = yield Promise.all(spokeData[1].map((reserveAssetOnChain, index) => __awaiter(this, void 0, void 0, function* () { return formatReserveAsset(reserveAssetOnChain, hubsData[reserveAssetOnChain.hub].assets[reserveAssetOnChain.assetId], index, +spokeData[0].oracleDecimals.toString(), network); })));
|
|
180
181
|
return {
|
|
181
182
|
assetsData: reserveAssetsArray.reduce((acc, reserveAsset) => {
|
package/esm/aaveV4/index.js
CHANGED
|
@@ -86,7 +86,7 @@ const formatReserveAsset = (reserveAsset, hubAsset, reserveId, oracleDecimals, n
|
|
|
86
86
|
const supplyApr = borrowApr.mul(hubUtilization).mul(premiumMultiplier).mul(new Dec(1).minus(liquidityFee));
|
|
87
87
|
const utilization = hubUtilization.times(100).toString();
|
|
88
88
|
const hubLiquidityRaw = hubAsset.liquidity;
|
|
89
|
-
const hubLiquidity = assetAmountInEth(hubLiquidityRaw.toString(), symbol);
|
|
89
|
+
const hubLiquidity = isMaxUint(hubLiquidityRaw.toString()) ? hubLiquidityRaw.toString() : assetAmountInEth(hubLiquidityRaw.toString(), symbol);
|
|
90
90
|
return ({
|
|
91
91
|
symbol,
|
|
92
92
|
underlying: reserveAsset.underlying,
|
|
@@ -133,6 +133,7 @@ export function _getAaveV4SpokeData(provider_1, network_1, market_1) {
|
|
|
133
133
|
hubsData[hubAddress] = yield fetchHubData(viewContract, hubAddress);
|
|
134
134
|
})),
|
|
135
135
|
]);
|
|
136
|
+
console.log(spokeData);
|
|
136
137
|
const reserveAssetsArray = yield Promise.all(spokeData[1].map((reserveAssetOnChain, index) => __awaiter(this, void 0, void 0, function* () { return formatReserveAsset(reserveAssetOnChain, hubsData[reserveAssetOnChain.hub].assets[reserveAssetOnChain.assetId], index, +spokeData[0].oracleDecimals.toString(), network); })));
|
|
137
138
|
return {
|
|
138
139
|
assetsData: reserveAssetsArray.reduce((acc, reserveAsset) => {
|
package/package.json
CHANGED
package/src/aaveV4/index.ts
CHANGED
|
@@ -100,7 +100,7 @@ const formatReserveAsset = async (reserveAsset: AaveV4ReserveAssetOnChain, hubAs
|
|
|
100
100
|
const utilization = hubUtilization.times(100).toString();
|
|
101
101
|
|
|
102
102
|
const hubLiquidityRaw = hubAsset.liquidity;
|
|
103
|
-
const hubLiquidity = assetAmountInEth(hubLiquidityRaw.toString(), symbol);
|
|
103
|
+
const hubLiquidity = isMaxUint(hubLiquidityRaw.toString()) ? hubLiquidityRaw.toString() : assetAmountInEth(hubLiquidityRaw.toString(), symbol);
|
|
104
104
|
|
|
105
105
|
return ({
|
|
106
106
|
symbol,
|
|
@@ -150,6 +150,8 @@ export async function _getAaveV4SpokeData(provider: Client, network: NetworkNumb
|
|
|
150
150
|
}),
|
|
151
151
|
]);
|
|
152
152
|
|
|
153
|
+
console.log(spokeData);
|
|
154
|
+
|
|
153
155
|
const reserveAssetsArray = await Promise.all(spokeData[1].map(async (reserveAssetOnChain: AaveV4ReserveAssetOnChain, index: number) => formatReserveAsset(reserveAssetOnChain, hubsData[reserveAssetOnChain.hub].assets[reserveAssetOnChain.assetId], index, +spokeData[0].oracleDecimals.toString(), network)));
|
|
154
156
|
|
|
155
157
|
return {
|