diff --git a/.changeset/cold-toys-pump.md b/.changeset/cold-toys-pump.md new file mode 100644 index 0000000..3a9ba79 --- /dev/null +++ b/.changeset/cold-toys-pump.md @@ -0,0 +1,5 @@ +--- +'@protocolink/lending': patch +--- + +adjust reserve tokens, supply tokens, borrow tokens diff --git a/packages/lending/package.json b/packages/lending/package.json index cb1d9dd..2a095d3 100644 --- a/packages/lending/package.json +++ b/packages/lending/package.json @@ -24,10 +24,10 @@ }, "dependencies": { "@aave/math-utils": "^1.21.0", - "@protocolink/api": "^1.1.1", - "@protocolink/common": "^0.3.11", - "@protocolink/core": "^0.4.13", - "@protocolink/logics": "^1.3.0", + "@protocolink/api": "^1.2.0", + "@protocolink/common": "^0.5.1", + "@protocolink/core": "^0.6.1", + "@protocolink/logics": "^1.5.1", "bignumber.js": "^9.1.1", "decimal.js-light": "^2.5.1" }, diff --git a/packages/lending/src/adapter.test.ts b/packages/lending/src/adapter.test.ts index b988fc0..01e3f69 100644 --- a/packages/lending/src/adapter.test.ts +++ b/packages/lending/src/adapter.test.ts @@ -9,17 +9,17 @@ describe('Test Adapter for getPortfolios', function () { { chainId: common.ChainId.mainnet, account: '0xa3C1C91403F0026b9dd086882aDbC8Cdbc3b3cfB', - blockTag: 20187485, + blockTag: 20370000, expected: [ { chainId: 1, protocolId: 'aave-v2', marketId: 'mainnet', - utilization: '0.07628908163929629233', - healthRate: '13.66413410706588734178', - netAPY: '-0.00355912160812771974', - totalSupplyUSD: '35.56482704938061497466', - totalBorrowUSD: '2.23839659526256191454300039', + utilization: '0.07590101508943607601', + healthRate: '13.73399606310834853044', + netAPY: '0.00323285178788026644', + totalSupplyUSD: '35.97966114226230991829956218', + totalBorrowUSD: '2.25298656269910995288750976', supplies: [ { token: { @@ -30,17 +30,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Tether USD', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDT.svg', }, - price: '0.99893032', + price: '1.00026093', balance: '0', - apy: '0.03243833161647158866', + apy: '0.13421247265836591576', lstApy: '0', - grossApy: '0.03243833161647158866', + grossApy: '0.13421247265836591576', usageAsCollateralEnabled: false, ltv: '0', liquidationThreshold: '0', isNotCollateral: false, supplyCap: '0', - totalSupply: '158384425.278896', + totalSupply: '119978376.473339', }, { token: { @@ -51,17 +51,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped BTC', logoUri: 'https://cdn.furucombo.app/assets/img/token/WBTC.svg', }, - price: '61617.97276208', + price: '66220.5014534', balance: '0', - apy: '0.0001741154320598606', + apy: '0.00023080837924252583', lstApy: '0', - grossApy: '0.0001741154320598606', + grossApy: '0.00023080837924252583', usageAsCollateralEnabled: true, ltv: '0.72', liquidationThreshold: '0.82', isNotCollateral: false, supplyCap: '0', - totalSupply: '8119.51167802', + totalSupply: '6514.54850197', }, { token: { @@ -72,17 +72,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Ethereum', logoUri: 'https://cdn.furucombo.app/assets/img/token/ETH.png', }, - price: '3451.49', - balance: '0.010304195303877634', - apy: '0.00303372008833588655', + price: '3490.68309921', + balance: '0.010307341033164858', + apy: '0.00482156549712747051', lstApy: '0', - grossApy: '0.00303372008833588655', + grossApy: '0.00482156549712747051', usageAsCollateralEnabled: true, ltv: '0.825', liquidationThreshold: '0.86', isNotCollateral: false, supplyCap: '0', - totalSupply: '163840.99883634101652263', + totalSupply: '111391.967560809531517199', }, { token: { @@ -93,17 +93,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Dai Stablecoin', logoUri: 'https://cdn.furucombo.app/assets/img/token/DAI.png', }, - price: '0.99980599', + price: '0.99983632', balance: '0', - apy: '0.09058412785169890889', + apy: '0.01816239851920927474', lstApy: '0', - grossApy: '0.09058412785169890889', + grossApy: '0.01816239851920927474', usageAsCollateralEnabled: true, ltv: '0.63', liquidationThreshold: '0.77', isNotCollateral: false, supplyCap: '0', - totalSupply: '59047196.704398397443779977', + totalSupply: '55878799.012395492074165767', }, { token: { @@ -114,17 +114,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'USD Coin', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99976645', + price: '0.99997274', balance: '0', - apy: '0.10477076108689519984', + apy: '0.03212307998374608708', lstApy: '0', - grossApy: '0.10477076108689519984', + grossApy: '0.03212307998374608708', usageAsCollateralEnabled: true, ltv: '0.75', liquidationThreshold: '0.875', isNotCollateral: false, supplyCap: '0', - totalSupply: '192524363.004177', + totalSupply: '161943309.013038', }, { token: { @@ -135,17 +135,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Lido Staked Ether', logoUri: 'https://cdn.furucombo.app/assets/img/token/stETH.svg', }, - price: '3451.49', + price: '3490.68309921', balance: '0', apy: '0', - lstApy: '0.0302', - grossApy: '0.0302', + lstApy: '0.0305', + grossApy: '0.0305', usageAsCollateralEnabled: true, ltv: '0.72', liquidationThreshold: '0.83', isNotCollateral: false, supplyCap: '0', - totalSupply: '173414.274819565272664546', + totalSupply: '215168.873249557126619524', }, ], borrows: [ @@ -158,14 +158,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Tether USD', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDT.svg', }, - price: '0.99893032', + price: '1.00026093', balance: '0', - apy: '0.03243833161647158866', + apy: '0.13421247265836591576', lstApy: '0', - grossApy: '0.03243833161647158866', + grossApy: '0.13421247265836591576', borrowMin: '0', borrowCap: '0', - totalBorrow: '125901945.997197', + totalBorrow: '102792354.042164', }, { token: { @@ -176,14 +176,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped BTC', logoUri: 'https://cdn.furucombo.app/assets/img/token/WBTC.svg', }, - price: '61617.97276208', + price: '66220.5014534', balance: '0', - apy: '0.0001741154320598606', + apy: '0.00023080837924252583', lstApy: '0', - grossApy: '0.0001741154320598606', + grossApy: '0.00023080837924252583', borrowMin: '0', borrowCap: '0', - totalBorrow: '682.85205768', + totalBorrow: '674.3389612', }, { token: { @@ -194,14 +194,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Ethereum', logoUri: 'https://cdn.furucombo.app/assets/img/token/ETH.png', }, - price: '3451.49', + price: '3490.68309921', balance: '0', - apy: '0.00303372008833588655', + apy: '0.00482156549712747051', lstApy: '0', - grossApy: '0.00303372008833588655', + grossApy: '0.00482156549712747051', borrowMin: '0', borrowCap: '0', - totalBorrow: '46801.384808339126062251', + totalBorrow: '45540.367651057351295983', }, { token: { @@ -212,14 +212,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Dai Stablecoin', logoUri: 'https://cdn.furucombo.app/assets/img/token/DAI.png', }, - price: '0.99980599', - balance: '0.564864154964416561', - apy: '0.09058412785169890889', + price: '0.99983632', + balance: '0.567967465020864568', + apy: '0.01816239851920927474', lstApy: '0', - grossApy: '0.09058412785169890889', + grossApy: '0.01816239851920927474', borrowMin: '0', borrowCap: '0', - totalBorrow: '49543877.653519376378038248', + totalBorrow: '35413991.227804948550576643', }, { token: { @@ -230,14 +230,32 @@ describe('Test Adapter for getPortfolios', function () { name: 'USD Coin', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99976645', - balance: '1.674033', - apy: '0.10477076108689519984', + price: '0.99997274', + balance: '1.685158', + apy: '0.03212307998374608708', lstApy: '0', - grossApy: '0.10477076108689519984', + grossApy: '0.03212307998374608708', borrowMin: '0', borrowCap: '0', - totalBorrow: '178226180.770539', + totalBorrow: '144130010.372154', + }, + { + token: { + chainId: 1, + address: '0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84', + decimals: 18, + symbol: 'stETH', + name: 'Lido Staked Ether', + logoUri: 'https://cdn.furucombo.app/assets/img/token/stETH.svg', + }, + price: '3490.68309921', + balance: '0', + apy: '0', + lstApy: '0.0305', + grossApy: '0.0305', + borrowMin: '0', + borrowCap: '0', + totalBorrow: '0', }, ], }, @@ -245,11 +263,11 @@ describe('Test Adapter for getPortfolios', function () { chainId: 1, protocolId: 'aave-v3', marketId: 'mainnet', - utilization: '0.38500216598990927825', - healthRate: '2.68612788824485311483', - netAPY: '0.0133526933239803052', - totalSupplyUSD: '8.2837230909548537868895188', - totalBorrowUSD: '2.394026568514746779258396', + utilization: '0.38288444096157058101', + healthRate: '2.7009682228580998954', + netAPY: '0.04077738270756421439', + totalSupplyUSD: '8.38549123799917271404325883', + totalBorrowUSD: '2.41011292505269580131184497', supplies: [ { token: { @@ -260,17 +278,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Ethereum', logoUri: 'https://cdn.furucombo.app/assets/img/token/ETH.png', }, - price: '3451.49', - balance: '0.000000000596822679', - apy: '0.02498932862838898702', + price: '3490.68309921', + balance: '0.000000000597720332', + apy: '0.01906210712146057623', lstApy: '0', - grossApy: '0.02498932862838898702', + grossApy: '0.01906210712146057623', usageAsCollateralEnabled: true, ltv: '0.805', liquidationThreshold: '0.83', isNotCollateral: false, supplyCap: '1800000', - totalSupply: '863552.065648678029675973', + totalSupply: '982493.12987733487557384', }, { token: { @@ -281,17 +299,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped liquid staked Ether 2.0', logoUri: 'https://cdn.furucombo.app/assets/img/token/wstETH.png', }, - price: '4041.81953479', - balance: '0.00025662580664172', - apy: '0.00005839794861077369', - lstApy: '0.0302', - grossApy: '0.03025839794861077369', + price: '4096.60756363', + balance: '0.000256628677313999', + apy: '0.00012292766600466096', + lstApy: '0.0305', + grossApy: '0.03062292766600466096', usageAsCollateralEnabled: true, ltv: '0.785', liquidationThreshold: '0.81', isNotCollateral: false, supplyCap: '1250000', - totalSupply: '1056256.656461793562757271', + totalSupply: '1037068.143280323913576095', }, { token: { @@ -302,17 +320,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped BTC', logoUri: 'https://cdn.furucombo.app/assets/img/token/WBTC.svg', }, - price: '61766.29750948', + price: '67214.30913055', balance: '0', - apy: '0.00139181220524093089', + apy: '0.0013157213401839349', lstApy: '0', - grossApy: '0.00139181220524093089', + grossApy: '0.0013157213401839349', usageAsCollateralEnabled: true, ltv: '0.73', liquidationThreshold: '0.78', isNotCollateral: false, supplyCap: '43000', - totalSupply: '33000.86815181', + totalSupply: '34740.45790028', }, { token: { @@ -323,17 +341,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'USD Coin', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99976646', - balance: '1.070772', - apy: '0.06806904257166425755', + price: '0.99997275', + balance: '0', + apy: '0.06609106620668933604', lstApy: '0', - grossApy: '0.06806904257166425755', + grossApy: '0.06609106620668933604', usageAsCollateralEnabled: true, ltv: '0.75', liquidationThreshold: '0.78', isNotCollateral: false, - supplyCap: '1760000000', - totalSupply: '1445956183.103999', + supplyCap: '2250000000', + totalSupply: '1550210868.750817', }, { token: { @@ -344,17 +362,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Dai Stablecoin', logoUri: 'https://cdn.furucombo.app/assets/img/token/DAI.png', }, - price: '0.999806', + price: '0.99983633', balance: '0', - apy: '0.06241590450993712276', + apy: '0.0534025975426064874', lstApy: '0', - grossApy: '0.06241590450993712276', + grossApy: '0.0534025975426064874', usageAsCollateralEnabled: true, ltv: '0.63', liquidationThreshold: '0.77', isNotCollateral: false, supplyCap: '338000000', - totalSupply: '131208355.266371721099894467', + totalSupply: '139115851.932486997210226111', }, { token: { @@ -365,17 +383,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Chainlink', logoUri: 'https://cdn.furucombo.app/assets/img/token/LINK.svg', }, - price: '14.46913', + price: '13.91170892', balance: '0', - apy: '0.00000264531922461349', + apy: '0.00002438068343391558', lstApy: '0', - grossApy: '0.00000264531922461349', + grossApy: '0.00002438068343391558', usageAsCollateralEnabled: true, ltv: '0.53', liquidationThreshold: '0.68', isNotCollateral: false, supplyCap: '15000000', - totalSupply: '10794278.33272923641148891', + totalSupply: '11282351.909400711882925425', }, { token: { @@ -386,7 +404,7 @@ describe('Test Adapter for getPortfolios', function () { name: 'Aave Token', logoUri: 'https://cdn.furucombo.app/assets/img/token/AAVE.svg', }, - price: '93.48735579', + price: '96.22135132', balance: '0', apy: '0', lstApy: '0', @@ -396,7 +414,7 @@ describe('Test Adapter for getPortfolios', function () { liquidationThreshold: '0.73', isNotCollateral: false, supplyCap: '1850000', - totalSupply: '1001616.455294738100302262', + totalSupply: '1019289.519765003132648978', }, { token: { @@ -407,17 +425,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Coinbase Wrapped Staked ETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/cbETH.svg', }, - price: '3710.16078124', + price: '3759.38898387', balance: '0', - apy: '0.00175624395680365284', - lstApy: '0.0252', - grossApy: '0.02695624395680365284', + apy: '0.0058679006786796281', + lstApy: '0.026', + grossApy: '0.0318679006786796281', usageAsCollateralEnabled: true, ltv: '0.745', liquidationThreshold: '0.77', isNotCollateral: false, supplyCap: '60000', - totalSupply: '8046.029185105139991721', + totalSupply: '7452.290450336393833618', }, { token: { @@ -428,17 +446,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Tether USD', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDT.svg', }, - price: '0.99893033', - balance: '0', - apy: '0.04925918663467316972', + price: '1.00026094', + balance: '1.075496', + apy: '0.06022358917763675849', lstApy: '0', - grossApy: '0.04925918663467316972', + grossApy: '0.06022358917763675849', usageAsCollateralEnabled: true, ltv: '0.75', liquidationThreshold: '0.78', isNotCollateral: false, - supplyCap: '2000000000', - totalSupply: '1771136107.688263', + supplyCap: '2500000000', + totalSupply: '1688446532.915416', }, { token: { @@ -449,17 +467,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Rocket Pool ETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/rETH.svg', }, - price: '3830.01696', - balance: '0.001612516071131048', - apy: '0.00006751911794613914', - lstApy: '0.0282', - grossApy: '0.02826751911794613914', + price: '3881.07180386', + balance: '0.001612545669695509', + apy: '0.00034368597768278568', + lstApy: '0.0269', + grossApy: '0.02724368597768278568', usageAsCollateralEnabled: true, ltv: '0.745', liquidationThreshold: '0.77', isNotCollateral: false, supplyCap: '90000', - totalSupply: '46204.937079396871929063', + totalSupply: '45313.068705187277067547', }, { token: { @@ -470,17 +488,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'LUSD Stablecoin', logoUri: 'https://cdn.furucombo.app/assets/img/token/LUSD.png', }, - price: '0.99827193', + price: '0.99871939', balance: '0', - apy: '0.04763397755838779855', + apy: '0.03723929335139925503', lstApy: '0', - grossApy: '0.04763397755838779855', + grossApy: '0.03723929335139925503', usageAsCollateralEnabled: true, ltv: '0', liquidationThreshold: '0.77', isNotCollateral: false, supplyCap: '18000000', - totalSupply: '5530423.57139451992340624', + totalSupply: '5960163.417036841245938535', }, { token: { @@ -491,17 +509,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Curve DAO Token', logoUri: 'https://cdn.furucombo.app/assets/img/token/CRV.png', }, - price: '0.291864', + price: '0.2798289', balance: '0', - apy: '0.00592307142335363847', + apy: '0.01563853457706822354', lstApy: '0', - grossApy: '0.00592307142335363847', + grossApy: '0.01563853457706822354', usageAsCollateralEnabled: false, ltv: '0.35', liquidationThreshold: '0.41', isNotCollateral: false, supplyCap: '10000000', - totalSupply: '8397774.553814940272599022', + totalSupply: '9876040.51850490611409757', }, { token: { @@ -512,17 +530,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Maker', logoUri: 'https://cdn.furucombo.app/assets/img/token/MKR.png', }, - price: '2574.96591723', + price: '2773.924', balance: '0', - apy: '0.00001332763416078028', + apy: '0.00026073771056648787', lstApy: '0', - grossApy: '0.00001332763416078028', + grossApy: '0.00026073771056648787', usageAsCollateralEnabled: false, ltv: '0.65', liquidationThreshold: '0.7', isNotCollateral: false, supplyCap: '22500', - totalSupply: '12855.946462549110963243', + totalSupply: '12932.308630650211881738', }, { token: { @@ -533,17 +551,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Synthetix Network Token', logoUri: 'https://cdn.furucombo.app/assets/img/token/SNX.png', }, - price: '2.0307072', + price: '1.81416498', balance: '0', - apy: '0.00078494877135036951', + apy: '0.00227258392764308365', lstApy: '0', - grossApy: '0.00078494877135036951', + grossApy: '0.00227258392764308365', usageAsCollateralEnabled: false, ltv: '0.49', liquidationThreshold: '0.65', isNotCollateral: false, supplyCap: '4500000', - totalSupply: '1286407.805189659506457636', + totalSupply: '903396.77979686893359419', }, { token: { @@ -554,17 +572,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Balancer', logoUri: 'https://cdn.furucombo.app/assets/img/token/BAL.png', }, - price: '3.03445305', + price: '2.6052', balance: '0', - apy: '0.0074395488842611835', + apy: '0.01043780969192853314', lstApy: '0', - grossApy: '0.0074395488842611835', + grossApy: '0.01043780969192853314', usageAsCollateralEnabled: false, ltv: '0.57', liquidationThreshold: '0.59', isNotCollateral: false, - supplyCap: '2100000', - totalSupply: '2100355.1426777711869772', + supplyCap: '3800000', + totalSupply: '2096655.185780590575896395', }, { token: { @@ -575,17 +593,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Uniswap Token', logoUri: 'https://cdn.furucombo.app/assets/img/token/UNI.png', }, - price: '9.58169672', + price: '7.86856', balance: '0', - apy: '0.00027116222791967147', + apy: '0.00018615426764768409', lstApy: '0', - grossApy: '0.00027116222791967147', + grossApy: '0.00018615426764768409', usageAsCollateralEnabled: false, ltv: '0.65', liquidationThreshold: '0.74', isNotCollateral: false, supplyCap: '4000000', - totalSupply: '883308.914381929405032734', + totalSupply: '1097932.313715470558907167', }, { token: { @@ -596,17 +614,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Lido DAO Token', logoUri: 'https://cdn.furucombo.app/assets/img/token/LDO.png', }, - price: '2.34701495', + price: '1.84884647', balance: '0', - apy: '0.00002149906715192463', + apy: '0.00001175488439490757', lstApy: '0', - grossApy: '0.00002149906715192463', + grossApy: '0.00001175488439490757', usageAsCollateralEnabled: false, ltv: '0.4', liquidationThreshold: '0.5', isNotCollateral: false, supplyCap: '8000000', - totalSupply: '5919887.441235115866856065', + totalSupply: '5860831.31742298689861764', }, { token: { @@ -617,17 +635,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Ethereum Name Service', logoUri: 'https://cdn.furucombo.app/assets/img/token/ENS.png', }, - price: '27.07071531', + price: '29.69080967', balance: '0', - apy: '0.00017504844015420633', + apy: '0.00017095064248234046', lstApy: '0', - grossApy: '0.00017504844015420633', + grossApy: '0.00017095064248234046', usageAsCollateralEnabled: false, ltv: '0.39', liquidationThreshold: '0.49', isNotCollateral: false, supplyCap: '1500000', - totalSupply: '234836.197420268898350519', + totalSupply: '226077.140170577528271678', }, { token: { @@ -638,17 +656,17 @@ describe('Test Adapter for getPortfolios', function () { name: '1INCH Token', logoUri: 'https://cdn.furucombo.app/assets/img/token/1INCH.svg', }, - price: '0.40300563', + price: '0.41559233', balance: '0', - apy: '0.00123796709091215768', + apy: '0.00178082503469686678', lstApy: '0', - grossApy: '0.00123796709091215768', + grossApy: '0.00178082503469686678', usageAsCollateralEnabled: false, ltv: '0.57', liquidationThreshold: '0.67', isNotCollateral: false, supplyCap: '30000000', - totalSupply: '2930193.747354411318058337', + totalSupply: '2932647.30258281157075725', }, { token: { @@ -659,17 +677,38 @@ describe('Test Adapter for getPortfolios', function () { name: 'Frax', logoUri: 'https://cdn.furucombo.app/assets/img/token/FRAX.png', }, - price: '0.99731092', + price: '0.99746328', balance: '0', - apy: '0.03693050160523759623', + apy: '0.0624523483966045978', lstApy: '0', - grossApy: '0.03693050160523759623', + grossApy: '0.0624523483966045978', usageAsCollateralEnabled: false, ltv: '0', liquidationThreshold: '0.72', isNotCollateral: false, supplyCap: '15000000', - totalSupply: '1210191.400928506364950097', + totalSupply: '824591.571841355614088529', + }, + { + token: { + chainId: 1, + address: '0x40D16FC0246aD3160Ccc09B8D0D3A2cD28aE6C2f', + decimals: 18, + symbol: 'GHO', + name: 'Gho Token', + logoUri: 'https://cdn.furucombo.app/assets/img/token/GHO.svg', + }, + price: '1', + balance: '0', + apy: '0', + lstApy: '0', + grossApy: '0', + usageAsCollateralEnabled: false, + ltv: '0', + liquidationThreshold: '0', + isNotCollateral: false, + supplyCap: '0', + totalSupply: '0', }, { token: { @@ -680,17 +719,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Rocket Pool', logoUri: 'https://cdn.furucombo.app/assets/img/token/RPL.png', }, - price: '20.69394329', + price: '18.15516745', balance: '0', - apy: '0.02725963458583589761', + apy: '0.03010601828123231458', lstApy: '0', - grossApy: '0.02725963458583589761', + grossApy: '0.03010601828123231458', usageAsCollateralEnabled: false, ltv: '0', liquidationThreshold: '0', isNotCollateral: false, supplyCap: '840000', - totalSupply: '513392.481796538419650095', + totalSupply: '522882.18179883180754061', }, { token: { @@ -701,17 +740,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Savings Dai', logoUri: 'https://cdn.furucombo.app/assets/img/token/sDAI.svg', }, - price: '1.09217133', + price: '1.09789311', balance: '0', apy: '0', - lstApy: '0.077', - grossApy: '0.077', + lstApy: '0.0677', + grossApy: '0.0677', usageAsCollateralEnabled: true, ltv: '0.75', liquidationThreshold: '0.78', isNotCollateral: false, supplyCap: '340000000', - totalSupply: '58614733.02581636496346381', + totalSupply: '60105445.305948649296971976', }, { token: { @@ -722,17 +761,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Curve.Fi USD Stablecoin', logoUri: 'https://cdn.furucombo.app/assets/img/token/crvUSD.svg', }, - price: '0.99589062', + price: '0.99655141', balance: '0', - apy: '0.03099790061851792919', + apy: '0.04470465342936634063', lstApy: '0', - grossApy: '0.03099790061851792919', + grossApy: '0.04470465342936634063', usageAsCollateralEnabled: false, ltv: '0', liquidationThreshold: '0', isNotCollateral: false, supplyCap: '60000000', - totalSupply: '979206.509218990337655242', + totalSupply: '776865.096495556163058504', }, { token: { @@ -743,17 +782,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'PayPal USD', logoUri: 'https://cdn.furucombo.app/assets/img/token/PYUSD.webp', }, - price: '0.9986693', + price: '0.99984422', balance: '0', - apy: '0.05359980001765430812', + apy: '0.05427721039087836968', lstApy: '0', - grossApy: '0.05359980001765430812', + grossApy: '0.05427721039087836968', usageAsCollateralEnabled: false, ltv: '0', liquidationThreshold: '0', isNotCollateral: false, supplyCap: '60000000', - totalSupply: '28815976.844872', + totalSupply: '20701054.551565', }, { token: { @@ -764,17 +803,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped eETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/weETH.webp', }, - price: '3595.25941308', + price: '3643.00043268', balance: '0', - apy: '0.00458800598652878456', + apy: '0.00214673298476831582', lstApy: '0', - grossApy: '0.00458800598652878456', + grossApy: '0.00214673298476831582', usageAsCollateralEnabled: true, ltv: '0.725', liquidationThreshold: '0.75', isNotCollateral: false, - supplyCap: '550000', - totalSupply: '550015.259159458450820298', + supplyCap: '660000', + totalSupply: '659997.456961871969281934', }, { token: { @@ -785,17 +824,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Staked ETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/osETH.webp', }, - price: '3520.49612167', + price: '3567.78971028', balance: '0', - apy: '0.00015521792550850201', + apy: '0.00139902988860636002', lstApy: '0', - grossApy: '0.00015521792550850201', + grossApy: '0.00139902988860636002', usageAsCollateralEnabled: true, ltv: '0.725', liquidationThreshold: '0.75', isNotCollateral: false, supplyCap: '10000', - totalSupply: '1598.433685132118243286', + totalSupply: '1698.472580900130370805', }, { token: { @@ -806,17 +845,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'USDe', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDe.webp', }, - price: '0.99949999', + price: '1.00023601', balance: '0', - apy: '0.04308092740975599814', + apy: '0.05508996283595329893', lstApy: '0', - grossApy: '0.04308092740975599814', + grossApy: '0.05508996283595329893', usageAsCollateralEnabled: false, ltv: '0.72', liquidationThreshold: '0.75', isNotCollateral: false, supplyCap: '80000000', - totalSupply: '58772971.676509812885761573', + totalSupply: '63626019.853475905734669523', }, { token: { @@ -827,17 +866,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Stader ETHx', logoUri: 'https://tokens.1inch.io/0xa35b1b31ce002fbf2058d22f30f95d405200a15b.png', }, - price: '3566.82831897', + price: '3614.38648037', balance: '0', - apy: '0', + apy: '0.00032697839181294113', lstApy: '0', - grossApy: '0', + grossApy: '0.00032697839181294113', usageAsCollateralEnabled: true, ltv: '0.745', liquidationThreshold: '0.77', isNotCollateral: false, supplyCap: '3200', - totalSupply: '700.053670150592831448', + totalSupply: '2459.311539388778371332', }, { token: { @@ -848,7 +887,7 @@ describe('Test Adapter for getPortfolios', function () { name: 'Staked USDe', logoUri: 'https://tokens.1inch.io/0x9d39a5de30e57443bff2a8307a4256c8797a3497.png', }, - price: '1.08301437', + price: '1.09095012', balance: '0', apy: '0', lstApy: '0', @@ -858,7 +897,7 @@ describe('Test Adapter for getPortfolios', function () { liquidationThreshold: '0.75', isNotCollateral: false, supplyCap: '85000000', - totalSupply: '3869921.336988603566776291', + totalSupply: '1158209.57801896693485983', }, ], borrows: [ @@ -871,14 +910,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Ethereum', logoUri: 'https://cdn.furucombo.app/assets/img/token/ETH.png', }, - price: '3451.49', - balance: '0.000103642970541831', - apy: '0.03276621465713345077', + price: '3490.68309921', + balance: '0.000103849876427269', + apy: '0.02615176993523087836', lstApy: '0', - grossApy: '0.03276621465713345077', + grossApy: '0.02615176993523087836', borrowMin: '0', borrowCap: '1400000', - totalBorrow: '777769.959255229293396444', + totalBorrow: '845471.121118875220746221', }, { token: { @@ -889,14 +928,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped liquid staked Ether 2.0', logoUri: 'https://cdn.furucombo.app/assets/img/token/wstETH.png', }, - price: '4041.81953479', + price: '4096.60756363', balance: '0', - apy: '0.0041625413173683652', - lstApy: '0.0302', - grossApy: '-0.0260374586826316348', + apy: '0.00526678108038658357', + lstApy: '0.0305', + grossApy: '-0.02523321891961341643', borrowMin: '0', - borrowCap: '24000', - totalBorrow: '17469.458192212269563234', + borrowCap: '48000', + totalBorrow: '28550.086174317579769182', }, { token: { @@ -907,14 +946,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped BTC', logoUri: 'https://cdn.furucombo.app/assets/img/token/WBTC.svg', }, - price: '61766.29750948', + price: '67214.30913055', balance: '0', - apy: '0.01250893302447089922', + apy: '0.0121603263113706355', lstApy: '0', - grossApy: '0.01250893302447089922', + grossApy: '0.0121603263113706355', borrowMin: '0', borrowCap: '28000', - totalBorrow: '4615.26376158', + totalBorrow: '4723.96692362', }, { token: { @@ -925,14 +964,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'USD Coin', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99976646', - balance: '1.499116', - apy: '0.0882862201979946724', + price: '0.99997275', + balance: '0', + apy: '0.08698189392544052744', lstApy: '0', - grossApy: '0.0882862201979946724', + grossApy: '0.08698189392544052744', borrowMin: '0', - borrowCap: '1580000000', - totalBorrow: '1250549534.998333', + borrowCap: '2100000000', + totalBorrow: '1321740029.142569', }, { token: { @@ -943,14 +982,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Dai Stablecoin', logoUri: 'https://cdn.furucombo.app/assets/img/token/DAI.png', }, - price: '0.999806', - balance: '0.272295293676520266', - apy: '0.09293461914222748949', + price: '0.99983633', + balance: '0.273960749397597666', + apy: '0.08586486555610735681', lstApy: '0', - grossApy: '0.09293461914222748949', + grossApy: '0.08586486555610735681', borrowMin: '0', borrowCap: '271000000', - totalBorrow: '119196469.407416851662864314', + totalBorrow: '117156672.375190590966771372', }, { token: { @@ -961,14 +1000,32 @@ describe('Test Adapter for getPortfolios', function () { name: 'Chainlink', logoUri: 'https://cdn.furucombo.app/assets/img/token/LINK.svg', }, - price: '14.46913', + price: '13.91170892', balance: '0', - apy: '0.00071745104490227539', + apy: '0.00217967097227906922', lstApy: '0', - grossApy: '0.00071745104490227539', + grossApy: '0.00217967097227906922', borrowMin: '0', borrowCap: '13000000', - totalBorrow: '49767.36514500740420718', + totalBorrow: '157918.243637725185997365', + }, + { + token: { + chainId: 1, + address: '0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9', + decimals: 18, + symbol: 'AAVE', + name: 'Aave Token', + logoUri: 'https://cdn.furucombo.app/assets/img/token/AAVE.svg', + }, + price: '96.22135132', + balance: '0', + apy: '0', + lstApy: '0', + grossApy: '0', + borrowMin: '0', + borrowCap: '0', + totalBorrow: '0', }, { token: { @@ -979,14 +1036,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Coinbase Wrapped Staked ETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/cbETH.svg', }, - price: '3710.16078124', + price: '3759.38898387', balance: '0', - apy: '0.01808140788884236057', - lstApy: '0.0252', - grossApy: '-0.00711859211115763943', + apy: '0.03326319684287204968', + lstApy: '0.026', + grossApy: '0.00726319684287204968', borrowMin: '0', borrowCap: '2400', - totalBorrow: '926.914982035434725693', + totalBorrow: '1567.659791907274782482', }, { token: { @@ -997,14 +1054,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Tether USD', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDT.svg', }, - price: '0.99893033', + price: '1.00026094', balance: '0', - apy: '0.07497238338249427281', + apy: '0.08299210101994077768', lstApy: '0', - grossApy: '0.07497238338249427281', + grossApy: '0.08299210101994077768', borrowMin: '0', - borrowCap: '1900000000', - totalBorrow: '1308913625.804273', + borrowCap: '2250000000', + totalBorrow: '1376121810.389116', }, { token: { @@ -1015,14 +1072,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Rocket Pool ETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/rETH.svg', }, - price: '3830.01696', - balance: '0', - apy: '0.00352129873338082018', - lstApy: '0.0282', - grossApy: '-0.02467870126661917982', + price: '3881.07180386', + balance: '0.000388221450977845', + apy: '0.00796159400456774621', + lstApy: '0.0269', + grossApy: '-0.01893840599543225379', borrowMin: '0', borrowCap: '19200', - totalBorrow: '1044.10218761046063956', + totalBorrow: '2310.024637953106501718', }, { token: { @@ -1033,14 +1090,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'LUSD Stablecoin', logoUri: 'https://cdn.furucombo.app/assets/img/token/LUSD.png', }, - price: '0.99827193', + price: '0.99871939', balance: '0', - apy: '0.08425624099100210242', + apy: '0.07433849298624684733', lstApy: '0', - grossApy: '0.08425624099100210242', + grossApy: '0.07433849298624684733', borrowMin: '0', borrowCap: '8000000', - totalBorrow: '3976805.647029094500041468', + totalBorrow: '3799086.295282689532115726', }, { token: { @@ -1051,14 +1108,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Curve DAO Token', logoUri: 'https://cdn.furucombo.app/assets/img/token/CRV.png', }, - price: '0.291864', + price: '0.2798289', balance: '0', - apy: '0.06203797715105698619', + apy: '0.08948813624233006629', lstApy: '0', - grossApy: '0.06203797715105698619', + grossApy: '0.08948813624233006629', borrowMin: '0', borrowCap: '2750000', - totalBorrow: '1267703.300957292054404776', + totalBorrow: '2751037.273388135365905402', }, { token: { @@ -1069,14 +1126,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Maker', logoUri: 'https://cdn.furucombo.app/assets/img/token/MKR.png', }, - price: '2574.96591723', + price: '2773.924', balance: '0', - apy: '0.00161109988019218933', + apy: '0.00714526536259445092', lstApy: '0', - grossApy: '0.00161109988019218933', + grossApy: '0.00714526536259445092', borrowMin: '0', borrowCap: '1980', - totalBorrow: '133.042846551952038565', + totalBorrow: '591.923053153404624917', }, { token: { @@ -1087,14 +1144,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Synthetix Network Token', logoUri: 'https://cdn.furucombo.app/assets/img/token/SNX.png', }, - price: '2.0307072', + price: '1.81416498', balance: '0', - apy: '0.03690958213019414813', + apy: '0.04567392222630226278', lstApy: '0', - grossApy: '0.03690958213019414813', + grossApy: '0.04567392222630226278', borrowMin: '0', borrowCap: '150000', - totalBorrow: '42862.74849244665967621', + totalBorrow: '70648.638420368098129179', }, { token: { @@ -1105,14 +1162,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Balancer', logoUri: 'https://cdn.furucombo.app/assets/img/token/BAL.png', }, - price: '3.03445305', + price: '2.6052', balance: '0', - apy: '0.08472697043026794235', + apy: '0.09391630223979880191', lstApy: '0', - grossApy: '0.08472697043026794235', + grossApy: '0.09391630223979880191', borrowMin: '0', - borrowCap: '250000', - totalBorrow: '239279.542994513357571836', + borrowCap: '500000', + totalBorrow: '303179.698571318459272783', }, { token: { @@ -1123,14 +1180,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Uniswap Token', logoUri: 'https://cdn.furucombo.app/assets/img/token/UNI.png', }, - price: '9.58169672', + price: '7.86856', balance: '0', - apy: '0.00728719749268102532', + apy: '0.00603421930171601774', lstApy: '0', - grossApy: '0.00728719749268102532', + grossApy: '0.00603421930171601774', borrowMin: '0', borrowCap: '330000', - totalBorrow: '41229.747621420003131954', + totalBorrow: '42462.612659653833963623', }, { token: { @@ -1141,14 +1198,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Lido DAO Token', logoUri: 'https://cdn.furucombo.app/assets/img/token/LDO.png', }, - price: '2.34701495', + price: '1.84884647', balance: '0', - apy: '0.0020466769345435445', + apy: '0.00151298285844823709', lstApy: '0', - grossApy: '0.0020466769345435445', + grossApy: '0.00151298285844823709', borrowMin: '0', borrowCap: '1500000', - totalBorrow: '77809.858982415912427416', + totalBorrow: '56961.541286438153308695', }, { token: { @@ -1159,14 +1216,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Ethereum Name Service', logoUri: 'https://cdn.furucombo.app/assets/img/token/ENS.png', }, - price: '27.07071531', + price: '29.69080967', balance: '0', - apy: '0.00663693163828208788', + apy: '0.00655853900288879279', lstApy: '0', - grossApy: '0.00663693163828208788', + grossApy: '0.00655853900288879279', borrowMin: '0', borrowCap: '40000', - totalBorrow: '7767.226510769338802174', + totalBorrow: '7389.507076088637720299', }, { token: { @@ -1177,14 +1234,14 @@ describe('Test Adapter for getPortfolios', function () { name: '1INCH Token', logoUri: 'https://cdn.furucombo.app/assets/img/token/1INCH.svg', }, - price: '0.40300563', + price: '0.41559233', balance: '0', - apy: '0.0177424979916027472', + apy: '0.02131450355578610075', lstApy: '0', - grossApy: '0.0177424979916027472', + grossApy: '0.02131450355578610075', borrowMin: '0', borrowCap: '475200', - totalBorrow: '257675.039037231281530664', + totalBorrow: '309259.222707666077441514', }, { token: { @@ -1195,14 +1252,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Frax', logoUri: 'https://cdn.furucombo.app/assets/img/token/FRAX.png', }, - price: '0.99731092', + price: '0.99746328', balance: '0', - apy: '0.06964669314085828494', + apy: '0.09091844218786712003', lstApy: '0', - grossApy: '0.06964669314085828494', + grossApy: '0.09091844218786712003', borrowMin: '0', borrowCap: '12000000', - totalBorrow: '814846.583934133370241282', + totalBorrow: '717642.384776104119618026', }, { token: { @@ -1214,13 +1271,13 @@ describe('Test Adapter for getPortfolios', function () { logoUri: 'https://cdn.furucombo.app/assets/img/token/GHO.svg', }, price: '1', - balance: '0.26529552728041548', - apy: '0.11627807024471977228', + balance: '0.26697467926750571', + apy: '0.07250818117089440143', lstApy: '0', - grossApy: '0.11627807024471977228', + grossApy: '0.07250818117089440143', borrowMin: '0', - borrowCap: '90000000', - totalBorrow: '84755678.215635032511607189', + borrowCap: '105000000', + totalBorrow: '102852318.635937418572158922', }, { token: { @@ -1231,14 +1288,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Rocket Pool', logoUri: 'https://cdn.furucombo.app/assets/img/token/RPL.png', }, - price: '20.69394329', + price: '18.15516745', balance: '0', - apy: '0.06158791590334846622', + apy: '0.06477661216582400633', lstApy: '0', - grossApy: '0.06158791590334846622', + grossApy: '0.06477661216582400633', borrowMin: '0', borrowCap: '500000', - totalBorrow: '288792.895450960850808958', + totalBorrow: '308909.335071416283658924', }, { token: { @@ -1249,11 +1306,11 @@ describe('Test Adapter for getPortfolios', function () { name: 'Savings Dai', logoUri: 'https://cdn.furucombo.app/assets/img/token/sDAI.svg', }, - price: '1.09217133', + price: '1.09789311', balance: '0', apy: '0', - lstApy: '0.077', - grossApy: '0.077', + lstApy: '0.0677', + grossApy: '0.0677', borrowMin: '0', borrowCap: '0', totalBorrow: '0', @@ -1267,14 +1324,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Curve.Fi USD Stablecoin', logoUri: 'https://cdn.furucombo.app/assets/img/token/crvUSD.svg', }, - price: '0.99589062', + price: '0.99655141', balance: '0', - apy: '0.06372078864796788292', + apy: '0.07673967633058358171', lstApy: '0', - grossApy: '0.06372078864796788292', + grossApy: '0.07673967633058358171', borrowMin: '0', borrowCap: '50000000', - totalBorrow: '537694.286009213895443075', + totalBorrow: '510599.614598877194415612', }, { token: { @@ -1285,14 +1342,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'PayPal USD', logoUri: 'https://cdn.furucombo.app/assets/img/token/PYUSD.webp', }, - price: '0.9986693', + price: '0.99984422', balance: '0', - apy: '0.08946620282306718846', + apy: '0.09003919326805871719', lstApy: '0', - grossApy: '0.08946620282306718846', + grossApy: '0.09003919326805871719', borrowMin: '0', borrowCap: '48000000', - totalBorrow: '21949183.921543', + totalBorrow: '15866472.177594', }, { token: { @@ -1303,14 +1360,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped eETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/weETH.webp', }, - price: '3595.25941308', + price: '3643.00043268', balance: '0', - apy: '0.04164261015241976729', + apy: '0.02831833384757563295', lstApy: '0', - grossApy: '0.04164261015241976729', + grossApy: '0.02831833384757563295', borrowMin: '0', - borrowCap: '150000', - totalBorrow: '112201.836723110731111438', + borrowCap: '200000', + totalBorrow: '92152.176373840373286617', }, { token: { @@ -1321,14 +1378,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Staked ETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/osETH.webp', }, - price: '3520.49612167', + price: '3567.78971028', balance: '0', - apy: '0.00534373839342765668', + apy: '0.01612400681759389008', lstApy: '0', - grossApy: '0.00534373839342765668', + grossApy: '0.01612400681759389008', borrowMin: '0', borrowCap: '1000', - totalBorrow: '54.764319219119017386', + totalBorrow: '174.660361388940398652', }, { token: { @@ -1339,14 +1396,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'USDe', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDe.webp', }, - price: '0.99949999', + price: '1.00023601', balance: '0', - apy: '0.08279025186696895518', + apy: '0.09383275979898097888', lstApy: '0', - grossApy: '0.08279025186696895518', + grossApy: '0.09383275979898097888', borrowMin: '0', borrowCap: '72000000', - totalBorrow: '41576801.790285414103389622', + totalBorrow: '50729615.007422810246222715', }, { token: { @@ -1357,14 +1414,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Stader ETHx', logoUri: 'https://tokens.1inch.io/0xa35b1b31ce002fbf2058d22f30f95d405200a15b.png', }, - price: '3566.82831897', + price: '3614.38648037', balance: '0', - apy: '0', + apy: '0.00776493877173731347', lstApy: '0', - grossApy: '0', + grossApy: '0.00776493877173731347', borrowMin: '0', borrowCap: '320', - totalBorrow: '0', + totalBorrow: '122.294154447856766526', }, { token: { @@ -1375,7 +1432,7 @@ describe('Test Adapter for getPortfolios', function () { name: 'Staked USDe', logoUri: 'https://tokens.1inch.io/0x9d39a5de30e57443bff2a8307a4256c8797a3497.png', }, - price: '1.08301437', + price: '1.09095012', balance: '0', apy: '0', lstApy: '0', @@ -1392,8 +1449,8 @@ describe('Test Adapter for getPortfolios', function () { marketId: 'USDC', utilization: '0', healthRate: 'Infinity', - netAPY: '0.00000013273112082045', - totalSupplyUSD: '17.2574849918261', + netAPY: '0.00000010616802617383', + totalSupplyUSD: '17.453451495069', totalBorrowUSD: '0', supplies: [ { @@ -1405,17 +1462,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'USD Coin', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99976646', - balance: '0.000035', - apy: '0.065461154241024', + price: '0.99997275', + balance: '0.000036', + apy: '0.051473583076032', lstApy: '0', - grossApy: '0.065461154241024', + grossApy: '0.051473583076032', usageAsCollateralEnabled: false, ltv: '0', liquidationThreshold: '0', isNotCollateral: true, supplyCap: '0', - totalSupply: '564579072.910616', + totalSupply: '534658174.042129', }, { token: { @@ -1425,7 +1482,7 @@ describe('Test Adapter for getPortfolios', function () { symbol: 'COMP', name: 'Compound', }, - price: '50.381', + price: '50.8495', balance: '0', apy: '0', lstApy: '0', @@ -1435,7 +1492,7 @@ describe('Test Adapter for getPortfolios', function () { liquidationThreshold: '0.7', isNotCollateral: false, supplyCap: '900000', - totalSupply: '789870.471221492662914038', + totalSupply: '781164.075915036762053395', }, { token: { @@ -1445,7 +1502,7 @@ describe('Test Adapter for getPortfolios', function () { symbol: 'WBTC', name: 'Wrapped BTC', }, - price: '61644.88421134', + price: '67220.81139964', balance: '0', apy: '0', lstApy: '0', @@ -1455,7 +1512,7 @@ describe('Test Adapter for getPortfolios', function () { liquidationThreshold: '0.85', isNotCollateral: false, supplyCap: '18000', - totalSupply: '7698.97384052', + totalSupply: '8180.03887267', }, { token: { @@ -1466,7 +1523,7 @@ describe('Test Adapter for getPortfolios', function () { name: 'Ethereum', logoUri: 'https://cdn.furucombo.app/assets/img/token/ETH.png', }, - price: '3451.49', + price: '3490.68309921', balance: '0.005', apy: '0', lstApy: '0', @@ -1476,7 +1533,7 @@ describe('Test Adapter for getPortfolios', function () { liquidationThreshold: '0.895', isNotCollateral: false, supplyCap: '500000', - totalSupply: '143187.007366145873314187', + totalSupply: '70457.450457884734703265', }, { token: { @@ -1486,7 +1543,7 @@ describe('Test Adapter for getPortfolios', function () { symbol: 'UNI', name: 'Uniswap', }, - price: '9.58169672', + price: '7.86856', balance: '0', apy: '0', lstApy: '0', @@ -1496,7 +1553,7 @@ describe('Test Adapter for getPortfolios', function () { liquidationThreshold: '0.79', isNotCollateral: false, supplyCap: '2600000', - totalSupply: '815061.170981228450178625', + totalSupply: '774471.460639364238474232', }, { token: { @@ -1506,7 +1563,7 @@ describe('Test Adapter for getPortfolios', function () { symbol: 'LINK', name: 'ChainLink Token', }, - price: '14.46913', + price: '13.91170892', balance: '0', apy: '0', lstApy: '0', @@ -1516,7 +1573,7 @@ describe('Test Adapter for getPortfolios', function () { liquidationThreshold: '0.85', isNotCollateral: false, supplyCap: '4000000', - totalSupply: '1336410.082658060651838637', + totalSupply: '1404775.704049557713194093', }, ], borrows: [ @@ -1529,14 +1586,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'USD Coin', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99976646', + price: '0.99997275', balance: '0', - apy: '0.087705521985888', + apy: '0.072169992921168', lstApy: '0', - grossApy: '0.087705521985888', + grossApy: '0.072169992921168', borrowMin: '100', borrowCap: '0', - totalBorrow: '492773387.331912', + totalBorrow: '366943698.278543', }, ], }, @@ -1546,8 +1603,8 @@ describe('Test Adapter for getPortfolios', function () { marketId: 'ETH', utilization: '0', healthRate: 'Infinity', - netAPY: '0.014624608141152', - totalSupplyUSD: '0.00000670267228428693', + netAPY: '0.014771569874688', + totalSupplyUSD: '0.00000678588847893875417913', totalBorrowUSD: '0', supplies: [ { @@ -1559,17 +1616,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Ethereum', logoUri: 'https://cdn.furucombo.app/assets/img/token/ETH.png', }, - price: '3451.49', - balance: '0.000000001941964857', - apy: '0.014624608141152', + price: '3490.68309921', + balance: '0.000000001944000153', + apy: '0.014771569874688', lstApy: '0', - grossApy: '0.014624608141152', + grossApy: '0.014771569874688', usageAsCollateralEnabled: false, ltv: '0', liquidationThreshold: '0', isNotCollateral: true, supplyCap: '0', - totalSupply: '44374.71787171528352709', + totalSupply: '53902.111348736324418839', }, { token: { @@ -1579,17 +1636,17 @@ describe('Test Adapter for getPortfolios', function () { symbol: 'cbETH', name: 'Coinbase Wrapped Staked ETH', }, - price: '3708.12702309', + price: '3758.90718855', balance: '0', apy: '0', - lstApy: '0.0252', - grossApy: '0.0252', + lstApy: '0.026', + grossApy: '0.026', usageAsCollateralEnabled: true, ltv: '0.9', liquidationThreshold: '0.93', isNotCollateral: false, supplyCap: '40000', - totalSupply: '58.171108836112185741', + totalSupply: '59.171108845573608264', }, { token: { @@ -1599,17 +1656,17 @@ describe('Test Adapter for getPortfolios', function () { symbol: 'wstETH', name: 'Wrapped liquid staked Ether 2.0', }, - price: '4041.04280353', + price: '4096.15576624', balance: '0', apy: '0', - lstApy: '0.0302', - grossApy: '0.0302', + lstApy: '0.0305', + grossApy: '0.0305', usageAsCollateralEnabled: true, ltv: '0.9', liquidationThreshold: '0.93', isNotCollateral: false, supplyCap: '64500', - totalSupply: '31824.253569353777744446', + totalSupply: '31746.607939444614708529', }, { token: { @@ -1619,17 +1676,117 @@ describe('Test Adapter for getPortfolios', function () { symbol: 'rETH', name: 'Rocket Pool ETH', }, - price: '3832.40696344', + price: '3907.61374435', balance: '0', apy: '0', - lstApy: '0.0282', - grossApy: '0.0282', + lstApy: '0.0269', + grossApy: '0.0269', usageAsCollateralEnabled: true, ltv: '0.9', liquidationThreshold: '0.93', isNotCollateral: false, supplyCap: '30000', - totalSupply: '4352.213702315903300624', + totalSupply: '4324.198909194623792438', + }, + { + token: { + chainId: 1, + address: '0xA1290d69c65A6Fe4DF752f95823fae25cB99e5A7', + decimals: 18, + symbol: 'rsETH', + name: 'rsETH', + }, + price: '3557.13299933', + balance: '0', + apy: '0', + lstApy: '0', + grossApy: '0', + usageAsCollateralEnabled: true, + ltv: '0.8', + liquidationThreshold: '0.85', + isNotCollateral: false, + supplyCap: '5000', + totalSupply: '1267.988120395388958242', + }, + { + token: { + chainId: 1, + address: '0xCd5fE23C85820F7B72D0926FC9b05b43E359b7ee', + decimals: 18, + symbol: 'weETH', + name: 'Wrapped eETH', + }, + price: '3643.00041761', + balance: '0', + apy: '0', + lstApy: '0', + grossApy: '0', + usageAsCollateralEnabled: true, + ltv: '0.82', + liquidationThreshold: '0.87', + isNotCollateral: false, + supplyCap: '22500', + totalSupply: '4592.74925869395667636', + }, + { + token: { + chainId: 1, + address: '0xf1C9acDc66974dFB6dEcB12aA385b9cD01190E38', + decimals: 18, + symbol: 'osETH', + name: 'Staked ETH', + }, + price: '3567.78970576', + balance: '0', + apy: '0', + lstApy: '0', + grossApy: '0', + usageAsCollateralEnabled: true, + ltv: '0.8', + liquidationThreshold: '0.85', + isNotCollateral: false, + supplyCap: '10000', + totalSupply: '0.000000007341711957', + }, + { + token: { + chainId: 1, + address: '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599', + decimals: 8, + symbol: 'WBTC', + name: 'Wrapped BTC', + }, + price: '66220.50143515', + balance: '0', + apy: '0', + lstApy: '0', + grossApy: '0', + usageAsCollateralEnabled: true, + ltv: '0.8', + liquidationThreshold: '0.85', + isNotCollateral: false, + supplyCap: '1000', + totalSupply: '100.87762129', + }, + { + token: { + chainId: 1, + address: '0xbf5495Efe5DB9ce00f80364C8B423567e58d2110', + decimals: 18, + symbol: 'ezETH', + name: 'Renzo Restaked ETH', + }, + price: '3543.63389946', + balance: '0', + apy: '0', + lstApy: '0', + grossApy: '0', + usageAsCollateralEnabled: true, + ltv: '0.8', + liquidationThreshold: '0.85', + isNotCollateral: false, + supplyCap: '2900', + totalSupply: '2622.052923594735563418', }, ], borrows: [ @@ -1642,14 +1799,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Ethereum', logoUri: 'https://cdn.furucombo.app/assets/img/token/ETH.png', }, - price: '3451.49', + price: '3490.68309921', balance: '0', - apy: '0.021067270997616', + apy: '0.021178485256032', lstApy: '0', - grossApy: '0.021067270997616', + grossApy: '0.021178485256032', borrowMin: '0.1', borrowCap: '0', - totalBorrow: '35079.097027011533459236', + totalBorrow: '43038.854572542573747836', }, ], }, @@ -1657,11 +1814,11 @@ describe('Test Adapter for getPortfolios', function () { chainId: 1, protocolId: 'morphoblue', marketId: '0xc54d7acf14de29e0e5527cabd7a576506870346a78a11a6762e2cca66322ec41', - utilization: '0.51198831955053270842', - healthRate: '1.95316955839517165431', - netAPY: '0.0428833238224355973', - totalSupplyUSD: '67.90989457078448541786294543', - totalBorrowUSD: '32.85677379803155475096', + utilization: '0.51177101208791620374', + healthRate: '1.95399891041154131191', + netAPY: '0.03598705678297986757', + totalSupplyUSD: '68.83607023114875493740264144', + totalBorrowUSD: '33.29074853718063491058036561', supplies: [ { token: { @@ -1672,17 +1829,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped liquid staked Ether 2.0', logoUri: 'https://cdn.furucombo.app/assets/img/token/wstETH.png', }, - price: '4041.04280353', + price: '4096.15576624', balance: '0.016805042132061231', apy: '0', - lstApy: '0.0302', - grossApy: '0.0302', + lstApy: '0.0305', + grossApy: '0.0305', usageAsCollateralEnabled: true, ltv: '0.945', liquidationThreshold: '0.945', isNotCollateral: false, supplyCap: '0', - totalSupply: '6763.529545313531745675', + totalSupply: '2963.515135772032017262', }, ], borrows: [ @@ -1695,14 +1852,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped Ether', logoUri: 'https://cdn.furucombo.app/assets/img/token/WETH.svg', }, - price: '3451.49', - balance: '0.009519591190480504', - apy: '0.016668845526933485', + price: '3490.68309921', + balance: '0.009537029742033841', + apy: '0.024641339348790536', lstApy: '0', - grossApy: '0.016668845526933485', + grossApy: '0.024641339348790536', borrowMin: '0', borrowCap: '0', - totalBorrow: '3371.933425833886994963', + totalBorrow: '2581.947953339306619916', }, ], }, @@ -1712,8 +1869,8 @@ describe('Test Adapter for getPortfolios', function () { marketId: '0xb323495f7e4148be5643a4ea4a8221eef163e4bccfdedc2a6f4696baacbc86cc', utilization: '0', healthRate: 'Infinity', - netAPY: '0.0302', - totalSupplyUSD: '4.13803768240672961875974372', + netAPY: '0.0305', + totalSupplyUSD: '4.1675105701214548409533686', totalBorrowUSD: '0', supplies: [ { @@ -1725,17 +1882,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped liquid staked Ether 2.0', logoUri: 'https://cdn.furucombo.app/assets/img/token/wstETH.png', }, - price: '4031.64608961', + price: '4060.36121055', balance: '0.001026389120084452', apy: '0', - lstApy: '0.0302', - grossApy: '0.0302', + lstApy: '0.0305', + grossApy: '0.0305', usageAsCollateralEnabled: true, ltv: '0.86', liquidationThreshold: '0.86', isNotCollateral: false, supplyCap: '0', - totalSupply: '0.000056028530337598', + totalSupply: '0.000061755914425125', }, ], borrows: [ @@ -1748,14 +1905,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'USD Coin', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99976646', + price: '0.99997275', balance: '0', - apy: '0.08047957110161863', + apy: '0.05926412826072425', lstApy: '0', - grossApy: '0.08047957110161863', + grossApy: '0.05926412826072425', borrowMin: '0', borrowCap: '0', - totalBorrow: '46386073.623018', + totalBorrow: '49374321.346221', }, ], }, @@ -1778,7 +1935,7 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped BTC', logoUri: 'https://cdn.furucombo.app/assets/img/token/WBTC.svg', }, - price: '61766.29750948', + price: '67214.30913055', balance: '0', apy: '0', lstApy: '0', @@ -1788,7 +1945,7 @@ describe('Test Adapter for getPortfolios', function () { liquidationThreshold: '0.86', isNotCollateral: false, supplyCap: '0', - totalSupply: '201463.65434546', + totalSupply: '160093.71660682', }, ], borrows: [ @@ -1801,14 +1958,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Tether USD', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDT.svg', }, - price: '0.99893033', + price: '1.00026094', balance: '0', - apy: '0.08058117382430097', + apy: '0.1110454546501074', lstApy: '0', - grossApy: '0.08058117382430097', + grossApy: '0.1110454546501074', borrowMin: '0', borrowCap: '0', - totalBorrow: '15494116.451972', + totalBorrow: '14587827.159202', }, ], }, @@ -1831,7 +1988,7 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped eETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/weETH.webp', }, - price: '3591.1215466', + price: '3641.86070957', balance: '0', apy: '0', lstApy: '0', @@ -1841,7 +1998,7 @@ describe('Test Adapter for getPortfolios', function () { liquidationThreshold: '0.86', isNotCollateral: false, supplyCap: '0', - totalSupply: '7168.782341909252879122', + totalSupply: '6055.04560760733518427', }, ], borrows: [ @@ -1854,14 +2011,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped Ether', logoUri: 'https://cdn.furucombo.app/assets/img/token/WETH.svg', }, - price: '3451.49', + price: '3490.68309921', balance: '0', - apy: '0.05102276964906238', + apy: '0.03787861928507996', lstApy: '0', - grossApy: '0.05102276964906238', + grossApy: '0.03787861928507996', borrowMin: '0', borrowCap: '0', - totalBorrow: '4848.745027985432160735', + totalBorrow: '4601.737975500342669315', }, ], }, @@ -1884,7 +2041,7 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped BTC', logoUri: 'https://cdn.furucombo.app/assets/img/token/WBTC.svg', }, - price: '61766.29750948', + price: '67214.30913055', balance: '0', apy: '0', lstApy: '0', @@ -1894,7 +2051,7 @@ describe('Test Adapter for getPortfolios', function () { liquidationThreshold: '0.86', isNotCollateral: false, supplyCap: '0', - totalSupply: '246638.98831917', + totalSupply: '302354.79781323', }, ], borrows: [ @@ -1907,14 +2064,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'USD Coin', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99976646', + price: '0.99997275', balance: '0', - apy: '0.08182151742595933', + apy: '0.06569095507625233', lstApy: '0', - grossApy: '0.08182151742595933', + grossApy: '0.06569095507625233', borrowMin: '0', borrowCap: '0', - totalBorrow: '20297830.197191', + totalBorrow: '26722398.125023', }, ], }, @@ -1937,7 +2094,7 @@ describe('Test Adapter for getPortfolios', function () { name: 'Staked ETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/osETH.webp', }, - price: '3523.25424295', + price: '3575.88505366', balance: '0', apy: '0', lstApy: '0', @@ -1947,7 +2104,7 @@ describe('Test Adapter for getPortfolios', function () { liquidationThreshold: '0.86', isNotCollateral: false, supplyCap: '0', - totalSupply: '543.024381505655718748', + totalSupply: '639.704286812183604901', }, ], borrows: [ @@ -1960,14 +2117,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped Ether', logoUri: 'https://cdn.furucombo.app/assets/img/token/WETH.svg', }, - price: '3451.49', + price: '3490.68309921', balance: '0', - apy: '0.013468478851918597', + apy: '0.027503885619894808', lstApy: '0', - grossApy: '0.013468478851918597', + grossApy: '0.027503885619894808', borrowMin: '0', borrowCap: '0', - totalBorrow: '488.096814363049064958', + totalBorrow: '582.671823206800737686', }, ], }, @@ -1990,17 +2147,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped liquid staked Ether 2.0', logoUri: 'https://cdn.furucombo.app/assets/img/token/wstETH.png', }, - price: '4049.63881379', + price: '4097.09186578', balance: '0', apy: '0', - lstApy: '0.0302', - grossApy: '0.0302', + lstApy: '0.0305', + grossApy: '0.0305', usageAsCollateralEnabled: true, ltv: '0.86', liquidationThreshold: '0.86', isNotCollateral: false, supplyCap: '0', - totalSupply: '0.00000202729397271', + totalSupply: '0.000002578478354928', }, ], borrows: [ @@ -2013,14 +2170,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Tether USD', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDT.svg', }, - price: '0.99893033', + price: '1.00026094', balance: '0', - apy: '0.06875267409712071', + apy: '0.1352095617465725', lstApy: '0', - grossApy: '0.06875267409712071', + grossApy: '0.1352095617465725', borrowMin: '0', borrowCap: '0', - totalBorrow: '1810350.625894', + totalBorrow: '2385531.595832', }, ], }, @@ -2043,17 +2200,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped liquid staked Ether 2.0', logoUri: 'https://cdn.furucombo.app/assets/img/token/wstETH.png', }, - price: '4035.66538788', + price: '4095.5176671', balance: '0', apy: '0', - lstApy: '0.0302', - grossApy: '0.0302', + lstApy: '0.0305', + grossApy: '0.0305', usageAsCollateralEnabled: true, ltv: '0.86', liquidationThreshold: '0.86', isNotCollateral: false, supplyCap: '0', - totalSupply: '0.000001438047563862', + totalSupply: '0.000001235811937236', }, ], borrows: [ @@ -2066,14 +2223,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'PayPal USD', logoUri: 'https://cdn.furucombo.app/assets/img/token/PYUSD.webp', }, - price: '0.9986693', + price: '0.99984422', balance: '0', - apy: '0.04984725806666046', + apy: '0.05014773554456098', lstApy: '0', - grossApy: '0.04984725806666046', + grossApy: '0.05014773554456098', borrowMin: '0', borrowCap: '0', - totalBorrow: '1294588.367387', + totalBorrow: '1112658.644867', }, ], }, @@ -2096,7 +2253,7 @@ describe('Test Adapter for getPortfolios', function () { name: 'Renzo Restaked ETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/ezETH.webp', }, - price: '3480.97773578', + price: '3539.72136731', balance: '0', apy: '0', lstApy: '0', @@ -2106,7 +2263,7 @@ describe('Test Adapter for getPortfolios', function () { liquidationThreshold: '0.86', isNotCollateral: false, supplyCap: '0', - totalSupply: '4713.456555189467429208', + totalSupply: '2745.095904233533557945', }, ], borrows: [ @@ -2119,14 +2276,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped Ether', logoUri: 'https://cdn.furucombo.app/assets/img/token/WETH.svg', }, - price: '3451.49', + price: '3490.68309921', balance: '0', - apy: '0.136306690792646', + apy: '0.04402589380735433', lstApy: '0', - grossApy: '0.136306690792646', + grossApy: '0.04402589380735433', borrowMin: '0', borrowCap: '0', - totalBorrow: '3545.170861576577681996', + totalBorrow: '1933.560906990264160782', }, ], }, @@ -2149,17 +2306,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Savings Dai', logoUri: 'https://cdn.furucombo.app/assets/img/token/sDAI.svg', }, - price: '1.08986786', + price: '1.10111543', balance: '0', apy: '0', - lstApy: '0.077', - grossApy: '0.077', + lstApy: '0.0677', + grossApy: '0.0677', usageAsCollateralEnabled: true, ltv: '0.86', liquidationThreshold: '0.86', isNotCollateral: false, supplyCap: '0', - totalSupply: '1779.586181981825984694', + totalSupply: '0.000503728179716203', }, ], borrows: [ @@ -2172,14 +2329,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped Ether', logoUri: 'https://cdn.furucombo.app/assets/img/token/WETH.svg', }, - price: '3451.49', + price: '3490.68309921', balance: '0', - apy: '0.003231725090959925', + apy: '0.011698580285239402', lstApy: '0', - grossApy: '0.003231725090959925', + grossApy: '0.011698580285239402', borrowMin: '0', borrowCap: '0', - totalBorrow: '0.000453579759335521', + totalBorrow: '0.000453931062178078', }, ], }, @@ -2201,7 +2358,7 @@ describe('Test Adapter for getPortfolios', function () { symbol: 'sUSDe', name: 'Staked USDe', }, - price: '1.08334595', + price: '1.09051419', balance: '0', apy: '0', lstApy: '0', @@ -2211,7 +2368,7 @@ describe('Test Adapter for getPortfolios', function () { liquidationThreshold: '0.915', isNotCollateral: false, supplyCap: '0', - totalSupply: '100478736.197774504143397893', + totalSupply: '87680178.955999030419200565', }, ], borrows: [ @@ -2224,14 +2381,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Dai Stablecoin', logoUri: 'https://cdn.furucombo.app/assets/img/token/DAI.png', }, - price: '0.999806', + price: '0.99983633', balance: '0', - apy: '0.11946698289507718', + apy: '0.09337264685512148', lstApy: '0', - grossApy: '0.11946698289507718', + grossApy: '0.09337264685512148', borrowMin: '0', borrowCap: '0', - totalBorrow: '74375457.572679967081706164', + totalBorrow: '71462208.495193595724587057', }, ], }, @@ -2254,7 +2411,7 @@ describe('Test Adapter for getPortfolios', function () { name: 'Autocompounding Pirex Ether', logoUri: 'https://cdn.furucombo.app/assets/img/token/apxETH.webp', }, - price: '3569.9127273', + price: '3620.72382055', balance: '0', apy: '0', lstApy: '0', @@ -2264,7 +2421,7 @@ describe('Test Adapter for getPortfolios', function () { liquidationThreshold: '0.86', isNotCollateral: false, supplyCap: '0', - totalSupply: '346.342574959366486358', + totalSupply: '501.286783975638779879', }, ], borrows: [ @@ -2277,14 +2434,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped Ether', logoUri: 'https://cdn.furucombo.app/assets/img/token/WETH.svg', }, - price: '3451.49', + price: '3490.68309921', balance: '0', - apy: '0.029576589643002915', + apy: '0.08585437848469812', lstApy: '0', - grossApy: '0.029576589643002915', + grossApy: '0.08585437848469812', borrowMin: '0', borrowCap: '0', - totalBorrow: '323.696305659700279639', + totalBorrow: '472.328057984574479328', }, ], }, @@ -2307,7 +2464,7 @@ describe('Test Adapter for getPortfolios', function () { name: 'USDe', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDe.webp', }, - price: '0.999806', + price: '0.99983633', balance: '0', apy: '0', lstApy: '0', @@ -2317,7 +2474,7 @@ describe('Test Adapter for getPortfolios', function () { liquidationThreshold: '0.915', isNotCollateral: false, supplyCap: '0', - totalSupply: '73194502.134851786836819141', + totalSupply: '56282223.912902185997857763', }, ], borrows: [ @@ -2330,14 +2487,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Dai Stablecoin', logoUri: 'https://cdn.furucombo.app/assets/img/token/DAI.png', }, - price: '0.999806', + price: '0.99983633', balance: '0', - apy: '0.12107064887170238', + apy: '0.10077068245280651', lstApy: '0', - grossApy: '0.12107064887170238', + grossApy: '0.10077068245280651', borrowMin: '0', borrowCap: '0', - totalBorrow: '59012574.612827135663858813', + totalBorrow: '49379343.787126585239565885', }, ], }, @@ -2360,7 +2517,7 @@ describe('Test Adapter for getPortfolios', function () { name: 'Maker', logoUri: 'https://cdn.furucombo.app/assets/img/token/MKR.png', }, - price: '2574.96591722', + price: '2773.92399999', balance: '0', apy: '0', lstApy: '0', @@ -2370,7 +2527,7 @@ describe('Test Adapter for getPortfolios', function () { liquidationThreshold: '0.77', isNotCollateral: false, supplyCap: '0', - totalSupply: '0.00000580178518284', + totalSupply: '0.000010001425883679', }, ], borrows: [ @@ -2383,14 +2540,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'USD Coin', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99976646', + price: '0.99997275', balance: '0', - apy: '0.225928621893134', + apy: '0.12236911773233006', lstApy: '0', - grossApy: '0.225928621893134', + grossApy: '0.12236911773233006', borrowMin: '0', borrowCap: '0', - totalBorrow: '5098612.748746', + totalBorrow: '7739095.897883', }, ], }, @@ -2412,7 +2569,7 @@ describe('Test Adapter for getPortfolios', function () { symbol: 'sUSDe', name: 'Staked USDe', }, - price: '1.08283361', + price: '1.09044488', balance: '0', apy: '0', lstApy: '0', @@ -2422,7 +2579,7 @@ describe('Test Adapter for getPortfolios', function () { liquidationThreshold: '0.915', isNotCollateral: false, supplyCap: '0', - totalSupply: '0.000002627601751305', + totalSupply: '0.000002031481483774', }, ], borrows: [ @@ -2435,14 +2592,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Tether USD', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDT.svg', }, - price: '0.99893033', + price: '1.00026094', balance: '0', - apy: '0.11769596008880057', + apy: '0.07821817494338412', lstApy: '0', - grossApy: '0.11769596008880057', + grossApy: '0.07821817494338412', borrowMin: '0', borrowCap: '0', - totalBorrow: '2254759.391188', + totalBorrow: '1728059.427362', }, ], }, @@ -2465,17 +2622,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped liquid staked Ether 2.0', logoUri: 'https://cdn.furucombo.app/assets/img/token/wstETH.png', }, - price: '4041.81953479', + price: '4096.60756363', balance: '0', apy: '0', - lstApy: '0.0302', - grossApy: '0.0302', + lstApy: '0.0305', + grossApy: '0.0305', usageAsCollateralEnabled: true, ltv: '0.965', liquidationThreshold: '0.965', isNotCollateral: false, supplyCap: '0', - totalSupply: '3205.22948489651697146', + totalSupply: '2652.942630078848219735', }, ], borrows: [ @@ -2488,14 +2645,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped Ether', logoUri: 'https://cdn.furucombo.app/assets/img/token/WETH.svg', }, - price: '3451.49', + price: '3490.68309921', balance: '0', - apy: '0.014184222732657403', + apy: '0.026932617537335224', lstApy: '0', - grossApy: '0.014184222732657403', + grossApy: '0.026932617537335224', borrowMin: '0', borrowCap: '0', - totalBorrow: '1997.99513735118188886', + totalBorrow: '2402.076658938152459001', }, ], }, @@ -2518,17 +2675,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped liquid staked Ether 2.0', logoUri: 'https://cdn.furucombo.app/assets/img/token/wstETH.png', }, - price: '4046.62312368', + price: '4070.84057574', balance: '0', apy: '0', - lstApy: '0.0302', - grossApy: '0.0302', + lstApy: '0.0305', + grossApy: '0.0305', usageAsCollateralEnabled: true, ltv: '0.86', liquidationThreshold: '0.86', isNotCollateral: false, supplyCap: '0', - totalSupply: '9322353.979614004925806157', + totalSupply: '3487192.50655081971891179', }, ], borrows: [ @@ -2541,14 +2698,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'USDA', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDA.webp', }, - price: '0.99976646', + price: '0.99997275', balance: '0', - apy: '0.02493013791693377', + apy: '0.0381642135832545', lstApy: '0', - grossApy: '0.02493013791693377', + grossApy: '0.0381642135832545', borrowMin: '0', borrowCap: '0', - totalBorrow: '8383700.823781314248223588', + totalBorrow: '3156394.848162521775254424', }, ], }, @@ -2571,7 +2728,7 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped OETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/WOETH.webp', }, - price: '3779.03957316', + price: '3830.43047086', balance: '0', apy: '0', lstApy: '0', @@ -2581,7 +2738,7 @@ describe('Test Adapter for getPortfolios', function () { liquidationThreshold: '0.86', isNotCollateral: false, supplyCap: '0', - totalSupply: '1000.000004611473715498', + totalSupply: '1260.287570586851027442', }, ], borrows: [ @@ -2594,14 +2751,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped Ether', logoUri: 'https://cdn.furucombo.app/assets/img/token/WETH.svg', }, - price: '3451.49', + price: '3490.68309921', balance: '0', - apy: '0.012252206472022742', + apy: '0.019766050606278895', lstApy: '0', - grossApy: '0.012252206472022742', + grossApy: '0.019766050606278895', borrowMin: '0', borrowCap: '0', - totalBorrow: '881.337741133048377343', + totalBorrow: '1151.327543722475168056', }, ], }, @@ -2624,7 +2781,7 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped eETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/weETH.webp', }, - price: '3582396520545153.20703022', + price: '3610103382879283.09924147', balance: '0', apy: '0', lstApy: '0', @@ -2634,7 +2791,7 @@ describe('Test Adapter for getPortfolios', function () { liquidationThreshold: '0.77', isNotCollateral: false, supplyCap: '0', - totalSupply: '0.000000000801063447', + totalSupply: '0.000000000840080544', }, ], borrows: [ @@ -2647,14 +2804,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'USD Coin', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99976646', + price: '0.99997275', balance: '0', - apy: '0.18194138695176032', + apy: '4.59053062236119', lstApy: '0', - grossApy: '0.18194138695176032', + grossApy: '4.59053062236119', borrowMin: '0', borrowCap: '0', - totalBorrow: '801.063447', + totalBorrow: '836.457121', }, ], }, @@ -2677,7 +2834,7 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped BTC', logoUri: 'https://cdn.furucombo.app/assets/img/token/WBTC.svg', }, - price: '61684.10509739', + price: '67203.83848547', balance: '0', apy: '0', lstApy: '0', @@ -2687,7 +2844,7 @@ describe('Test Adapter for getPortfolios', function () { liquidationThreshold: '0.86', isNotCollateral: false, supplyCap: '0', - totalSupply: '33792.01042153', + totalSupply: '34177.82785145', }, ], borrows: [ @@ -2700,14 +2857,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'PayPal USD', logoUri: 'https://cdn.furucombo.app/assets/img/token/PYUSD.webp', }, - price: '0.9986693', + price: '0.99984422', balance: '0', - apy: '0.05004140858261108', + apy: '0.05046304786787181', lstApy: '0', - grossApy: '0.05004140858261108', + grossApy: '0.05046304786787181', borrowMin: '0', borrowCap: '0', - totalBorrow: '3041548.244937', + totalBorrow: '3077379.020352', }, ], }, @@ -2730,7 +2887,7 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped BTC', logoUri: 'https://cdn.furucombo.app/assets/img/token/WBTC.svg', }, - price: '61496.85102418', + price: '66226.90758217', balance: '0', apy: '0', lstApy: '0', @@ -2740,7 +2897,7 @@ describe('Test Adapter for getPortfolios', function () { liquidationThreshold: '0.915', isNotCollateral: false, supplyCap: '0', - totalSupply: '5577517350837.91258339', + totalSupply: '34321823860776.43721751', }, ], borrows: [ @@ -2753,14 +2910,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped Ether', logoUri: 'https://cdn.furucombo.app/assets/img/token/WETH.svg', }, - price: '3451.49', + price: '3490.68309921', balance: '0', - apy: '0.013816425202661131', + apy: '0.02492500703960765', lstApy: '0', - grossApy: '0.013816425202661131', + grossApy: '0.02492500703960765', borrowMin: '0', borrowCap: '0', - totalBorrow: '176.182133918351339944', + totalBorrow: '2327.555069156552873996', }, ], }, @@ -2783,7 +2940,7 @@ describe('Test Adapter for getPortfolios', function () { name: 'USDe', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDe.webp', }, - price: '0.999806', + price: '0.99983633', balance: '0', apy: '0', lstApy: '0', @@ -2793,7 +2950,7 @@ describe('Test Adapter for getPortfolios', function () { liquidationThreshold: '0.945', isNotCollateral: false, supplyCap: '0', - totalSupply: '6384429.751755211475845306', + totalSupply: '1175652.557788445352586945', }, ], borrows: [ @@ -2806,14 +2963,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Dai Stablecoin', logoUri: 'https://cdn.furucombo.app/assets/img/token/DAI.png', }, - price: '0.999806', + price: '0.99983633', balance: '0', - apy: '0.20338618001411812', + apy: '0.08913819700053671', lstApy: '0', - grossApy: '0.20338618001411812', + grossApy: '0.08913819700053671', borrowMin: '0', borrowCap: '0', - totalBorrow: '4896259.445166847220778164', + totalBorrow: '1047928.386520551878766451', }, ], }, @@ -2836,7 +2993,7 @@ describe('Test Adapter for getPortfolios', function () { name: 'USDe', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDe.webp', }, - price: '0.9994626', + price: '1.00000793', balance: '0', apy: '0', lstApy: '0', @@ -2846,7 +3003,7 @@ describe('Test Adapter for getPortfolios', function () { liquidationThreshold: '0.915', isNotCollateral: false, supplyCap: '0', - totalSupply: '0.000000262546717353', + totalSupply: '0.000000235740956354', }, ], borrows: [ @@ -2859,14 +3016,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Tether USD', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDT.svg', }, - price: '0.99893033', + price: '1.00026094', balance: '0', - apy: '0.4206351561783963', + apy: '0.5322527493040421', lstApy: '0', - grossApy: '0.4206351561783963', + grossApy: '0.5322527493040421', borrowMin: '0', borrowCap: '0', - totalBorrow: '216722.511918', + totalBorrow: '213346.499595', }, ], }, @@ -2888,7 +3045,7 @@ describe('Test Adapter for getPortfolios', function () { symbol: 'sUSDe', name: 'Staked USDe', }, - price: '1.08334595', + price: '1.09051419', balance: '0', apy: '0', lstApy: '0', @@ -2898,7 +3055,7 @@ describe('Test Adapter for getPortfolios', function () { liquidationThreshold: '0.945', isNotCollateral: false, supplyCap: '0', - totalSupply: '4433646.057391573523416087', + totalSupply: '2294284.493132864627822437', }, ], borrows: [ @@ -2911,14 +3068,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Dai Stablecoin', logoUri: 'https://cdn.furucombo.app/assets/img/token/DAI.png', }, - price: '0.999806', + price: '0.99983633', balance: '0', - apy: '0.16745427503962307', + apy: '0.08451056296054094', lstApy: '0', - grossApy: '0.16745427503962307', + grossApy: '0.08451056296054094', borrowMin: '0', borrowCap: '0', - totalBorrow: '3465862.910268294100332565', + totalBorrow: '1664459.121623380614156847', }, ], }, @@ -2941,17 +3098,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Savings Dai', logoUri: 'https://cdn.furucombo.app/assets/img/token/sDAI.svg', }, - price: '1.09217274', + price: '1.09789444', balance: '0', apy: '0', - lstApy: '0.077', - grossApy: '0.077', + lstApy: '0.0677', + grossApy: '0.0677', usageAsCollateralEnabled: true, ltv: '0.98', liquidationThreshold: '0.98', isNotCollateral: false, supplyCap: '0', - totalSupply: '159512.793770200078161222', + totalSupply: '156137.398776410763990294', }, ], borrows: [ @@ -2964,14 +3121,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Dai Stablecoin', logoUri: 'https://cdn.furucombo.app/assets/img/token/DAI.png', }, - price: '0.999806', + price: '0.99983633', balance: '0', - apy: '0.09442371916672343', + apy: '0.08592942441493978', lstApy: '0', - grossApy: '0.09442371916672343', + grossApy: '0.08592942441493978', borrowMin: '0', borrowCap: '0', - totalBorrow: '102868.066313518451496984', + totalBorrow: '103801.207883822709376596', }, ], }, @@ -2994,7 +3151,7 @@ describe('Test Adapter for getPortfolios', function () { name: 'rsETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/rsETH.webp', }, - price: '3470.76854137', + price: '3551.82454979', balance: '0', apy: '0', lstApy: '0', @@ -3004,7 +3161,7 @@ describe('Test Adapter for getPortfolios', function () { liquidationThreshold: '0.77', isNotCollateral: false, supplyCap: '0', - totalSupply: '1211781.104127587579718277', + totalSupply: '1154641.377391931252835548', }, ], borrows: [ @@ -3017,14 +3174,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'USDA', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDA.webp', }, - price: '0.99976646', + price: '0.99997275', balance: '0', - apy: '0.02079799880981059', + apy: '0.07122369917503568', lstApy: '0', - grossApy: '0.02079799880981059', + grossApy: '0.07122369917503568', borrowMin: '0', borrowCap: '0', - totalBorrow: '604423.373203033617617166', + totalBorrow: '1110952.504882587897510242', }, ], }, @@ -3046,7 +3203,7 @@ describe('Test Adapter for getPortfolios', function () { symbol: 'Re7USDT', name: 'Re7 USDT', }, - price: '1.04664748', + price: '1.05392422', balance: '0', apy: '0', lstApy: '0', @@ -3056,7 +3213,7 @@ describe('Test Adapter for getPortfolios', function () { liquidationThreshold: '0.915', isNotCollateral: false, supplyCap: '0', - totalSupply: '40128.701999295415487469', + totalSupply: '7.968490457390818643', }, ], borrows: [ @@ -3069,14 +3226,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'USDA', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDA.webp', }, - price: '0.99976646', + price: '0.99997275', balance: '0', - apy: '0.04044055898563825', + apy: '0.11085404078237104', lstApy: '0', - grossApy: '0.04044055898563825', + grossApy: '0.11085404078237104', borrowMin: '0', borrowCap: '0', - totalBorrow: '31888.043145329065527501', + totalBorrow: '7.968490457390818643', }, ], }, @@ -3099,7 +3256,7 @@ describe('Test Adapter for getPortfolios', function () { name: 'Renzo Restaked ETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/ezETH.webp', }, - price: '3480.16478824', + price: '3539.6249099', balance: '0', apy: '0', lstApy: '0', @@ -3109,7 +3266,7 @@ describe('Test Adapter for getPortfolios', function () { liquidationThreshold: '0.77', isNotCollateral: false, supplyCap: '0', - totalSupply: '1664564.496965385903693452', + totalSupply: '484118.422553807730149076', }, ], borrows: [ @@ -3122,14 +3279,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'USDA', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDA.webp', }, - price: '0.99976646', + price: '0.99997275', balance: '0', - apy: '0.02422092081895788', + apy: '0.05773884471489832', lstApy: '0', - grossApy: '0.02422092081895788', + grossApy: '0.05773884471489832', borrowMin: '0', borrowCap: '0', - totalBorrow: '53423.294296430244105842', + totalBorrow: '456819.945759042291566359', }, ], }, @@ -3152,7 +3309,7 @@ describe('Test Adapter for getPortfolios', function () { name: 'mTBILL', logoUri: 'https://cdn.furucombo.app/assets/img/token/mTBILL.webp', }, - price: '110.97999999', + price: '111.41999999', balance: '0', apy: '0', lstApy: '0', @@ -3162,7 +3319,7 @@ describe('Test Adapter for getPortfolios', function () { liquidationThreshold: '0.98', isNotCollateral: false, supplyCap: '0', - totalSupply: '0.000000823474780268', + totalSupply: '0.000000471676011447', }, ], borrows: [ @@ -3175,14 +3332,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'USD Coin', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99976646', + price: '0.99997275', balance: '0', - apy: '0.035048485862207324', + apy: '0.0462540178528259', lstApy: '0', - grossApy: '0.035048485862207324', + grossApy: '0.0462540178528259', borrowMin: '0', borrowCap: '0', - totalBorrow: '423474.780268', + totalBorrow: '424613.163633', }, ], }, @@ -3190,11 +3347,11 @@ describe('Test Adapter for getPortfolios', function () { chainId: 1, protocolId: 'radiant-v2', marketId: 'mainnet', - utilization: '0.93479816003825574237', - healthRate: '1.10986525685666869591', - netAPY: '-0.31656977046958074219', - totalSupplyUSD: '10.89104191192556', - totalBorrowUSD: '8.14474075213403235078', + utilization: '0.95183795698641284806', + healthRate: '1.08999645620857495124', + netAPY: '-0.32097380228258084703', + totalSupplyUSD: '10.91617152621975', + totalBorrowUSD: '8.31234112290420727350256047', supplies: [ { token: { @@ -3205,17 +3362,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Tether USD', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDT.svg', }, - price: '0.99893033', + price: '1.00026094', balance: '0', - apy: '0.02982697680015574601', + apy: '0.02571700300068744946', lstApy: '0', - grossApy: '0.02982697680015574601', + grossApy: '0.02571700300068744946', usageAsCollateralEnabled: true, ltv: '0.75', liquidationThreshold: '0.78', isNotCollateral: false, supplyCap: '0', - totalSupply: '2075396.884445', + totalSupply: '1634121.414564', }, { token: { @@ -3226,17 +3383,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'USD Coin', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99976646', - balance: '10.893586', - apy: '0.03145270709504670485', + price: '0.99997275', + balance: '10.916469', + apy: '0.03027515846957208228', lstApy: '0', - grossApy: '0.03145270709504670485', + grossApy: '0.03027515846957208228', usageAsCollateralEnabled: true, ltv: '0.8', liquidationThreshold: '0.83', isNotCollateral: false, supplyCap: '0', - totalSupply: '4139657.021052', + totalSupply: '3723627.534416', }, { token: { @@ -3247,17 +3404,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Ethereum', logoUri: 'https://cdn.furucombo.app/assets/img/token/ETH.png', }, - price: '3451.49', + price: '3490.68309921', balance: '0', - apy: '0.02681226831087132932', + apy: '0.02398569529105577031', lstApy: '0', - grossApy: '0.02681226831087132932', + grossApy: '0.02398569529105577031', usageAsCollateralEnabled: true, ltv: '0.8', liquidationThreshold: '0.83', isNotCollateral: false, supplyCap: '0', - totalSupply: '1592.356030745871165776', + totalSupply: '1900.065828494781537003', }, { token: { @@ -3268,17 +3425,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped BTC', logoUri: 'https://cdn.furucombo.app/assets/img/token/WBTC.svg', }, - price: '61644.88421134', + price: '67220.81139964', balance: '0', - apy: '0.00593727577390408302', + apy: '0.00669608716004751232', lstApy: '0', - grossApy: '0.00593727577390408302', + grossApy: '0.00669608716004751232', usageAsCollateralEnabled: true, ltv: '0.73', liquidationThreshold: '0.78', isNotCollateral: false, supplyCap: '0', - totalSupply: '97.27744868', + totalSupply: '88.02999641', }, { token: { @@ -3289,17 +3446,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped liquid staked Ether 2.0', logoUri: 'https://cdn.furucombo.app/assets/img/token/wstETH.png', }, - price: '4041.81953479', + price: '4096.60756363', balance: '0', - apy: '0.01145606089205523296', - lstApy: '0.0302', - grossApy: '0.04165606089205523296', + apy: '0.00842622067403518513', + lstApy: '0.0305', + grossApy: '0.03892622067403518513', usageAsCollateralEnabled: true, ltv: '0.8', liquidationThreshold: '0.83', isNotCollateral: false, supplyCap: '0', - totalSupply: '1246.397573836940254605', + totalSupply: '1492.178830166869810236', }, { token: { @@ -3310,17 +3467,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Savings Dai', logoUri: 'https://cdn.furucombo.app/assets/img/token/sDAI.svg', }, - price: '1.09217133', + price: '1.09789311', balance: '0', - apy: '0.01709675603480361908', - lstApy: '0.077', - grossApy: '0.09409675603480361908', + apy: '0.01273216421205693504', + lstApy: '0.0677', + grossApy: '0.08043216421205693504', usageAsCollateralEnabled: true, ltv: '0.77', liquidationThreshold: '0.8', isNotCollateral: false, supplyCap: '0', - totalSupply: '1477350.371129305731580336', + totalSupply: '1273950.386909165910572328', }, { token: { @@ -3331,17 +3488,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Rocket Pool ETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/rETH.svg', }, - price: '3830.01696', + price: '3881.07180386', balance: '0', - apy: '0.01359395135890270125', - lstApy: '0.0282', - grossApy: '0.04179395135890270125', + apy: '0.01564396941974814165', + lstApy: '0.0269', + grossApy: '0.04254396941974814165', usageAsCollateralEnabled: true, ltv: '0.75', liquidationThreshold: '0.8', isNotCollateral: false, supplyCap: '0', - totalSupply: '237.696038900446132941', + totalSupply: '195.403828028553344102', }, { token: { @@ -3352,17 +3509,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped eETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/weETH.webp', }, - price: '3595.25941308', + price: '3643.00043268', balance: '0', - apy: '0.00834659726724802669', + apy: '0.00533019098905472844', lstApy: '0', - grossApy: '0.00834659726724802669', + grossApy: '0.00533019098905472844', usageAsCollateralEnabled: true, ltv: '0.725', liquidationThreshold: '0.75', isNotCollateral: false, supplyCap: '0', - totalSupply: '77.925150067337297688', + totalSupply: '52.401703505402212614', }, ], borrows: [ @@ -3375,14 +3532,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Tether USD', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDT.svg', }, - price: '0.99893033', + price: '1.00026094', balance: '0', - apy: '0.1549260090926182774', + apy: '0.14325488534962859361', lstApy: '0', - grossApy: '0.1549260090926182774', + grossApy: '0.14325488534962859361', borrowMin: '0', borrowCap: '0', - totalBorrow: '1694326.011435', + totalBorrow: '1239947.741569', }, { token: { @@ -3393,14 +3550,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'USD Coin', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99976646', + price: '0.99997275', balance: '0', - apy: '0.15934010368922762844', + apy: '0.15615348259240791381', lstApy: '0', - grossApy: '0.15934010368922762844', + grossApy: '0.15615348259240791381', borrowMin: '0', borrowCap: '0', - totalBorrow: '3469114.480109', + totalBorrow: '3062272.397784', }, { token: { @@ -3411,14 +3568,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Ethereum', logoUri: 'https://cdn.furucombo.app/assets/img/token/ETH.png', }, - price: '3451.49', - balance: '0.002359775271588222', - apy: '0.14880138188482824583', + price: '3490.68309921', + balance: '0.002381293542454607', + apy: '0.14030345370150532427', lstApy: '0', - grossApy: '0.14880138188482824583', + grossApy: '0.14030345370150532427', borrowMin: '0', borrowCap: '0', - totalBorrow: '1215.040459035277612883', + totalBorrow: '1372.099240880812812713', }, { token: { @@ -3429,14 +3586,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped BTC', logoUri: 'https://cdn.furucombo.app/assets/img/token/WBTC.svg', }, - price: '61644.88421134', + price: '67220.81139964', balance: '0', - apy: '0.06578555348495695052', + apy: '0.06998897083533594935', lstApy: '0', - grossApy: '0.06578555348495695052', + grossApy: '0.06998897083533594935', borrowMin: '0', borrowCap: '0', - totalBorrow: '36.15742851', + totalBorrow: '34.74568284', }, { token: { @@ -3447,14 +3604,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped liquid staked Ether 2.0', logoUri: 'https://cdn.furucombo.app/assets/img/token/wstETH.png', }, - price: '4041.81953479', + price: '4096.60756363', balance: '0', - apy: '0.112631948178288201', - lstApy: '0.0302', - grossApy: '0.082431948178288201', + apy: '0.09592850677996523898', + lstApy: '0.0305', + grossApy: '0.06542850677996523898', borrowMin: '0', borrowCap: '0', - totalBorrow: '532.196272074922022088', + totalBorrow: '546.909881775564052165', }, { token: { @@ -3465,14 +3622,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Savings Dai', logoUri: 'https://cdn.furucombo.app/assets/img/token/sDAI.svg', }, - price: '1.09217133', + price: '1.09789311', balance: '0', - apy: '0.13325371931982729524', - lstApy: '0.077', - grossApy: '0.05625371931982729524', + apy: '0.11412290676932411888', + lstApy: '0.0677', + grossApy: '0.04642290676932411888', borrowMin: '0', borrowCap: '0', - totalBorrow: '800989.158908968065399063', + totalBorrow: '596683.747220024715441233', }, { token: { @@ -3483,14 +3640,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Rocket Pool ETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/rETH.svg', }, - price: '3830.01696', + price: '3881.07180386', balance: '0', - apy: '0.12322021575146995517', - lstApy: '0.0282', - grossApy: '0.09502021575146995517', + apy: '0.13268484740301167417', + lstApy: '0.0269', + grossApy: '0.10578484740301167417', borrowMin: '0', borrowCap: '0', - totalBorrow: '110.502814774731880137', + totalBorrow: '97.399536295906319304', }, { token: { @@ -3501,14 +3658,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped eETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/weETH.webp', }, - price: '3595.25941308', + price: '3643.00043268', balance: '0', - apy: '0.07060652327293844457', + apy: '0.05607764344704840689', lstApy: '0', - grossApy: '0.07060652327293844457', + grossApy: '0.05607764344704840689', borrowMin: '0', borrowCap: '0', - totalBorrow: '37.986699166623500766', + totalBorrow: '20.425907418164212162', }, ], }, @@ -3516,11 +3673,11 @@ describe('Test Adapter for getPortfolios', function () { chainId: 1, protocolId: 'spark', marketId: 'mainnet', - utilization: '0.06203778892849313427', - healthRate: '16.3162224207432292532', - netAPY: '0.05639521722344375584', - totalSupplyUSD: '17.63179579907048294576953315', - totalBorrowUSD: '0.18741966468154038037', + utilization: '0.06512764309523461865', + healthRate: '15.54212818015390268038', + netAPY: '0.05346837334270490987', + totalSupplyUSD: '17.74059595428291691773167172', + totalBorrowUSD: '0.19914181925279939215229333', supplies: [ { token: { @@ -3532,16 +3689,16 @@ describe('Test Adapter for getPortfolios', function () { logoUri: 'https://cdn.furucombo.app/assets/img/token/DAI.png', }, price: '1', - balance: '3.44858700252459713', - apy: '0.08509565967919725949', + balance: '3.467780640507955009', + apy: '0.07683935389321952679', lstApy: '0', - grossApy: '0.08509565967919725949', + grossApy: '0.07683935389321952679', usageAsCollateralEnabled: false, ltv: '0', liquidationThreshold: '0.0001', isNotCollateral: false, supplyCap: '0', - totalSupply: '1010782423.503771620085192025', + totalSupply: '978819959.209930667227190254', }, { token: { @@ -3552,17 +3709,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Savings Dai', logoUri: 'https://cdn.furucombo.app/assets/img/token/sDAI.svg', }, - price: '1.09217133', + price: '1.09789311', balance: '0.205958106345767055', apy: '0', - lstApy: '0.077', - grossApy: '0.077', + lstApy: '0.0677', + grossApy: '0.0677', usageAsCollateralEnabled: true, ltv: '0.79', liquidationThreshold: '0.8', isNotCollateral: false, supplyCap: '57238691', - totalSupply: '12341907.127139854701821496', + totalSupply: '18667428.990478263013922088', }, { token: { @@ -3574,16 +3731,16 @@ describe('Test Adapter for getPortfolios', function () { logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, price: '1', - balance: '10.490764', - apy: '0.0599527196698270448', + balance: '10.535621', + apy: '0.0563823178297332399', lstApy: '0', - grossApy: '0.0599527196698270448', + grossApy: '0.0563823178297332399', usageAsCollateralEnabled: false, ltv: '0', liquidationThreshold: '0', isNotCollateral: false, supplyCap: '60000000', - totalSupply: '2559751.230337', + totalSupply: '2603915.071201', }, { token: { @@ -3594,17 +3751,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Ethereum', logoUri: 'https://cdn.furucombo.app/assets/img/token/ETH.png', }, - price: '3451.49', - balance: '0.001004639520211256', - apy: '0.01314179494742804009', + price: '3490.68309921', + balance: '0.001005841615546227', + apy: '0.0182050474957308344', lstApy: '0', - grossApy: '0.01314179494742804009', + grossApy: '0.0182050474957308344', usageAsCollateralEnabled: true, ltv: '0.82', liquidationThreshold: '0.83', isNotCollateral: false, - supplyCap: '402304', - totalSupply: '252108.198952118851085048', + supplyCap: '403526', + totalSupply: '240205.673360739665288574', }, { token: { @@ -3615,17 +3772,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped liquid staked Ether 2.0', logoUri: 'https://cdn.furucombo.app/assets/img/token/wstETH.png', }, - price: '4041.81953479', + price: '4096.60756363', balance: '0', - apy: '0.00000019523203354839', - lstApy: '0.0302', - grossApy: '0.03020019523203354839', + apy: '0.00000074909973864423', + lstApy: '0.0305', + grossApy: '0.03050074909973864423', usageAsCollateralEnabled: true, ltv: '0.79', liquidationThreshold: '0.8', isNotCollateral: false, - supplyCap: '593036', - totalSupply: '563376.009150171764374217', + supplyCap: '614522', + totalSupply: '564390.586912743627552133', }, { token: { @@ -3636,17 +3793,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped BTC', logoUri: 'https://cdn.furucombo.app/assets/img/token/WBTC.svg', }, - price: '61766.29750948', + price: '67214.30913055', balance: '0', - apy: '0.00010561647601812815', + apy: '0.0001159633210487029', lstApy: '0', - grossApy: '0.00010561647601812815', + grossApy: '0.0001159633210487029', usageAsCollateralEnabled: true, ltv: '0.74', liquidationThreshold: '0.75', isNotCollateral: false, - supplyCap: '6050', - totalSupply: '5766.12284065', + supplyCap: '6049', + totalSupply: '5499.78712016', }, { token: { @@ -3657,17 +3814,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Rocket Pool ETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/rETH.svg', }, - price: '3830.01696', + price: '3881.07180386', balance: '0', - apy: '0.00000034584943318971', - lstApy: '0.0282', - grossApy: '0.02820034584943318971', + apy: '0.00000096321954778242', + lstApy: '0.0269', + grossApy: '0.02690096321954778242', usageAsCollateralEnabled: true, ltv: '0.79', liquidationThreshold: '0.8', isNotCollateral: false, supplyCap: '48947', - totalSupply: '38925.107193209864362465', + totalSupply: '39156.34699525170627965', }, { token: { @@ -3680,15 +3837,15 @@ describe('Test Adapter for getPortfolios', function () { }, price: '1', balance: '0', - apy: '0.05053044533333807', + apy: '0.06721727075826540115', lstApy: '0', - grossApy: '0.05053044533333807', + grossApy: '0.06721727075826540115', usageAsCollateralEnabled: false, ltv: '0', liquidationThreshold: '0', isNotCollateral: false, supplyCap: '30000000', - totalSupply: '289830.496222', + totalSupply: '248005.812301', }, { token: { @@ -3699,7 +3856,7 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped eETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/weETH.webp', }, - price: '3595.25941308', + price: '3643.00043268', balance: '0', apy: '0', lstApy: '0', @@ -3708,8 +3865,8 @@ describe('Test Adapter for getPortfolios', function () { ltv: '0.72', liquidationThreshold: '0.73', isNotCollateral: false, - supplyCap: '26685', - totalSupply: '21685.156034108769539942', + supplyCap: '56850', + totalSupply: '52892.690695916432954295', }, ], borrows: [ @@ -3724,12 +3881,30 @@ describe('Test Adapter for getPortfolios', function () { }, price: '1', balance: '0', - apy: '0.08999999999999999998', + apy: '0.07999999999999999995', lstApy: '0', - grossApy: '0.08999999999999999998', + grossApy: '0.07999999999999999995', borrowMin: '0', borrowCap: '0', - totalBorrow: '958185772.009021798439230076', + totalBorrow: '941846029.246625767038886899', + }, + { + token: { + chainId: 1, + address: '0x83F20F44975D03b1b09e64809B757c47f942BEeA', + decimals: 18, + symbol: 'sDAI', + name: 'Savings Dai', + logoUri: 'https://cdn.furucombo.app/assets/img/token/sDAI.svg', + }, + price: '1.09789311', + balance: '0', + apy: '0.01005016708256663351', + lstApy: '0.0677', + grossApy: '-0.05764983291743336649', + borrowMin: '0', + borrowCap: '0', + totalBorrow: '0', }, { token: { @@ -3742,12 +3917,12 @@ describe('Test Adapter for getPortfolios', function () { }, price: '1', balance: '0', - apy: '0.07777805779801123158', + apy: '0.07111542520437467183', lstApy: '0', - grossApy: '0.07777805779801123158', + grossApy: '0.07111542520437467183', borrowMin: '0', borrowCap: '7677918', - totalBorrow: '2097367.033148', + totalBorrow: '2191695.514938', }, { token: { @@ -3758,14 +3933,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Ethereum', logoUri: 'https://cdn.furucombo.app/assets/img/token/ETH.png', }, - price: '3451.49', - balance: '0.000018509997033913', - apy: '0.01973080789867870929', + price: '3490.68309921', + balance: '0.000018538835853173', + apy: '0.02323368294003780377', lstApy: '0', - grossApy: '0.01973080789867870929', + grossApy: '0.02323368294003780377', borrowMin: '0', - borrowCap: '197368', - totalBorrow: '177372.806742807478135608', + borrowCap: '219288', + totalBorrow: '198674.538161914337593624', }, { token: { @@ -3776,14 +3951,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped liquid staked Ether 2.0', logoUri: 'https://cdn.furucombo.app/assets/img/token/wstETH.png', }, - price: '4041.81953479', + price: '4096.60756363', balance: '0', - apy: '0.00251230443257663699', - lstApy: '0.0302', - grossApy: '-0.02768769556742336301', + apy: '0.00253798344877928981', + lstApy: '0.0305', + grossApy: '-0.02796201655122071019', borrowMin: '0', - borrowCap: '151', - totalBorrow: '51.570747758796770331', + borrowCap: '296', + totalBorrow: '196.228708919009674041', }, { token: { @@ -3794,14 +3969,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped BTC', logoUri: 'https://cdn.furucombo.app/assets/img/token/WBTC.svg', }, - price: '61766.29750948', + price: '67214.30913055', balance: '0.000002', - apy: '0.00209992770754810104', + apy: '0.00220049053243771844', lstApy: '0', - grossApy: '0.00209992770754810104', + grossApy: '0.00220049053243771844', borrowMin: '0', - borrowCap: '432', - totalBorrow: '362.87406652', + borrowCap: '462', + totalBorrow: '362.67032039', }, { token: { @@ -3812,14 +3987,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Rocket Pool ETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/rETH.svg', }, - price: '3830.01696', + price: '3881.07180386', balance: '0', - apy: '0.00252825642478424573', - lstApy: '0.0282', - grossApy: '-0.02567174357521575427', + apy: '0.00257192807298261536', + lstApy: '0.0269', + grossApy: '-0.02432807192701738464', borrowMin: '0', borrowCap: '106', - totalBorrow: '6.272319969180354516', + totalBorrow: '17.274876705167749567', }, { token: { @@ -3832,12 +4007,12 @@ describe('Test Adapter for getPortfolios', function () { }, price: '1', balance: '0', - apy: '0.07134980187290462286', + apy: '0.07768876436500163347', lstApy: '0', - grossApy: '0.07134980187290462286', + grossApy: '0.07768876436500163347', borrowMin: '0', borrowCap: '3151044', - totalBorrow: '218539.458283', + totalBorrow: '227426.714532', }, { token: { @@ -3848,7 +4023,7 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped eETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/weETH.webp', }, - price: '3595.25941308', + price: '3643.00043268', balance: '0', apy: '0.051271096334354555', lstApy: '0', @@ -3864,17 +4039,17 @@ describe('Test Adapter for getPortfolios', function () { { chainId: common.ChainId.arbitrum, account: '0xa3C1C91403F0026b9dd086882aDbC8Cdbc3b3cfB', - blockTag: 225938342, + blockTag: 235819842, expected: [ { chainId: 42161, protocolId: 'aave-v3', marketId: 'arbitrum', - utilization: '0.86460826873491824906', - healthRate: '1.22076254577961664801', - netAPY: '-0.10779600690179828206', - totalSupplyUSD: '35.13857796844910483102523433', - totalBorrowUSD: '23.45277197055912', + utilization: '0.49963943635725263678', + healthRate: '2.23471293622659343103', + netAPY: '0.03332756098734001463', + totalSupplyUSD: '9.55143354266105330962486897', + totalBorrowUSD: '3.372401589364073773704', supplies: [ { token: { @@ -3885,17 +4060,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Dai Stablecoin', logoUri: 'https://cdn.furucombo.app/assets/img/token/DAI.png', }, - price: '1.00002037', - balance: '0.000000026410341155', - apy: '0.1048193519817800536', + price: '0.99976549', + balance: '0.000000026533285982', + apy: '0.04012534505824772525', lstApy: '0', - grossApy: '0.1048193519817800536', + grossApy: '0.04012534505824772525', usageAsCollateralEnabled: true, ltv: '0.63', liquidationThreshold: '0.77', isNotCollateral: false, supplyCap: '50000000', - totalSupply: '11370857.379689585496066377', + totalSupply: '11438965.417159974517009195', }, { token: { @@ -3906,17 +4081,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'ChainLink Token', logoUri: 'https://cdn.furucombo.app/assets/img/token/LINK.svg', }, - price: '13.99148108', - balance: '0.000000000514361881', - apy: '0.0000844876359263368', + price: '13.09252', + balance: '0.000000000514380499', + apy: '0.00022793155693860068', lstApy: '0', - grossApy: '0.0000844876359263368', + grossApy: '0.00022793155693860068', usageAsCollateralEnabled: true, ltv: '0.7', liquidationThreshold: '0.775', isNotCollateral: false, supplyCap: '2000000', - totalSupply: '1841789.397307090051237921', + totalSupply: '1942256.511194683610524263', }, { token: { @@ -3927,17 +4102,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Bridged USDC', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99998806', - balance: '9.475362', - apy: '0.05724118799367306359', + price: '0.99995568', + balance: '0.600831', + apy: '0.03617498639698954338', lstApy: '0', - grossApy: '0.05724118799367306359', + grossApy: '0.03617498639698954338', usageAsCollateralEnabled: true, ltv: '0.75', liquidationThreshold: '0.78', isNotCollateral: false, supplyCap: '26000000', - totalSupply: '11952507.916661', + totalSupply: '12143681.52535', }, { token: { @@ -3948,17 +4123,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped BTC', logoUri: 'https://cdn.furucombo.app/assets/img/token/WBTC.svg', }, - price: '61732.12986437', + price: '64290.35555', balance: '0', - apy: '0.00033195570386706497', + apy: '0.00039754093341991598', lstApy: '0', - grossApy: '0.00033195570386706497', + grossApy: '0.00039754093341991598', usageAsCollateralEnabled: true, ltv: '0.73', liquidationThreshold: '0.78', isNotCollateral: false, supplyCap: '5000', - totalSupply: '3533.87592208', + totalSupply: '4140.08846129', }, { token: { @@ -3969,17 +4144,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Ethereum', logoUri: 'https://cdn.furucombo.app/assets/img/token/ETH.png', }, - price: '3384.96225424', - balance: '0.004896811102462467', - apy: '0.02303019304449011298', + price: '3177.2046', + balance: '0.000125860039725966', + apy: '0.01754315799921411884', lstApy: '0', - grossApy: '0.02303019304449011298', + grossApy: '0.01754315799921411884', usageAsCollateralEnabled: true, ltv: '0.825', liquidationThreshold: '0.85', isNotCollateral: false, - supplyCap: '120000', - totalSupply: '86718.1069881000999072', + supplyCap: '140000', + totalSupply: '113048.0640114725937562', }, { token: { @@ -3990,17 +4165,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Tether USD', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDT.svg', }, - price: '0.99971', + price: '1.00009', balance: '0', - apy: '0.06430830994035542017', + apy: '0.05113771304891735918', lstApy: '0', - grossApy: '0.06430830994035542017', + grossApy: '0.05113771304891735918', usageAsCollateralEnabled: true, ltv: '0.75', liquidationThreshold: '0.78', isNotCollateral: false, supplyCap: '130000000', - totalSupply: '77992486.28935', + totalSupply: '87958795.516384', }, { token: { @@ -4011,7 +4186,7 @@ describe('Test Adapter for getPortfolios', function () { name: 'Aave Token', logoUri: 'https://cdn.furucombo.app/assets/img/token/AAVE.svg', }, - price: '90.98532567', + price: '88.44612705', balance: '0', apy: '0', lstApy: '0', @@ -4021,7 +4196,7 @@ describe('Test Adapter for getPortfolios', function () { liquidationThreshold: '0.65', isNotCollateral: false, supplyCap: '3600', - totalSupply: '3599.952287046258630651', + totalSupply: '3599.989042037207118569', }, { token: { @@ -4032,17 +4207,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped liquid staked Ether 2.0', logoUri: 'https://cdn.furucombo.app/assets/img/token/wstETH.png', }, - price: '3963.26787217', - balance: '0.002146723167734465', - apy: '0.00092363233542968973', - lstApy: '0.0302', - grossApy: '0.03112363233542968973', + price: '3729.01577621', + balance: '0.002146786864064844', + apy: '0.00023474455881727014', + lstApy: '0.0306', + grossApy: '0.03083474455881727014', usageAsCollateralEnabled: true, ltv: '0.7', liquidationThreshold: '0.79', isNotCollateral: false, supplyCap: '69000', - totalSupply: '40541.156620109496865076', + totalSupply: '45483.023370933226122566', }, { token: { @@ -4053,17 +4228,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Rocket Pool ETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/rETH.svg', }, - price: '3755.91653261', - balance: '0.000154345168494249', - apy: '0.00011161950354039784', - lstApy: '0.0282', - grossApy: '0.02831161950354039784', + price: '3532.78208265', + balance: '0.000154349406660127', + apy: '0.00037884810119333747', + lstApy: '0.027', + grossApy: '0.02737884810119333747', usageAsCollateralEnabled: true, ltv: '0.67', liquidationThreshold: '0.74', isNotCollateral: false, supplyCap: '5100', - totalSupply: '3063.436838674502064906', + totalSupply: '3051.523224865910239645', }, { token: { @@ -4074,17 +4249,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'LUSD Stablecoin', logoUri: 'https://cdn.furucombo.app/assets/img/token/LUSD.png', }, - price: '0.99745095', + price: '0.9982309', balance: '0', - apy: '0.05732047203021297488', + apy: '0.03383477559775403362', lstApy: '0', - grossApy: '0.05732047203021297488', + grossApy: '0.03383477559775403362', usageAsCollateralEnabled: false, ltv: '0', liquidationThreshold: '0', isNotCollateral: false, supplyCap: '2200000', - totalSupply: '822800.350020310947467229', + totalSupply: '795014.580434314423662038', }, { token: { @@ -4095,17 +4270,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'USD Coin', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99998806', + price: '0.99995568', balance: '0.000057', - apy: '0.05048993827301005404', + apy: '0.06864879355668456266', lstApy: '0', - grossApy: '0.05048993827301005404', + grossApy: '0.06864879355668456266', usageAsCollateralEnabled: true, ltv: '0.75', liquidationThreshold: '0.78', isNotCollateral: false, supplyCap: '350000000', - totalSupply: '213048547.324101', + totalSupply: '253128802.46903', }, { token: { @@ -4116,17 +4291,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Frax', logoUri: 'https://cdn.furucombo.app/assets/img/token/FRAX.png', }, - price: '0.99765734', + price: '0.99693153', balance: '0', - apy: '0.06110256279233765502', + apy: '0.03881105764570219938', lstApy: '0', - grossApy: '0.06110256279233765502', + grossApy: '0.03881105764570219938', usageAsCollateralEnabled: false, ltv: '0', liquidationThreshold: '0.72', isNotCollateral: false, supplyCap: '7000000', - totalSupply: '316508.26973681255928866', + totalSupply: '295883.880049180848421175', }, { token: { @@ -4137,17 +4312,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Arbitrum', logoUri: 'https://cdn.furucombo.app/assets/img/token/ARB.svg', }, - price: '0.82111354', - balance: '0.000005836177720612', - apy: '0.00662766994962598996', + price: '0.70901', + balance: '0.000005840548567037', + apy: '0.00785424825223076674', lstApy: '0', - grossApy: '0.00662766994962598996', + grossApy: '0.00785424825223076674', usageAsCollateralEnabled: false, ltv: '0.58', liquidationThreshold: '0.63', isNotCollateral: false, supplyCap: '40000000', - totalSupply: '23511023.36379472482707925', + totalSupply: '29429282.77968527409226434', }, { token: { @@ -4158,17 +4333,38 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped eETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/weETH.webp', }, - price: '3525.26562945', + price: '3315.95952588', balance: '0', - apy: '0.00438096696343510709', + apy: '0.00156453345951940332', lstApy: '0', - grossApy: '0.00438096696343510709', + grossApy: '0.00156453345951940332', usageAsCollateralEnabled: true, ltv: '0.725', liquidationThreshold: '0.75', isNotCollateral: false, - supplyCap: '72000', - totalSupply: '71998.09435427162088603', + supplyCap: '75000', + totalSupply: '74999.115529458934169778', + }, + { + token: { + chainId: 42161, + address: '0x7dfF72693f6A4149b17e7C6314655f6A9F7c8B33', + decimals: 18, + symbol: 'GHO', + name: 'Gho Token', + logoUri: 'https://tokens-data.1inch.io/images/42161/0x7dff72693f6a4149b17e7c6314655f6a9f7c8b33.png', + }, + price: '1', + balance: '0', + apy: '0.07875265140421988954', + lstApy: '0', + grossApy: '0.07875265140421988954', + usageAsCollateralEnabled: false, + ltv: '0', + liquidationThreshold: '0', + isNotCollateral: false, + supplyCap: '1000000', + totalSupply: '389252.902156935272178615', }, ], borrows: [ @@ -4181,14 +4377,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Dai Stablecoin', logoUri: 'https://cdn.furucombo.app/assets/img/token/DAI.png', }, - price: '1.00002037', + price: '0.99976549', balance: '0', - apy: '0.16382519034552620704', + apy: '0.06368430107390942238', lstApy: '0', - grossApy: '0.16382519034552620704', + grossApy: '0.06368430107390942238', borrowMin: '0', borrowCap: '30000000', - totalBorrow: '9753390.026513581929417742', + totalBorrow: '9203038.857867585648640096', }, { token: { @@ -4199,14 +4395,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'ChainLink Token', logoUri: 'https://cdn.furucombo.app/assets/img/token/LINK.svg', }, - price: '13.99148108', + price: '13.09252', balance: '0', - apy: '0.00406130483608116337', + apy: '0.00667915609420244836', lstApy: '0', - grossApy: '0.00406130483608116337', + grossApy: '0.00667915609420244836', borrowMin: '0', borrowCap: '484490', - totalBorrow: '47988.786627644546065926', + totalBorrow: '83118.286718081092239987', }, { token: { @@ -4217,14 +4413,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Bridged USDC', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99998806', - balance: '23.453052', - apy: '0.10510534193344051105', + price: '0.99995568', + balance: '0', + apy: '0.06295112634411371679', lstApy: '0', - grossApy: '0.10510534193344051105', + grossApy: '0.06295112634411371679', borrowMin: '0', borrowCap: '24000000', - totalBorrow: '5826689.055954', + totalBorrow: '5338168.523557', }, { token: { @@ -4235,14 +4431,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped BTC', logoUri: 'https://cdn.furucombo.app/assets/img/token/WBTC.svg', }, - price: '61732.12986437', + price: '64290.35555', balance: '0', - apy: '0.00609118957991761956', + apy: '0.00666761267963204775', lstApy: '0', - grossApy: '0.00609118957991761956', + grossApy: '0.00666761267963204775', borrowMin: '0', borrowCap: '1115', - totalBorrow: '241.42755116', + totalBorrow: '309.52023567', }, { token: { @@ -4253,14 +4449,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Ethereum', logoUri: 'https://cdn.furucombo.app/assets/img/token/ETH.png', }, - price: '3384.96225424', - balance: '0', - apy: '0.03019904142191733778', + price: '3177.2046', + balance: '0.00106143670740124', + apy: '0.02508447645193995215', lstApy: '0', - grossApy: '0.03019904142191733778', + grossApy: '0.02508447645193995215', borrowMin: '0', - borrowCap: '90000', - totalBorrow: '78078.249274416580644939', + borrowCap: '100000', + totalBorrow: '93361.582827128150897978', }, { token: { @@ -4271,14 +4467,32 @@ describe('Test Adapter for getPortfolios', function () { name: 'Tether USD', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDT.svg', }, - price: '0.99971', + price: '1.00009', balance: '0', - apy: '0.08728677210403895798', + apy: '0.0654205251123002632', lstApy: '0', - grossApy: '0.08728677210403895798', + grossApy: '0.0654205251123002632', borrowMin: '0', borrowCap: '120000000', - totalBorrow: '63088050.600575', + totalBorrow: '75028283.234909', + }, + { + token: { + chainId: 42161, + address: '0xba5DdD1f9d7F570dc94a51479a000E3BCE967196', + decimals: 18, + symbol: 'AAVE', + name: 'Aave Token', + logoUri: 'https://cdn.furucombo.app/assets/img/token/AAVE.svg', + }, + price: '88.44612705', + balance: '0', + apy: '0', + lstApy: '0', + grossApy: '0', + borrowMin: '0', + borrowCap: '0', + totalBorrow: '0', }, { token: { @@ -4289,14 +4503,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped liquid staked Ether 2.0', logoUri: 'https://cdn.furucombo.app/assets/img/token/wstETH.png', }, - price: '3963.26787217', + price: '3729.01577621', balance: '0', - apy: '0.01181568703104789871', - lstApy: '0.0302', - grossApy: '-0.01838431296895210129', + apy: '0.00667367628994062584', + lstApy: '0.0306', + grossApy: '-0.02392632371005937416', borrowMin: '0', borrowCap: '4800', - totalBorrow: '3748.613140602384654209', + totalBorrow: '1888.231337504282523508', }, { token: { @@ -4307,14 +4521,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Rocket Pool ETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/rETH.svg', }, - price: '3755.91653261', + price: '3532.78208265', balance: '0', - apy: '0.00452973706587820802', - lstApy: '0.0282', - grossApy: '-0.02367026293412179198', + apy: '0.00836053183508342068', + lstApy: '0.027', + grossApy: '-0.01863946816491657932', borrowMin: '0', borrowCap: '1360', - totalBorrow: '89.005181820188027174', + totalBorrow: '163.326656621200891758', }, { token: { @@ -4325,14 +4539,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'LUSD Stablecoin', logoUri: 'https://cdn.furucombo.app/assets/img/token/LUSD.png', }, - price: '0.99745095', + price: '0.9982309', balance: '0', - apy: '0.0925705734609277518', + apy: '0.05985634492292409917', lstApy: '0', - grossApy: '0.0925705734609277518', + grossApy: '0.05985634492292409917', borrowMin: '0', borrowCap: '1800000', - totalBorrow: '647587.46228952306356455', + totalBorrow: '568885.55555004396433036', }, { token: { @@ -4343,14 +4557,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'USD Coin', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99998806', + price: '0.99995568', balance: '0', - apy: '0.07678470317359041984', + apy: '0.08968731023568227681', lstApy: '0', - grossApy: '0.07678470317359041984', + grossApy: '0.08968731023568227681', borrowMin: '0', borrowCap: '320000000', - totalBorrow: '157618653.049676', + totalBorrow: '217429754.23812', }, { token: { @@ -4361,14 +4575,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Frax', logoUri: 'https://cdn.furucombo.app/assets/img/token/FRAX.png', }, - price: '0.99765734', + price: '0.99693153', balance: '0', - apy: '0.0899175620839348554', + apy: '0.06038297192906170988', lstApy: '0', - grossApy: '0.0899175620839348554', + grossApy: '0.06038297192906170988', borrowMin: '0', borrowCap: '5500000', - totalBorrow: '272591.678204637684571322', + totalBorrow: '240226.733601313441417869', }, { token: { @@ -4379,14 +4593,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Arbitrum', logoUri: 'https://cdn.furucombo.app/assets/img/token/ARB.svg', }, - price: '0.82111354', + price: '0.70901', balance: '0', - apy: '0.03648936135440627482', + apy: '0.03977379737529023765', lstApy: '0', - grossApy: '0.03648936135440627482', + grossApy: '0.03977379737529023765', borrowMin: '0', borrowCap: '16500000', - totalBorrow: '5416913.049906103667002423', + totalBorrow: '7379084.515319675799656435', }, { token: { @@ -4397,14 +4611,32 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped eETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/weETH.webp', }, - price: '3525.26562945', + price: '3315.95952588', balance: '0', - apy: '0.04067524971027595775', + apy: '0.02412925973126062897', lstApy: '0', - grossApy: '0.04067524971027595775', + grossApy: '0.02412925973126062897', borrowMin: '0', borrowCap: '25000', - totalBorrow: '14353.116706060593915647', + totalBorrow: '8941.047210502080080796', + }, + { + token: { + chainId: 42161, + address: '0x7dfF72693f6A4149b17e7C6314655f6A9F7c8B33', + decimals: 18, + symbol: 'GHO', + name: 'Gho Token', + logoUri: 'https://tokens-data.1inch.io/images/42161/0x7dff72693f6a4149b17e7c6314655f6a9f7c8b33.png', + }, + price: '1', + balance: '0', + apy: '0.1117926761753605887', + lstApy: '0', + grossApy: '0.1117926761753605887', + borrowMin: '0', + borrowCap: '900000', + totalBorrow: '309408.289933012170408918', }, ], }, @@ -4415,7 +4647,7 @@ describe('Test Adapter for getPortfolios', function () { utilization: '0', healthRate: 'Infinity', netAPY: '0', - totalSupplyUSD: '24.5933119371344', + totalSupplyUSD: '22.6987331860513922861836', totalBorrowUSD: '0', supplies: [ { @@ -4427,17 +4659,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Bridged USDC', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99998806', + price: '0.99995568', balance: '0', - apy: '0.060257638460016', + apy: '0.15045877334808', lstApy: '0', - grossApy: '0.060257638460016', + grossApy: '0.15045877334808', usageAsCollateralEnabled: false, ltv: '0', liquidationThreshold: '0', isNotCollateral: true, supplyCap: '0', - totalSupply: '1986981.311193', + totalSupply: '1885053.008853', }, { token: { @@ -4447,8 +4679,8 @@ describe('Test Adapter for getPortfolios', function () { symbol: 'ARB', name: 'Arbitrum', }, - price: '0.82111354', - balance: '6', + price: '0.70901', + balance: '5', apy: '0', lstApy: '0', grossApy: '0', @@ -4457,7 +4689,7 @@ describe('Test Adapter for getPortfolios', function () { liquidationThreshold: '0.6', isNotCollateral: false, supplyCap: '4000000', - totalSupply: '415285.702338874210142019', + totalSupply: '411817.00784623991211714', }, { token: { @@ -4467,7 +4699,7 @@ describe('Test Adapter for getPortfolios', function () { symbol: 'GMX', name: 'GMX', }, - price: '28.4089', + price: '28.8575', balance: '0', apy: '0', lstApy: '0', @@ -4477,7 +4709,7 @@ describe('Test Adapter for getPortfolios', function () { liquidationThreshold: '0.45', isNotCollateral: false, supplyCap: '50000', - totalSupply: '223.573965582075042015', + totalSupply: '156.151739281250844873', }, { token: { @@ -4488,8 +4720,8 @@ describe('Test Adapter for getPortfolios', function () { name: 'Ethereum', logoUri: 'https://cdn.furucombo.app/assets/img/token/ETH.png', }, - price: '3384.96225424', - balance: '0.00581', + price: '3177.2046', + balance: '0.006028470179745866', apy: '0', lstApy: '0', grossApy: '0', @@ -4498,7 +4730,7 @@ describe('Test Adapter for getPortfolios', function () { liquidationThreshold: '0.85', isNotCollateral: false, supplyCap: '5000', - totalSupply: '762.754710370852497112', + totalSupply: '715.713871155597087481', }, { token: { @@ -4508,7 +4740,7 @@ describe('Test Adapter for getPortfolios', function () { symbol: 'WBTC', name: 'Wrapped BTC', }, - price: '61863.46', + price: '64237.811', balance: '0', apy: '0', lstApy: '0', @@ -4518,7 +4750,7 @@ describe('Test Adapter for getPortfolios', function () { liquidationThreshold: '0.77', isNotCollateral: false, supplyCap: '300', - totalSupply: '15.72654811', + totalSupply: '19.44157368', }, ], borrows: [ @@ -4531,14 +4763,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Bridged USDC', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99998806', + price: '0.99995568', balance: '0', - apy: '0.08193984326136', + apy: '0.183416120010432', lstApy: '0', - grossApy: '0.08193984326136', + grossApy: '0.183416120010432', borrowMin: '100', borrowCap: '0', - totalBorrow: '1713103.777031', + totalBorrow: '1731492.738326', }, ], }, @@ -4548,8 +4780,8 @@ describe('Test Adapter for getPortfolios', function () { marketId: 'USDC', utilization: '0', healthRate: 'Infinity', - netAPY: '0.05603440621464', - totalSupplyUSD: '2.36748773185896', + netAPY: '0.02922601606704', + totalSupplyUSD: '2.37378178932816', totalBorrowUSD: '0', supplies: [ { @@ -4561,17 +4793,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'USD Coin', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99998806', - balance: '2.367516', - apy: '0.05603440621464', + price: '0.99995568', + balance: '2.373887', + apy: '0.02922601606704', lstApy: '0', - grossApy: '0.05603440621464', + grossApy: '0.02922601606704', usageAsCollateralEnabled: false, ltv: '0', liquidationThreshold: '0', isNotCollateral: true, supplyCap: '0', - totalSupply: '24927743.11827', + totalSupply: '47225671.6905', }, { token: { @@ -4581,7 +4813,7 @@ describe('Test Adapter for getPortfolios', function () { symbol: 'ARB', name: 'Arbitrum', }, - price: '0.82111354', + price: '0.70901', balance: '0', apy: '0', lstApy: '0', @@ -4591,7 +4823,7 @@ describe('Test Adapter for getPortfolios', function () { liquidationThreshold: '0.8', isNotCollateral: false, supplyCap: '16000000', - totalSupply: '5347212.634395535580301238', + totalSupply: '6247851.128864804500140637', }, { token: { @@ -4601,7 +4833,7 @@ describe('Test Adapter for getPortfolios', function () { symbol: 'GMX', name: 'GMX', }, - price: '28.4089', + price: '28.8575', balance: '0', apy: '0', lstApy: '0', @@ -4611,7 +4843,7 @@ describe('Test Adapter for getPortfolios', function () { liquidationThreshold: '0.75', isNotCollateral: false, supplyCap: '120000', - totalSupply: '9257.248222764089398175', + totalSupply: '10752.629545785130541795', }, { token: { @@ -4622,17 +4854,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Ethereum', logoUri: 'https://cdn.furucombo.app/assets/img/token/ETH.png', }, - price: '3384.96225424', + price: '3177.2046', balance: '0', apy: '0', lstApy: '0', grossApy: '0', usageAsCollateralEnabled: true, - ltv: '0.78', - liquidationThreshold: '0.85', + ltv: '0.83', + liquidationThreshold: '0.9', isNotCollateral: false, - supplyCap: '10000', - totalSupply: '4719.329710499165938966', + supplyCap: '40000', + totalSupply: '6083.452325642824260866', }, { token: { @@ -4642,7 +4874,7 @@ describe('Test Adapter for getPortfolios', function () { symbol: 'WBTC', name: 'Wrapped BTC', }, - price: '61863.46', + price: '64237.811', balance: '0', apy: '0', lstApy: '0', @@ -4651,8 +4883,28 @@ describe('Test Adapter for getPortfolios', function () { ltv: '0.75', liquidationThreshold: '0.85', isNotCollateral: false, - supplyCap: '1200', - totalSupply: '325.56422383', + supplyCap: '2000', + totalSupply: '299.43648745', + }, + { + token: { + chainId: 42161, + address: '0x5979D7b546E38E414F7E9822514be443A4800529', + decimals: 18, + symbol: 'wstETH', + name: 'Wrapped liquid staked Ether 2.0', + }, + price: '3727.91201508', + balance: '0', + apy: '0', + lstApy: '0.0306', + grossApy: '0.0306', + usageAsCollateralEnabled: true, + ltv: '0.8', + liquidationThreshold: '0.85', + isNotCollateral: false, + supplyCap: '1500', + totalSupply: '238.138232964701807742', }, ], borrows: [ @@ -4665,14 +4917,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'USD Coin', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99998806', + price: '0.99995568', balance: '0', - apy: '0.07723554718536', + apy: '0.043108848449712', lstApy: '0', - grossApy: '0.07723554718536', + grossApy: '0.043108848449712', borrowMin: '0.000001', borrowCap: '0', - totalBorrow: '18624157.166604', + totalBorrow: '22261587.590058', }, ], }, @@ -4680,11 +4932,11 @@ describe('Test Adapter for getPortfolios', function () { chainId: 42161, protocolId: 'radiant-v2', marketId: 'arbitrum', - utilization: '0.00073975463363628277', - healthRate: '1394.08236836002969228578', - netAPY: '0.02058242433276032824', - totalSupplyUSD: '10.91376741658213053577321169', - totalBorrowUSD: '0.00645880801067108356472353', + utilization: '1', + healthRate: '1.01478722435195334979', + netAPY: '-1.62689741362795500874', + totalSupplyUSD: '10.26231615741742566084060603', + totalBorrowUSD: '8.3432904439946149438665749', supplies: [ { token: { @@ -4695,17 +4947,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped BTC', logoUri: 'https://cdn.furucombo.app/assets/img/token/WBTC.svg', }, - price: '61863.46', + price: '64237.811', balance: '0', - apy: '0.00200207596620445723', + apy: '0.00395447549658605113', lstApy: '0', - grossApy: '0.00200207596620445723', + grossApy: '0.00395447549658605113', usageAsCollateralEnabled: true, ltv: '0.7', liquidationThreshold: '0.75', isNotCollateral: false, supplyCap: '0', - totalSupply: '491.94853285', + totalSupply: '328.61649755', }, { token: { @@ -4716,17 +4968,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Tether USD', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDT.svg', }, - price: '0.99971', - balance: '0.010093', - apy: '0.06303992924623975106', + price: '1.00009', + balance: '0.010148', + apy: '0.09410457037871845822', lstApy: '0', - grossApy: '0.06303992924623975106', + grossApy: '0.09410457037871845822', usageAsCollateralEnabled: true, ltv: '0.8', liquidationThreshold: '0.85', isNotCollateral: false, supplyCap: '0', - totalSupply: '2656322.071051', + totalSupply: '2079558.437149', }, { token: { @@ -4737,17 +4989,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Bridged USDC', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99998806', + price: '0.99995568', balance: '0', - apy: '0.06668477698481537789', + apy: '0.03535214749470396432', lstApy: '0', - grossApy: '0.06668477698481537789', + grossApy: '0.03535214749470396432', usageAsCollateralEnabled: true, ltv: '0.8', liquidationThreshold: '0.85', isNotCollateral: false, supplyCap: '0', - totalSupply: '2914251.653237', + totalSupply: '2448300.909529', }, { token: { @@ -4758,17 +5010,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Dai Stablecoin', logoUri: 'https://cdn.furucombo.app/assets/img/token/DAI.png', }, - price: '1.00002037', - balance: '0.000000002456921193', - apy: '0.03234223122476114289', + price: '0.99976549', + balance: '0.000000036453730972', + apy: '0.02393506279889186358', lstApy: '0', - grossApy: '0.03234223122476114289', + grossApy: '0.02393506279889186358', usageAsCollateralEnabled: true, ltv: '0.75', liquidationThreshold: '0.85', isNotCollateral: false, supplyCap: '0', - totalSupply: '182073.254588524367194442', + totalSupply: '165755.936361986733300423', }, { token: { @@ -4779,17 +5031,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Ethereum', logoUri: 'https://cdn.furucombo.app/assets/img/token/ETH.png', }, - price: '3384.96225424', - balance: '0.003221210901931327', - apy: '0.02059632059995460322', + price: '3177.2046', + balance: '0.003226788474605404', + apy: '0.01920026337390833634', lstApy: '0', - grossApy: '0.02059632059995460322', + grossApy: '0.01920026337390833634', usageAsCollateralEnabled: true, ltv: '0.8', liquidationThreshold: '0.825', isNotCollateral: false, supplyCap: '0', - totalSupply: '7688.141233869064421891', + totalSupply: '6654.817168780775054409', }, { token: { @@ -4800,17 +5052,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped liquid staked Ether 2.0', logoUri: 'https://cdn.furucombo.app/assets/img/token/wstETH.png', }, - price: '3961.29641444', - balance: '0.000000000003902962', - apy: '0.01049157518471723713', - lstApy: '0.0302', - grossApy: '0.04069157518471723713', + price: '3731.29755095', + balance: '0.000000000003905305', + apy: '0.00149006032558141576', + lstApy: '0.0306', + grossApy: '0.03209006032558141576', usageAsCollateralEnabled: true, ltv: '0.7', liquidationThreshold: '0.8', isNotCollateral: false, supplyCap: '0', - totalSupply: '5428.49966832582116481', + totalSupply: '2977.846116062268596531', }, { token: { @@ -4821,17 +5073,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Arbitrum', logoUri: 'https://cdn.furucombo.app/assets/img/token/ARB.svg', }, - price: '0.82111354', - balance: '0.000000011752871238', - apy: '0.00463887128329030386', + price: '0.70901', + balance: '0.000000011758812566', + apy: '0.00528537609439321331', lstApy: '0', - grossApy: '0.00463887128329030386', + grossApy: '0.00528537609439321331', usageAsCollateralEnabled: true, ltv: '0.58', liquidationThreshold: '0.63', isNotCollateral: false, supplyCap: '0', - totalSupply: '6969842.982607224900300445', + totalSupply: '5514777.226434621022885459', }, { token: { @@ -4842,17 +5094,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'USD Coin', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99998806', + price: '0.99995568', balance: '0', - apy: '0.08517321835346367441', + apy: '0.03094376740404250783', lstApy: '0', - grossApy: '0.08517321835346367441', + grossApy: '0.03094376740404250783', usageAsCollateralEnabled: true, ltv: '0.8', liquidationThreshold: '0.85', isNotCollateral: false, supplyCap: '0', - totalSupply: '7314024.876297', + totalSupply: '11740807.464723', }, { token: { @@ -4863,17 +5115,17 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped eETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/weETH.webp', }, - price: '3525.26562945', + price: '3315.95952588', balance: '0', - apy: '0.00518650470159687159', + apy: '0.00681468329486553021', lstApy: '0', - grossApy: '0.00518650470159687159', + grossApy: '0.00681468329486553021', usageAsCollateralEnabled: true, ltv: '0.725', liquidationThreshold: '0.75', isNotCollateral: false, supplyCap: '0', - totalSupply: '3621.634066691504318048', + totalSupply: '6709.654775598853974112', }, { token: { @@ -4883,7 +5135,7 @@ describe('Test Adapter for getPortfolios', function () { symbol: 'GM', name: 'GMX Market', }, - price: '1.6661477', + price: '1.70903811', balance: '0', apy: '0', lstApy: '0', @@ -4893,7 +5145,7 @@ describe('Test Adapter for getPortfolios', function () { liquidationThreshold: '0.6', isNotCollateral: false, supplyCap: '0', - totalSupply: '233864.54735828849152487', + totalSupply: '2945749.337494489624878515', }, { token: { @@ -4903,7 +5155,7 @@ describe('Test Adapter for getPortfolios', function () { symbol: 'GM', name: 'GMX Market', }, - price: '1.59545219', + price: '1.56561235', balance: '0', apy: '0', lstApy: '0', @@ -4913,7 +5165,7 @@ describe('Test Adapter for getPortfolios', function () { liquidationThreshold: '0.65', isNotCollateral: false, supplyCap: '0', - totalSupply: '180537.998759709513760018', + totalSupply: '3389965.234024699961114892', }, ], borrows: [ @@ -4926,14 +5178,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped BTC', logoUri: 'https://cdn.furucombo.app/assets/img/token/WBTC.svg', }, - price: '61863.46', + price: '64237.811', balance: '0', - apy: '0.03438474394049939974', + apy: '0.04863509599259547626', lstApy: '0', - grossApy: '0.03438474394049939974', + grossApy: '0.04863509599259547626', borrowMin: '0', borrowCap: '0', - totalBorrow: '116.41851084', + totalBorrow: '109.24078889', }, { token: { @@ -4944,14 +5196,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Tether USD', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDT.svg', }, - price: '0.99971', - balance: '0', - apy: '0.3237984172671257958', + price: '1.00009', + balance: '6.047161', + apy: '0.4966219340295818432', lstApy: '0', - grossApy: '0.3237984172671257958', + grossApy: '0.4966219340295818432', borrowMin: '0', borrowCap: '0', - totalBorrow: '2315655.024966', + totalBorrow: '1855390.840617', }, { token: { @@ -4962,14 +5214,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Bridged USDC', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99998806', + price: '0.99995568', balance: '0', - apy: '0.34362511531328572235', + apy: '0.1771213752251185239', lstApy: '0', - grossApy: '0.34362511531328572235', + grossApy: '0.1771213752251185239', borrowMin: '0', borrowCap: '0', - totalBorrow: '2547729.76581', + totalBorrow: '2086399.630747', }, { token: { @@ -4980,14 +5232,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Dai Stablecoin', logoUri: 'https://cdn.furucombo.app/assets/img/token/DAI.png', }, - price: '1.00002037', - balance: '0.000369317960441469', - apy: '0.16171182089217879424', + price: '0.99976549', + balance: '2.29035840472474801', + apy: '0.13793385649642653652', lstApy: '0', - grossApy: '0.16171182089217879424', + grossApy: '0.13793385649642653652', borrowMin: '0', borrowCap: '0', - totalBorrow: '154657.281001431504565705', + totalBorrow: '121371.268408814080438946', }, { token: { @@ -4998,14 +5250,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Ethereum', logoUri: 'https://cdn.furucombo.app/assets/img/token/ETH.png', }, - price: '3384.96225424', - balance: '0.000001798980925', - apy: '0.10725600285008285094', + price: '3177.2046', + balance: '0.000001814144021244', + apy: '0.10242773407603527478', lstApy: '0', - grossApy: '0.10725600285008285094', + grossApy: '0.10242773407603527478', borrowMin: '0', borrowCap: '0', - totalBorrow: '6153.564401912867706236', + totalBorrow: '5191.545607339053606604', }, { token: { @@ -5016,14 +5268,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped liquid staked Ether 2.0', logoUri: 'https://cdn.furucombo.app/assets/img/token/wstETH.png', }, - price: '3961.29641444', + price: '3731.29755095', balance: '0', - apy: '0.11841448020146962609', - lstApy: '0.0302', - grossApy: '0.08821448020146962609', + apy: '0.0431759581296426725', + lstApy: '0.0306', + grossApy: '0.0125759581296426725', borrowMin: '0', borrowCap: '0', - totalBorrow: '2025.04863690423448906', + totalBorrow: '419.577587451804848387', }, { token: { @@ -5034,14 +5286,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Arbitrum', logoUri: 'https://cdn.furucombo.app/assets/img/token/ARB.svg', }, - price: '0.82111354', + price: '0.70901', balance: '0', - apy: '0.07737081894398319079', + apy: '0.08278299871298506299', lstApy: '0', - grossApy: '0.07737081894398319079', + grossApy: '0.08278299871298506299', borrowMin: '0', borrowCap: '0', - totalBorrow: '1731393.788110828383764039', + totalBorrow: '1462051.70777755786020975', }, { token: { @@ -5052,14 +5304,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'USD Coin', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99998806', + price: '0.99995568', balance: '0', - apy: '0.26668774258847495931', + apy: '0.12294118210057403193', lstApy: '0', - grossApy: '0.26668774258847495931', + grossApy: '0.12294118210057403193', borrowMin: '0', borrowCap: '0', - totalBorrow: '6322254.080533', + totalBorrow: '7714391.961475', }, { token: { @@ -5070,14 +5322,14 @@ describe('Test Adapter for getPortfolios', function () { name: 'Wrapped eETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/weETH.webp', }, - price: '3525.26562945', + price: '3315.95952588', balance: '0', - apy: '0.05529800661387205653', + apy: '0.06361206547847022913', lstApy: '0', - grossApy: '0.05529800661387205653', + grossApy: '0.06361206547847022913', borrowMin: '0', borrowCap: '0', - totalBorrow: '1392.342926801981015817', + totalBorrow: '2955.645427259522805249', }, { token: { @@ -5087,7 +5339,7 @@ describe('Test Adapter for getPortfolios', function () { symbol: 'GM', name: 'GMX Market', }, - price: '1.6661477', + price: '1.70903811', balance: '0', apy: '0', lstApy: '0', @@ -5104,7 +5356,7 @@ describe('Test Adapter for getPortfolios', function () { symbol: 'GM', name: 'GMX Market', }, - price: '1.59545219', + price: '1.56561235', balance: '0', apy: '0', lstApy: '0', @@ -5120,7 +5372,7 @@ describe('Test Adapter for getPortfolios', function () { { chainId: common.ChainId.bnb, account: '0xa3C1C91403F0026b9dd086882aDbC8Cdbc3b3cfB', - blockTag: 39300000, + blockTag: 40750000, expected: [ { chainId: 56, @@ -5128,8 +5380,8 @@ describe('Test Adapter for getPortfolios', function () { marketId: 'bnb', utilization: '0', healthRate: 'Infinity', - netAPY: '0.05166487110410466021', - totalSupplyUSD: '0.05012018578520433888463008', + netAPY: '0.02693578339059458303', + totalSupplyUSD: '1.6839427747935011981086', totalBorrowUSD: '0', supplies: [ { @@ -5139,18 +5391,19 @@ describe('Test Adapter for getPortfolios', function () { decimals: 18, symbol: 'BTCB', name: 'BTCB Token', + logoUri: 'https://cdn.furucombo.app/assets/img/token/WBTC.svg', }, - price: '69078.69980244', - balance: '0', - apy: '0.0061266969169722461', + price: '66423.8747', + balance: '0.000000000000078232', + apy: '0.00743715701231068815', lstApy: '0', - grossApy: '0.0061266969169722461', + grossApy: '0.00743715701231068815', usageAsCollateralEnabled: true, ltv: '0.7', liquidationThreshold: '0.75', isNotCollateral: false, supplyCap: '0', - totalSupply: '589.836182433483057245', + totalSupply: '314.713276593408263741', }, { token: { @@ -5159,18 +5412,19 @@ describe('Test Adapter for getPortfolios', function () { decimals: 18, symbol: 'USDT', name: 'Tether USD', + logoUri: 'https://cdn.furucombo.app/assets/img/token/USDT.svg', }, - price: '0.99981072', - balance: '0.050129674329961514', - apy: '0.05166487110410466021', + price: '1.00009', + balance: '1.683791228386473167', + apy: '0.02693578345076532001', lstApy: '0', - grossApy: '0.05166487110410466021', + grossApy: '0.02693578345076532001', usageAsCollateralEnabled: true, ltv: '0.8', liquidationThreshold: '0.85', isNotCollateral: false, supplyCap: '0', - totalSupply: '8507564.891224534652685351', + totalSupply: '5281559.447581482359161025', }, { token: { @@ -5178,19 +5432,20 @@ describe('Test Adapter for getPortfolios', function () { address: '0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d', decimals: 18, symbol: 'USDC', - name: 'USD Coin', + name: 'Binance-Peg USD Coin', + logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99997907', - balance: '0', - apy: '0.02569501839667193888', + price: '0.99999', + balance: '0.000000000000000683', + apy: '0.0262962471792050187', lstApy: '0', - grossApy: '0.02569501839667193888', + grossApy: '0.0262962471792050187', usageAsCollateralEnabled: true, ltv: '0.8', liquidationThreshold: '0.85', isNotCollateral: false, supplyCap: '0', - totalSupply: '851478.739633994086478545', + totalSupply: '611805.710651091785850711', }, { token: { @@ -5198,19 +5453,20 @@ describe('Test Adapter for getPortfolios', function () { address: '0x2170Ed0880ac9A755fd29B2688956BD959F933F8', decimals: 18, symbol: 'ETH', - name: 'Ethereum Token', + name: 'Binance-Peg Ethereum Token', + logoUri: 'https://cdn.furucombo.app/assets/img/token/ETH.png', }, - price: '3770.9', + price: '3461.01', balance: '0', - apy: '0.00931318825426101712', + apy: '0.00352224184639154924', lstApy: '0', - grossApy: '0.00931318825426101712', + grossApy: '0.00352224184639154924', usageAsCollateralEnabled: true, ltv: '0.8', liquidationThreshold: '0.825', isNotCollateral: false, supplyCap: '0', - totalSupply: '1004.365249923637475384', + totalSupply: '855.67953711314166328', }, { token: { @@ -5219,18 +5475,19 @@ describe('Test Adapter for getPortfolios', function () { decimals: 18, symbol: 'BNB', name: 'BNB', + logoUri: 'https://cdn.furucombo.app/assets/img/token/BNB.svg', }, - price: '623.49676668', + price: '588.18732', balance: '0', - apy: '0.01737602256556889028', + apy: '0.01068440988350536256', lstApy: '0', - grossApy: '0.01737602256556889028', + grossApy: '0.01068440988350536256', usageAsCollateralEnabled: true, ltv: '0.8', liquidationThreshold: '0.825', isNotCollateral: false, supplyCap: '0', - totalSupply: '38653.22129945165860747', + totalSupply: '36986.018906083101779589', }, { token: { @@ -5239,18 +5496,19 @@ describe('Test Adapter for getPortfolios', function () { decimals: 18, symbol: 'wBETH', name: 'Wrapped Binance Beacon ETH', + logoUri: 'https://cdn.furucombo.app/assets/img/token/wBETH.png', }, - price: '3924.83599005', + price: '3613.1197149', balance: '0', - apy: '0.00785931403127328269', + apy: '0.00574667576360947439', lstApy: '0', - grossApy: '0.00785931403127328269', + grossApy: '0.00574667576360947439', usageAsCollateralEnabled: true, ltv: '0.67', liquidationThreshold: '0.75', isNotCollateral: false, supplyCap: '0', - totalSupply: '1302.333363357060147361', + totalSupply: '347.372210704468812237', }, ], borrows: [ @@ -5261,15 +5519,16 @@ describe('Test Adapter for getPortfolios', function () { decimals: 18, symbol: 'BTCB', name: 'BTCB Token', + logoUri: 'https://cdn.furucombo.app/assets/img/token/WBTC.svg', }, - price: '69078.69980244', + price: '66423.8747', balance: '0', - apy: '0.06085868915916928179', + apy: '0.06723351317914074627', lstApy: '0', - grossApy: '0.06085868915916928179', + grossApy: '0.06723351317914074627', borrowMin: '0', borrowCap: '0', - totalBorrow: '243.928338974560661304', + totalBorrow: '143.348465059984868198', }, { token: { @@ -5278,15 +5537,16 @@ describe('Test Adapter for getPortfolios', function () { decimals: 18, symbol: 'USDT', name: 'Tether USD', + logoUri: 'https://cdn.furucombo.app/assets/img/token/USDT.svg', }, - price: '0.99981072', + price: '1.00009', balance: '0', - apy: '0.2780967345124873372', + apy: '0.15164317170302552927', lstApy: '0', - grossApy: '0.2780967345124873372', + grossApy: '0.15164317170302552927', borrowMin: '0', borrowCap: '0', - totalBorrow: '6986454.957727312732558337', + totalBorrow: '3977149.60370022582825684', }, { token: { @@ -5294,16 +5554,17 @@ describe('Test Adapter for getPortfolios', function () { address: '0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d', decimals: 18, symbol: 'USDC', - name: 'USD Coin', + name: 'Binance-Peg USD Coin', + logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99997907', + price: '0.99999', balance: '0', - apy: '0.14790831101108225022', + apy: '0.14972799375318408806', lstApy: '0', - grossApy: '0.14790831101108225022', + grossApy: '0.14972799375318408806', borrowMin: '0', borrowCap: '0', - totalBorrow: '626428.823827090708259023', + totalBorrow: '455281.343824141725086861', }, { token: { @@ -5311,16 +5572,17 @@ describe('Test Adapter for getPortfolios', function () { address: '0x2170Ed0880ac9A755fd29B2688956BD959F933F8', decimals: 18, symbol: 'ETH', - name: 'Ethereum Token', + name: 'Binance-Peg Ethereum Token', + logoUri: 'https://cdn.furucombo.app/assets/img/token/ETH.png', }, - price: '3770.9', + price: '3461.01', balance: '0', - apy: '0.07284491228624330433', + apy: '0.04425520372631329501', lstApy: '0', - grossApy: '0.07284491228624330433', + grossApy: '0.04425520372631329501', borrowMin: '0', borrowCap: '0', - totalBorrow: '529.665650374858519345', + totalBorrow: '277.90834040502096607', }, { token: { @@ -5329,15 +5591,16 @@ describe('Test Adapter for getPortfolios', function () { decimals: 18, symbol: 'BNB', name: 'BNB', + logoUri: 'https://cdn.furucombo.app/assets/img/token/BNB.svg', }, - price: '623.49676668', + price: '588.18732', balance: '0', - apy: '0.11481227748178513764', + apy: '0.08911711348089979253', lstApy: '0', - grossApy: '0.11481227748178513764', + grossApy: '0.08911711348089979253', borrowMin: '0', borrowCap: '0', - totalBorrow: '24506.301153382833878056', + totalBorrow: '18418.239773461628669793', }, { token: { @@ -5346,15 +5609,16 @@ describe('Test Adapter for getPortfolios', function () { decimals: 18, symbol: 'wBETH', name: 'Wrapped Binance Beacon ETH', + logoUri: 'https://cdn.furucombo.app/assets/img/token/wBETH.png', }, - price: '3924.83599005', + price: '3613.1197149', balance: '0', - apy: '0.10177690135733997444', + apy: '0.08645846241079914598', lstApy: '0', - grossApy: '0.10177690135733997444', + grossApy: '0.08645846241079914598', borrowMin: '0', borrowCap: '0', - totalBorrow: '420.769453295677513691', + totalBorrow: '96.022043455969143073', }, ], }, diff --git a/packages/lending/src/protocols/aave-v2/adapter.test.ts b/packages/lending/src/protocols/aave-v2/adapter.test.ts index c21febb..5549547 100644 --- a/packages/lending/src/protocols/aave-v2/adapter.test.ts +++ b/packages/lending/src/protocols/aave-v2/adapter.test.ts @@ -113,7 +113,7 @@ describe('Test Adapter for Aave V2', function () { context('Test openByDebt', function () { const account = '0xc94680947CF2114ec8eE43725898EAA7269a98c5'; - const blockTag = 19167450; + const blockTag = 20370000; let portfolio: Portfolio; @@ -167,10 +167,10 @@ describe('Test Adapter for Aave V2', function () { it('success', async function () { const zapToken = mainnetTokens.ETH; - const zapAmount = '1'; + const zapAmount = '0.5'; const collateralToken = mainnetTokens.USDC; const debtToken = mainnetTokens.ETH; - const debtAmount = '0.1'; + const debtAmount = '0.8'; const { destAmount, afterPortfolio, error, logics } = await adapter.openByDebt({ account, @@ -227,7 +227,7 @@ describe('Test Adapter for Aave V2', function () { }); it('success', async function () { - const account = '0x624698bb841f344a200fe6adb695e8ff695bcad7'; + const account = '0xa3C1C91403F0026b9dd086882aDbC8Cdbc3b3cfB'; portfolio = await protocol.getPortfolio(account); const withdrawalToken = mainnetTokens.USDC; @@ -243,16 +243,17 @@ describe('Test Adapter for Aave V2', function () { expect(afterPortfolio.totalBorrowUSD).to.be.eq(0); expect(afterPortfolio.totalSupplyUSD).to.be.eq(0); - expect(logics).has.length(7); + expect(logics).has.length(8); expect(logics[0].rid).to.eq('utility:flash-loan-aggregator'); expect(logics[1].rid).to.contain('swap-token'); expect(logics[2].rid).to.eq('aave-v2:repay'); expect(logics[2].fields.balanceBps).to.eq(common.BPS_BASE); - expect(logics[3].rid).to.eq('permit2:pull-token'); - expect(logics[4].rid).to.eq('aave-v2:withdraw'); - expect(logics[4].fields.balanceBps).to.eq(common.BPS_BASE); - expect(logics[5].rid).to.contain('swap-token'); - expect(logics[6].rid).to.eq('utility:flash-loan-aggregator'); + expect(logics[3].rid).to.eq('aave-v2:repay'); + expect(logics[4].rid).to.eq('permit2:pull-token'); + expect(logics[5].rid).to.eq('aave-v2:withdraw'); + expect(logics[5].fields.balanceBps).to.eq(common.BPS_BASE); + expect(logics[6].rid).to.contain('swap-token'); + expect(logics[7].rid).to.eq('utility:flash-loan-aggregator'); }); it('success - collateral positions only', async function () { @@ -759,7 +760,7 @@ describe('Test Adapter for Aave V2', function () { it('success - src token is not equal to dest token', async function () { const srcToken = mainnetTokens.USDC; - const srcAmount = '10000'; + const srcAmount = '1'; const destToken = mainnetTokens.stETH; const { destAmount, afterPortfolio, error, logics } = await adapter.deleverage({ diff --git a/packages/lending/src/protocols/aave-v2/configs.ts b/packages/lending/src/protocols/aave-v2/configs.ts index 14da621..e3e1595 100644 --- a/packages/lending/src/protocols/aave-v2/configs.ts +++ b/packages/lending/src/protocols/aave-v2/configs.ts @@ -4,10 +4,8 @@ import * as logics from '@protocolink/logics'; export const ID = 'aave-v2'; export const DISPLAY_NAME = 'Aave V2'; -export interface Reserve { - asset: common.Token; - aToken: common.Token; -} +export type ReserveTokens = logics.aavev2.ReserveTokens; +export type ReserveMap = Record; type ContractName = 'ProtocolDataProvider' | 'PriceOracle' | 'ETHPriceFeed'; @@ -52,23 +50,3 @@ export function getContractAddress(chainId: number, name: ContractName) { const { contractMap } = configs.find((configs) => configs.chainId === chainId)!; return contractMap[name]; } - -const supplyDisabledMap: Record = { - [common.ChainId.mainnet]: [], - [common.ChainId.polygon]: [], - [common.ChainId.avalanche]: [], -}; - -const borrowDisabledMap: Record = { - [common.ChainId.mainnet]: [common.mainnetTokens.stETH.address], - [common.ChainId.polygon]: [], - [common.ChainId.avalanche]: [], -}; - -export const isSupplyEnabled = (chainId: number, token: common.Token) => { - return !supplyDisabledMap[chainId].includes(token.address); -}; - -export const isBorrowEnabled = (chainId: number, token: common.Token) => { - return !borrowDisabledMap[chainId].includes(token.address); -}; diff --git a/packages/lending/src/protocols/aave-v2/lending-protocol.test.ts b/packages/lending/src/protocols/aave-v2/lending-protocol.test.ts index 42dcf7f..e804134 100644 --- a/packages/lending/src/protocols/aave-v2/lending-protocol.test.ts +++ b/packages/lending/src/protocols/aave-v2/lending-protocol.test.ts @@ -412,27 +412,10 @@ describe('Test Aave V2 LendingProtocol', function () { marketId: 'polygon', utilization: '0.3685856393576075793', healthRate: '2.92177166424606475501', + netAPY: '0.01824959837903616669', totalSupplyUSD: '6187.63383963095020048012547096', totalBorrowUSD: '181.29530249474694', supplies: [ - { - token: { - chainId: 137, - address: '0xD6DF932A45C0f255f85145f286eA0b292B21C90B', - decimals: 18, - symbol: 'AAVE', - name: 'Aave (PoS)', - }, - price: '105.25610147', - balance: '0', - apy: '0', - usageAsCollateralEnabled: true, - ltv: '0.5', - liquidationThreshold: '0.65', - isNotCollateral: false, - supplyCap: '0', - totalSupply: '22611.10243785446899109', - }, { token: { chainId: 137, @@ -440,10 +423,13 @@ describe('Test Aave V2 LendingProtocol', function () { decimals: 18, symbol: 'DAI', name: '(PoS) Dai Stablecoin', + logoUri: 'https://cdn.furucombo.app/assets/img/token/DAI.png', }, price: '0.99679794', balance: '0', apy: '0.12710541004444977537', + lstApy: '0', + grossApy: '0.12710541004444977537', usageAsCollateralEnabled: true, ltv: '0.75', liquidationThreshold: '0.8', @@ -451,24 +437,6 @@ describe('Test Aave V2 LendingProtocol', function () { supplyCap: '0', totalSupply: '10041889.244136207665022938', }, - { - token: { - chainId: 137, - address: '0x0000000000000000000000000000000000001010', - decimals: 18, - symbol: 'MATIC', - name: 'Matic Token', - }, - price: '0.85300841', - balance: '887.118163164367700056', - apy: '0.00015134820365801307', - usageAsCollateralEnabled: true, - ltv: '0.65', - liquidationThreshold: '0.7', - isNotCollateral: false, - supplyCap: '0', - totalSupply: '9730349.206340911556404886', - }, { token: { chainId: 137, @@ -476,10 +444,13 @@ describe('Test Aave V2 LendingProtocol', function () { decimals: 6, symbol: 'USDC.e', name: 'USD Coin (PoS)', + logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, price: '0.99664591', balance: '0', apy: '0.10613890696322769932', + lstApy: '0', + grossApy: '0.10613890696322769932', usageAsCollateralEnabled: true, ltv: '0.8', liquidationThreshold: '0.85', @@ -494,10 +465,13 @@ describe('Test Aave V2 LendingProtocol', function () { decimals: 6, symbol: 'USDT', name: '(PoS) Tether USD', + logoUri: 'https://cdn.furucombo.app/assets/img/token/USDT.svg', }, price: '1.00213471', balance: '5419.345854', apy: '0.02085841506259266721', + lstApy: '0', + grossApy: '0.02085841506259266721', usageAsCollateralEnabled: false, ltv: '0', liquidationThreshold: '0', @@ -512,10 +486,13 @@ describe('Test Aave V2 LendingProtocol', function () { decimals: 8, symbol: 'WBTC', name: '(PoS) Wrapped BTC', + logoUri: 'https://cdn.furucombo.app/assets/img/token/WBTC.svg', }, price: '42314.45587845', balance: '0', apy: '0.00000380199312269635', + lstApy: '0', + grossApy: '0.00000380199312269635', usageAsCollateralEnabled: true, ltv: '0.7', liquidationThreshold: '0.75', @@ -530,10 +507,13 @@ describe('Test Aave V2 LendingProtocol', function () { decimals: 18, symbol: 'WETH', name: 'Wrapped Ether', + logoUri: 'https://cdn.furucombo.app/assets/img/token/WETH.svg', }, price: '2247.22899356', balance: '0', apy: '0.00011636207541797941', + lstApy: '0', + grossApy: '0.00011636207541797941', usageAsCollateralEnabled: true, ltv: '0.8', liquidationThreshold: '0.825', @@ -541,6 +521,27 @@ describe('Test Aave V2 LendingProtocol', function () { supplyCap: '0', totalSupply: '24612.744802960406826559', }, + { + token: { + chainId: 137, + address: '0x0000000000000000000000000000000000000000', + decimals: 18, + symbol: 'MATIC', + name: 'Matic Token', + logoUri: 'https://cdn.furucombo.app/assets/img/token/MATIC.png', + }, + price: '0.85300841', + balance: '887.118163164367700056', + apy: '0.00015134820365801307', + lstApy: '0', + grossApy: '0.00015134820365801307', + usageAsCollateralEnabled: true, + ltv: '0.65', + liquidationThreshold: '0.7', + isNotCollateral: false, + supplyCap: '0', + totalSupply: '9730349.206340911556404886', + }, ], borrows: [ { @@ -550,31 +551,17 @@ describe('Test Aave V2 LendingProtocol', function () { decimals: 18, symbol: 'DAI', name: '(PoS) Dai Stablecoin', + logoUri: 'https://cdn.furucombo.app/assets/img/token/DAI.png', }, price: '0.99679794', balance: '0', apy: '0.12710541004444977537', + lstApy: '0', grossApy: '0.12710541004444977537', borrowMin: '0', borrowCap: '0', totalBorrow: '7856725.927159881562061903', }, - { - token: { - chainId: 137, - address: '0x0000000000000000000000000000000000001010', - decimals: 18, - symbol: 'MATIC', - name: 'Matic Token', - }, - price: '0.85300841', - balance: '0', - apy: '0.00015134820365801307', - grossApy: '0.00015134820365801307', - borrowMin: '0', - borrowCap: '0', - totalBorrow: '628705.023975555466478558', - }, { token: { chainId: 137, @@ -582,10 +569,12 @@ describe('Test Aave V2 LendingProtocol', function () { decimals: 6, symbol: 'USDC.e', name: 'USD Coin (PoS)', + logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, price: '0.99664591', balance: '0', apy: '0.10613890696322769932', + lstApy: '0', grossApy: '0.10613890696322769932', borrowMin: '0', borrowCap: '0', @@ -598,10 +587,12 @@ describe('Test Aave V2 LendingProtocol', function () { decimals: 6, symbol: 'USDT', name: '(PoS) Tether USD', + logoUri: 'https://cdn.furucombo.app/assets/img/token/USDT.svg', }, price: '1.00213471', balance: '180.909114', apy: '0.02085841506259266721', + lstApy: '0', grossApy: '0.02085841506259266721', borrowMin: '0', borrowCap: '0', @@ -614,10 +605,12 @@ describe('Test Aave V2 LendingProtocol', function () { decimals: 8, symbol: 'WBTC', name: '(PoS) Wrapped BTC', + logoUri: 'https://cdn.furucombo.app/assets/img/token/WBTC.svg', }, price: '42314.45587845', balance: '0', apy: '0.00000380199312269635', + lstApy: '0', grossApy: '0.00000380199312269635', borrowMin: '0', borrowCap: '0', @@ -630,15 +623,35 @@ describe('Test Aave V2 LendingProtocol', function () { decimals: 18, symbol: 'WETH', name: 'Wrapped Ether', + logoUri: 'https://cdn.furucombo.app/assets/img/token/WETH.svg', }, price: '2247.22899356', balance: '0', apy: '0.00011636207541797941', + lstApy: '0', grossApy: '0.00011636207541797941', borrowMin: '0', borrowCap: '0', totalBorrow: '1679.126787526099215032', }, + { + token: { + chainId: 137, + address: '0x0000000000000000000000000000000000000000', + decimals: 18, + symbol: 'MATIC', + name: 'Matic Token', + logoUri: 'https://cdn.furucombo.app/assets/img/token/MATIC.png', + }, + price: '0.85300841', + balance: '0', + apy: '0.00015134820365801307', + lstApy: '0', + grossApy: '0.00015134820365801307', + borrowMin: '0', + borrowCap: '0', + totalBorrow: '628705.023975555466478558', + }, ], }, }, @@ -650,6 +663,7 @@ describe('Test Aave V2 LendingProtocol', function () { protocol.setBlockTag(blockTag); const _portfolio = await protocol.getPortfolio(account); + const portfolio: Portfolio = JSON.parse(JSON.stringify(_portfolio)); const filteredPortfolio = filterPortfolio(portfolio); diff --git a/packages/lending/src/protocols/aave-v2/lending-protocol.ts b/packages/lending/src/protocols/aave-v2/lending-protocol.ts index 5605d78..b13dd8f 100644 --- a/packages/lending/src/protocols/aave-v2/lending-protocol.ts +++ b/packages/lending/src/protocols/aave-v2/lending-protocol.ts @@ -18,15 +18,7 @@ import { SupplyParams, WithdrawParams, } from 'src/protocol.type'; -import { - DISPLAY_NAME, - ID, - Reserve, - getContractAddress, - isBorrowEnabled, - isSupplyEnabled, - supportedChainIds, -} from './configs'; +import { DISPLAY_NAME, ID, ReserveMap, ReserveTokens, getContractAddress, supportedChainIds } from './configs'; import { ETHPriceFeedInterface } from './contracts/ETHPriceFeed'; import { Portfolio } from 'src/protocol.portfolio'; import { PriceOracleInterface } from './contracts/PriceOracle'; @@ -49,8 +41,8 @@ export class LendingProtocol extends Protocol { readonly name = DISPLAY_NAME; readonly market: Market; - private reserves: logics.aavev2.ReserveTokens[] = []; - private reserveMap: Record = {}; + private reserveTokens: ReserveTokens[] = []; + private reserveMap: ReserveMap = {}; constructor(chainId: number, provider?: providers.Provider) { super(chainId, provider); @@ -67,21 +59,23 @@ export class LendingProtocol extends Protocol { async initializeReservesConfig() { const service = new logics.aavev2.Service(this.chainId, this.provider); - const reserves = await service.getReserveTokens(); + const { reserveTokens } = await service.getReserveTokens(); + + const reserveMap: ReserveMap = {}; - const reserveMap: Record = {}; + for (const reserveToken of reserveTokens) { + const { asset, aToken } = reserveToken; - for (const { asset, aToken, stableDebtToken, variableDebtToken } of reserves) { if (asset.isWrapped) { - reserveMap[asset.unwrapped.address] = { aToken, asset }; - reserves.push({ asset: asset.unwrapped, aToken, stableDebtToken, variableDebtToken }); + reserveMap[asset.unwrapped.address] = reserveToken; + reserveTokens.push({ ...reserveToken, asset: asset.unwrapped }); } - reserveMap[asset.address] = { aToken, asset }; - reserveMap[aToken.address] = { aToken, asset }; + reserveMap[asset.address] = reserveToken; + reserveMap[aToken.address] = reserveToken; } - this.reserves = reserves; + this.reserveTokens = reserveTokens; this.reserveMap = reserveMap; } @@ -154,32 +148,26 @@ export class LendingProtocol extends Protocol { return this._aTokenIface; } - private _tokensForDeposit?: common.Token[]; + private _depositTokenList?: common.Token[]; - async getTokensForDeposit() { - if (!this._tokensForDeposit) { + async getDepositTokenList() { + if (!this._depositTokenList) { const tokenList = await apisdk.protocols.aavev2.getDepositTokenList(this.chainId); - const tokens = tokenList.filter((tokens) => isSupplyEnabled(this.chainId, tokens[0])).map((tokens) => tokens[0]); - - this._tokensForDeposit = tokens; + this._depositTokenList = tokenList.map((tokens) => tokens[0]); } - return this._tokensForDeposit; + return this._depositTokenList; } - private _tokensForBorrow?: common.Token[]; - - async getTokensForBorrow() { - if (!this._tokensForBorrow) { - const tokenList = await apisdk.protocols.aavev2.getBorrowTokenList(this.chainId); - - const tokens = tokenList.filter((token) => isBorrowEnabled(this.chainId, token)); + private _borrowTokenList?: common.Token[]; - this._tokensForBorrow = tokens; + async getBorrowTokenList() { + if (!this._borrowTokenList) { + this._borrowTokenList = await apisdk.protocols.aavev2.getBorrowTokenList(this.chainId); } - return this._tokensForBorrow; + return this._borrowTokenList; } getMarketName() { @@ -202,7 +190,7 @@ export class LendingProtocol extends Protocol { async getReserveDataMap() { if (!this._reserveDataMap) { const calls: common.Multicall3.CallStruct[] = []; - for (const { asset, aToken } of this.reserves) { + for (const { asset, aToken } of this.reserveTokens) { calls.push({ target: this.protocolDataProvider.address, callData: this.protocolDataProviderIface.encodeFunctionData('getReserveConfigurationData', [ @@ -222,7 +210,7 @@ export class LendingProtocol extends Protocol { this._reserveDataMap = {}; let j = 0; - for (const { asset } of this.reserves) { + for (const { asset } of this.reserveTokens) { const { ltv, liquidationThreshold, usageAsCollateralEnabled } = this.protocolDataProviderIface.decodeFunctionResult('getReserveConfigurationData', returnData[j]); j++; @@ -262,7 +250,7 @@ export class LendingProtocol extends Protocol { { target: this.priceOracle.address, callData: this.priceOracleIface.encodeFunctionData('getAssetsPrices', [ - this.reserves.map(({ asset }) => asset.wrapped.address), + this.reserveTokens.map(({ asset }) => asset.wrapped.address), ]), }, ]; @@ -272,8 +260,8 @@ export class LendingProtocol extends Protocol { const [assetPrices] = this.priceOracleIface.decodeFunctionResult('getAssetsPrices', returnData[1]); const assetPriceMap: Record = {}; - for (let i = 0; i < this.reserves.length; i++) { - assetPriceMap[this.reserves[i].asset.address] = common.toBigUnit( + for (let i = 0; i < this.reserveTokens.length; i++) { + assetPriceMap[this.reserveTokens[i].asset.address] = common.toBigUnit( ethPrice.mul(assetPrices[i]).div(BigNumber.from(10).pow(18)), 8 ); @@ -284,7 +272,7 @@ export class LendingProtocol extends Protocol { async getUserBalancesMap(account: string) { const calls: common.Multicall3.CallStruct[] = []; - for (const { asset, aToken } of this.reserves) { + for (const { asset, aToken } of this.reserveTokens) { calls.push({ target: aToken.address, callData: this.erc20Iface.encodeFunctionData('balanceOf', [account]) }); calls.push({ target: this.protocolDataProvider.address, @@ -305,8 +293,8 @@ export class LendingProtocol extends Protocol { } > = {}; let j = 0; - for (let i = 0; i < this.reserves.length; i++) { - const { asset } = this.reserves[i]; + for (let i = 0; i < this.reserveTokens.length; i++) { + const { asset } = this.reserveTokens[i]; const [aTokenBalance] = this.erc20Iface.decodeFunctionResult('balanceOf', returnData[j]); j++; @@ -334,11 +322,11 @@ export class LendingProtocol extends Protocol { const assetPriceMap = await this.getAssetPriceMap(); const userBalancesMap = await this.getUserBalancesMap(account); const lstTokenAPYMap = await this.getLstTokenAPYMap(this.chainId); - const tokensForDeposit = await this.getTokensForDeposit(); - const tokensForBorrow = await this.getTokensForBorrow(); + const depositTokenList = await this.getDepositTokenList(); + const borrowTokenList = await this.getBorrowTokenList(); const supplies: SupplyObject[] = []; - for (const token of tokensForDeposit) { + for (const token of depositTokenList) { if (token.isWrapped) continue; const reserveData = reserveDataMap[token.address]; @@ -368,7 +356,7 @@ export class LendingProtocol extends Protocol { } const borrows: BorrowObject[] = []; - for (const token of tokensForBorrow) { + for (const token of borrowTokenList) { if (token.isWrapped) continue; const { supplyAPY: apy, totalBorrow } = reserveDataMap[token.address]; diff --git a/packages/lending/src/protocols/aave-v3/adapter.test.ts b/packages/lending/src/protocols/aave-v3/adapter.test.ts index 4c89539..4924995 100644 --- a/packages/lending/src/protocols/aave-v3/adapter.test.ts +++ b/packages/lending/src/protocols/aave-v3/adapter.test.ts @@ -9,7 +9,7 @@ import { mainnetTokens } from './tokens'; describe('Test Adapter for Aave V3', function () { const chainId = common.ChainId.mainnet; - const blockTag = 20187274; + const blockTag = 20370000; let adapter: Adapter; let protocol: LendingProtocol; diff --git a/packages/lending/src/protocols/aave-v3/configs.ts b/packages/lending/src/protocols/aave-v3/configs.ts index 55fd5a5..01e77dc 100644 --- a/packages/lending/src/protocols/aave-v3/configs.ts +++ b/packages/lending/src/protocols/aave-v3/configs.ts @@ -1,14 +1,11 @@ -import { arbitrumTokens, avalancheTokens, gnosisTokens, mainnetTokens, optimismTokens, polygonTokens } from './tokens'; import * as common from '@protocolink/common'; import * as logics from '@protocolink/logics'; export const ID = 'aave-v3'; export const DISPLAY_NAME = 'Aave V3'; -export interface Reserve { - asset: common.Token; - aToken: common.Token; -} +export type ReserveTokens = logics.aavev3.ReserveTokens; +export type ReserveMap = Record; type ContractName = 'Pool' | 'PoolDataProvider' | 'AaveOracle'; @@ -98,33 +95,3 @@ export function getContractAddress(chainId: number, name: ContractName) { const { contractMap } = configs.find((configs) => configs.chainId === chainId)!; return contractMap[name]; } - -const supplyDisabledMap: Record = { - [common.ChainId.mainnet]: [mainnetTokens.GHO.address], - [common.ChainId.optimism]: [], - [common.ChainId.gnosis]: [], - [common.ChainId.polygon]: [], - [common.ChainId.metis]: [], - [common.ChainId.base]: [], - [common.ChainId.arbitrum]: [], - [common.ChainId.avalanche]: [], -}; - -const borrowDisabledMap: Record = { - [common.ChainId.mainnet]: [mainnetTokens.AAVE.address], - [common.ChainId.optimism]: [optimismTokens.AAVE.address], - [common.ChainId.gnosis]: [gnosisTokens.sDAI.address], - [common.ChainId.polygon]: [polygonTokens.AAVE.address], - [common.ChainId.metis]: [], - [common.ChainId.base]: [], - [common.ChainId.arbitrum]: [arbitrumTokens.AAVE.address], - [common.ChainId.avalanche]: [avalancheTokens.sAVAX.address, avalancheTokens['AAVE.e'].address], -}; - -export const isSupplyEnabled = (chainId: number, token: common.Token) => { - return !supplyDisabledMap[chainId].includes(token.address); -}; - -export const isBorrowEnabled = (chainId: number, token: common.Token) => { - return !borrowDisabledMap[chainId].includes(token.address); -}; diff --git a/packages/lending/src/protocols/aave-v3/lending-protocol.test.ts b/packages/lending/src/protocols/aave-v3/lending-protocol.test.ts index 2ead4d0..f1d9488 100644 --- a/packages/lending/src/protocols/aave-v3/lending-protocol.test.ts +++ b/packages/lending/src/protocols/aave-v3/lending-protocol.test.ts @@ -10,16 +10,16 @@ describe('Test Aave V3 LendingProtocol', function () { { chainId: common.ChainId.mainnet, account: '0xAF06acFD1BD492B913d5807d562e4FC3A6343C4E', - blockTag: 20187485, + blockTag: 20370000, expected: { chainId: 1, protocolId: 'aave-v3', marketId: 'mainnet', - utilization: '0.00001999803377340941', - healthRate: '52005.10308791015731294456', - netAPY: '0.04925988083574740088', - totalSupplyUSD: '0.05387552312640222287481594', - totalBorrowUSD: '0.00000080805424699616159894', + utilization: '0.00002017249079363869', + healthRate: '51555.34916189848600876066', + netAPY: '0.06022421407417594602', + totalSupplyUSD: '0.05415235552809061459034246', + totalBorrowUSD: '0.00000081929178774151830072', supplies: [ { token: { @@ -30,17 +30,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Ethereum', logoUri: 'https://cdn.furucombo.app/assets/img/token/ETH.png', }, - price: '3451.49', + price: '3490.68309921', balance: '0', - apy: '0.02498932862838898702', + apy: '0.01906210712146057623', lstApy: '0', - grossApy: '0.02498932862838898702', + grossApy: '0.01906210712146057623', usageAsCollateralEnabled: true, ltv: '0.805', liquidationThreshold: '0.83', isNotCollateral: false, supplyCap: '1800000', - totalSupply: '863552.065648678029675973', + totalSupply: '982493.12987733487557384', }, { token: { @@ -51,17 +51,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Wrapped liquid staked Ether 2.0', logoUri: 'https://cdn.furucombo.app/assets/img/token/wstETH.png', }, - price: '4041.81953479', - balance: '0.000000000300005686', - apy: '0.00005839794861077369', - lstApy: '0.03', - grossApy: '0.03005839794861077369', + price: '4096.60756363', + balance: '0.000000000300009042', + apy: '0.00012292766600466096', + lstApy: '0.0306', + grossApy: '0.03072292766600466096', usageAsCollateralEnabled: true, ltv: '0.785', liquidationThreshold: '0.81', isNotCollateral: false, supplyCap: '1250000', - totalSupply: '1056256.656461793562757271', + totalSupply: '1037068.143280323913576095', }, { token: { @@ -72,17 +72,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Wrapped BTC', logoUri: 'https://cdn.furucombo.app/assets/img/token/WBTC.svg', }, - price: '61766.29750948', + price: '67214.30913055', balance: '0', - apy: '0.00139181220524093089', + apy: '0.0013157213401839349', lstApy: '0', - grossApy: '0.00139181220524093089', + grossApy: '0.0013157213401839349', usageAsCollateralEnabled: true, ltv: '0.73', liquidationThreshold: '0.78', isNotCollateral: false, supplyCap: '43000', - totalSupply: '33000.86815181', + totalSupply: '34740.45790028', }, { token: { @@ -93,17 +93,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'USD Coin', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99976646', + price: '0.99997275', balance: '0', - apy: '0.06806904257166425755', + apy: '0.06609106620668933604', lstApy: '0', - grossApy: '0.06806904257166425755', + grossApy: '0.06609106620668933604', usageAsCollateralEnabled: true, ltv: '0.75', liquidationThreshold: '0.78', isNotCollateral: false, - supplyCap: '1760000000', - totalSupply: '1445956183.103999', + supplyCap: '2250000000', + totalSupply: '1550210868.750817', }, { token: { @@ -114,17 +114,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Dai Stablecoin', logoUri: 'https://cdn.furucombo.app/assets/img/token/DAI.png', }, - price: '0.999806', + price: '0.99983633', balance: '0', - apy: '0.06241590450993712276', + apy: '0.0534025975426064874', lstApy: '0', - grossApy: '0.06241590450993712276', + grossApy: '0.0534025975426064874', usageAsCollateralEnabled: true, ltv: '0.63', liquidationThreshold: '0.77', isNotCollateral: false, supplyCap: '338000000', - totalSupply: '131208355.266371721099894467', + totalSupply: '139115851.932486997210226111', }, { token: { @@ -135,17 +135,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Chainlink', logoUri: 'https://cdn.furucombo.app/assets/img/token/LINK.svg', }, - price: '14.46913', + price: '13.91170892', balance: '0', - apy: '0.00000264531922461349', + apy: '0.00002438068343391558', lstApy: '0', - grossApy: '0.00000264531922461349', + grossApy: '0.00002438068343391558', usageAsCollateralEnabled: true, ltv: '0.53', liquidationThreshold: '0.68', isNotCollateral: false, supplyCap: '15000000', - totalSupply: '10794278.33272923641148891', + totalSupply: '11282351.909400711882925425', }, { token: { @@ -156,7 +156,7 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Aave Token', logoUri: 'https://cdn.furucombo.app/assets/img/token/AAVE.svg', }, - price: '93.48735579', + price: '96.22135132', balance: '0', apy: '0', lstApy: '0', @@ -166,7 +166,7 @@ describe('Test Aave V3 LendingProtocol', function () { liquidationThreshold: '0.73', isNotCollateral: false, supplyCap: '1850000', - totalSupply: '1001616.455294738100302262', + totalSupply: '1019289.519765003132648978', }, { token: { @@ -177,17 +177,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Coinbase Wrapped Staked ETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/cbETH.svg', }, - price: '3710.16078124', + price: '3759.38898387', balance: '0', - apy: '0.00175624395680365284', - lstApy: '0.0251', - grossApy: '0.02685624395680365284', + apy: '0.0058679006786796281', + lstApy: '0.0261', + grossApy: '0.0319679006786796281', usageAsCollateralEnabled: true, ltv: '0.745', liquidationThreshold: '0.77', isNotCollateral: false, supplyCap: '60000', - totalSupply: '8046.029185105139991721', + totalSupply: '7452.290450336393833618', }, { token: { @@ -198,17 +198,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Tether USD', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDT.svg', }, - price: '0.99893033', - balance: '0.053932', - apy: '0.04925918663467316972', + price: '1.00026094', + balance: '0.054137', + apy: '0.06022358917763675849', lstApy: '0', - grossApy: '0.04925918663467316972', + grossApy: '0.06022358917763675849', usageAsCollateralEnabled: true, ltv: '0.75', liquidationThreshold: '0.78', isNotCollateral: false, - supplyCap: '2000000000', - totalSupply: '1771136107.688263', + supplyCap: '2500000000', + totalSupply: '1688446532.915416', }, { token: { @@ -219,17 +219,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Rocket Pool ETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/rETH.svg', }, - price: '3830.01696', + price: '3881.07180386', balance: '0', - apy: '0.00006751911794613914', - lstApy: '0.0282', - grossApy: '0.02826751911794613914', + apy: '0.00034368597768278568', + lstApy: '0.027', + grossApy: '0.02734368597768278568', usageAsCollateralEnabled: true, ltv: '0.745', liquidationThreshold: '0.77', isNotCollateral: false, supplyCap: '90000', - totalSupply: '46204.937079396871929063', + totalSupply: '45313.068705187277067547', }, { token: { @@ -240,17 +240,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'LUSD Stablecoin', logoUri: 'https://cdn.furucombo.app/assets/img/token/LUSD.png', }, - price: '0.99827193', + price: '0.99871939', balance: '0', - apy: '0.04763397755838779855', + apy: '0.03723929335139925503', lstApy: '0', - grossApy: '0.04763397755838779855', + grossApy: '0.03723929335139925503', usageAsCollateralEnabled: true, ltv: '0', liquidationThreshold: '0.77', isNotCollateral: false, supplyCap: '18000000', - totalSupply: '5530423.57139451992340624', + totalSupply: '5960163.417036841245938535', }, { token: { @@ -261,17 +261,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Curve DAO Token', logoUri: 'https://cdn.furucombo.app/assets/img/token/CRV.png', }, - price: '0.291864', + price: '0.2798289', balance: '0', - apy: '0.00592307142335363847', + apy: '0.01563853457706822354', lstApy: '0', - grossApy: '0.00592307142335363847', + grossApy: '0.01563853457706822354', usageAsCollateralEnabled: false, ltv: '0.35', liquidationThreshold: '0.41', isNotCollateral: false, supplyCap: '10000000', - totalSupply: '8397774.553814940272599022', + totalSupply: '9876040.51850490611409757', }, { token: { @@ -282,17 +282,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Maker', logoUri: 'https://cdn.furucombo.app/assets/img/token/MKR.png', }, - price: '2574.96591723', + price: '2773.924', balance: '0', - apy: '0.00001332763416078028', + apy: '0.00026073771056648787', lstApy: '0', - grossApy: '0.00001332763416078028', + grossApy: '0.00026073771056648787', usageAsCollateralEnabled: false, ltv: '0.65', liquidationThreshold: '0.7', isNotCollateral: false, supplyCap: '22500', - totalSupply: '12855.946462549110963243', + totalSupply: '12932.308630650211881738', }, { token: { @@ -303,17 +303,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Synthetix Network Token', logoUri: 'https://cdn.furucombo.app/assets/img/token/SNX.png', }, - price: '2.0307072', + price: '1.81416498', balance: '0', - apy: '0.00078494877135036951', + apy: '0.00227258392764308365', lstApy: '0', - grossApy: '0.00078494877135036951', + grossApy: '0.00227258392764308365', usageAsCollateralEnabled: false, ltv: '0.49', liquidationThreshold: '0.65', isNotCollateral: false, supplyCap: '4500000', - totalSupply: '1286407.805189659506457636', + totalSupply: '903396.77979686893359419', }, { token: { @@ -324,17 +324,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Balancer', logoUri: 'https://cdn.furucombo.app/assets/img/token/BAL.png', }, - price: '3.03445305', + price: '2.6052', balance: '0', - apy: '0.0074395488842611835', + apy: '0.01043780969192853314', lstApy: '0', - grossApy: '0.0074395488842611835', + grossApy: '0.01043780969192853314', usageAsCollateralEnabled: false, ltv: '0.57', liquidationThreshold: '0.59', isNotCollateral: false, - supplyCap: '2100000', - totalSupply: '2100355.1426777711869772', + supplyCap: '3800000', + totalSupply: '2096655.185780590575896395', }, { token: { @@ -345,17 +345,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Uniswap Token', logoUri: 'https://cdn.furucombo.app/assets/img/token/UNI.png', }, - price: '9.58169672', + price: '7.86856', balance: '0', - apy: '0.00027116222791967147', + apy: '0.00018615426764768409', lstApy: '0', - grossApy: '0.00027116222791967147', + grossApy: '0.00018615426764768409', usageAsCollateralEnabled: false, ltv: '0.65', liquidationThreshold: '0.74', isNotCollateral: false, supplyCap: '4000000', - totalSupply: '883308.914381929405032734', + totalSupply: '1097932.313715470558907167', }, { token: { @@ -366,17 +366,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Lido DAO Token', logoUri: 'https://cdn.furucombo.app/assets/img/token/LDO.png', }, - price: '2.34701495', + price: '1.84884647', balance: '0', - apy: '0.00002149906715192463', + apy: '0.00001175488439490757', lstApy: '0', - grossApy: '0.00002149906715192463', + grossApy: '0.00001175488439490757', usageAsCollateralEnabled: false, ltv: '0.4', liquidationThreshold: '0.5', isNotCollateral: false, supplyCap: '8000000', - totalSupply: '5919887.441235115866856065', + totalSupply: '5860831.31742298689861764', }, { token: { @@ -387,17 +387,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Ethereum Name Service', logoUri: 'https://cdn.furucombo.app/assets/img/token/ENS.png', }, - price: '27.07071531', + price: '29.69080967', balance: '0', - apy: '0.00017504844015420633', + apy: '0.00017095064248234046', lstApy: '0', - grossApy: '0.00017504844015420633', + grossApy: '0.00017095064248234046', usageAsCollateralEnabled: false, ltv: '0.39', liquidationThreshold: '0.49', isNotCollateral: false, supplyCap: '1500000', - totalSupply: '234836.197420268898350519', + totalSupply: '226077.140170577528271678', }, { token: { @@ -408,17 +408,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: '1INCH Token', logoUri: 'https://cdn.furucombo.app/assets/img/token/1INCH.svg', }, - price: '0.40300563', + price: '0.41559233', balance: '0', - apy: '0.00123796709091215768', + apy: '0.00178082503469686678', lstApy: '0', - grossApy: '0.00123796709091215768', + grossApy: '0.00178082503469686678', usageAsCollateralEnabled: false, ltv: '0.57', liquidationThreshold: '0.67', isNotCollateral: false, supplyCap: '30000000', - totalSupply: '2930193.747354411318058337', + totalSupply: '2932647.30258281157075725', }, { token: { @@ -429,17 +429,38 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Frax', logoUri: 'https://cdn.furucombo.app/assets/img/token/FRAX.png', }, - price: '0.99731092', + price: '0.99746328', balance: '0', - apy: '0.03693050160523759623', + apy: '0.0624523483966045978', lstApy: '0', - grossApy: '0.03693050160523759623', + grossApy: '0.0624523483966045978', usageAsCollateralEnabled: false, ltv: '0', liquidationThreshold: '0.72', isNotCollateral: false, supplyCap: '15000000', - totalSupply: '1210191.400928506364950097', + totalSupply: '824591.571841355614088529', + }, + { + token: { + chainId: 1, + address: '0x40D16FC0246aD3160Ccc09B8D0D3A2cD28aE6C2f', + decimals: 18, + symbol: 'GHO', + name: 'Gho Token', + logoUri: 'https://cdn.furucombo.app/assets/img/token/GHO.svg', + }, + price: '1', + balance: '0', + apy: '0', + lstApy: '0', + grossApy: '0', + usageAsCollateralEnabled: false, + ltv: '0', + liquidationThreshold: '0', + isNotCollateral: false, + supplyCap: '0', + totalSupply: '0', }, { token: { @@ -450,17 +471,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Rocket Pool', logoUri: 'https://cdn.furucombo.app/assets/img/token/RPL.png', }, - price: '20.69394329', + price: '18.15516745', balance: '0', - apy: '0.02725963458583589761', + apy: '0.03010601828123231458', lstApy: '0', - grossApy: '0.02725963458583589761', + grossApy: '0.03010601828123231458', usageAsCollateralEnabled: false, ltv: '0', liquidationThreshold: '0', isNotCollateral: false, supplyCap: '840000', - totalSupply: '513392.481796538419650095', + totalSupply: '522882.18179883180754061', }, { token: { @@ -471,17 +492,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Savings Dai', logoUri: 'https://cdn.furucombo.app/assets/img/token/sDAI.svg', }, - price: '1.09217133', + price: '1.09789311', balance: '0', apy: '0', - lstApy: '0.077', - grossApy: '0.077', + lstApy: '0.0677', + grossApy: '0.0677', usageAsCollateralEnabled: true, ltv: '0.75', liquidationThreshold: '0.78', isNotCollateral: false, supplyCap: '340000000', - totalSupply: '58614733.02581636496346381', + totalSupply: '60105445.305948649296971976', }, { token: { @@ -492,17 +513,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Curve.Fi USD Stablecoin', logoUri: 'https://cdn.furucombo.app/assets/img/token/crvUSD.svg', }, - price: '0.99589062', + price: '0.99655141', balance: '0', - apy: '0.03099790061851792919', + apy: '0.04470465342936634063', lstApy: '0', - grossApy: '0.03099790061851792919', + grossApy: '0.04470465342936634063', usageAsCollateralEnabled: false, ltv: '0', liquidationThreshold: '0', isNotCollateral: false, supplyCap: '60000000', - totalSupply: '979206.509218990337655242', + totalSupply: '776865.096495556163058504', }, { token: { @@ -513,17 +534,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'PayPal USD', logoUri: 'https://cdn.furucombo.app/assets/img/token/PYUSD.webp', }, - price: '0.9986693', + price: '0.99984422', balance: '0', - apy: '0.05359980001765430812', + apy: '0.05427721039087836968', lstApy: '0', - grossApy: '0.05359980001765430812', + grossApy: '0.05427721039087836968', usageAsCollateralEnabled: false, ltv: '0', liquidationThreshold: '0', isNotCollateral: false, supplyCap: '60000000', - totalSupply: '28815976.844872', + totalSupply: '20701054.551565', }, { token: { @@ -534,17 +555,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Wrapped eETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/weETH.webp', }, - price: '3595.25941308', + price: '3643.00043268', balance: '0', - apy: '0.00458800598652878456', + apy: '0.00214673298476831582', lstApy: '0', - grossApy: '0.00458800598652878456', + grossApy: '0.00214673298476831582', usageAsCollateralEnabled: true, ltv: '0.725', liquidationThreshold: '0.75', isNotCollateral: false, - supplyCap: '550000', - totalSupply: '550015.259159458450820298', + supplyCap: '660000', + totalSupply: '659997.456961871969281934', }, { token: { @@ -555,17 +576,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Staked ETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/osETH.webp', }, - price: '3520.49612167', + price: '3567.78971028', balance: '0', - apy: '0.00015521792550850201', + apy: '0.00139902988860636002', lstApy: '0', - grossApy: '0.00015521792550850201', + grossApy: '0.00139902988860636002', usageAsCollateralEnabled: true, ltv: '0.725', liquidationThreshold: '0.75', isNotCollateral: false, supplyCap: '10000', - totalSupply: '1598.433685132118243286', + totalSupply: '1698.472580900130370805', }, { token: { @@ -576,17 +597,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'USDe', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDe.webp', }, - price: '0.99949999', + price: '1.00023601', balance: '0', - apy: '0.04308092740975599814', + apy: '0.05508996283595329893', lstApy: '0', - grossApy: '0.04308092740975599814', + grossApy: '0.05508996283595329893', usageAsCollateralEnabled: false, ltv: '0.72', liquidationThreshold: '0.75', isNotCollateral: false, supplyCap: '80000000', - totalSupply: '58772971.676509812885761573', + totalSupply: '63626019.853475905734669523', }, { token: { @@ -597,17 +618,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Stader ETHx', logoUri: 'https://tokens.1inch.io/0xa35b1b31ce002fbf2058d22f30f95d405200a15b.png', }, - price: '3566.82831897', + price: '3614.38648037', balance: '0', - apy: '0', + apy: '0.00032697839181294113', lstApy: '0', - grossApy: '0', + grossApy: '0.00032697839181294113', usageAsCollateralEnabled: true, ltv: '0.745', liquidationThreshold: '0.77', isNotCollateral: false, supplyCap: '3200', - totalSupply: '700.053670150592831448', + totalSupply: '2459.311539388778371332', }, { token: { @@ -618,7 +639,7 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Staked USDe', logoUri: 'https://tokens.1inch.io/0x9d39a5de30e57443bff2a8307a4256c8797a3497.png', }, - price: '1.08301437', + price: '1.09095012', balance: '0', apy: '0', lstApy: '0', @@ -628,7 +649,7 @@ describe('Test Aave V3 LendingProtocol', function () { liquidationThreshold: '0.75', isNotCollateral: false, supplyCap: '85000000', - totalSupply: '3869921.336988603566776291', + totalSupply: '1158209.57801896693485983', }, ], borrows: [ @@ -641,14 +662,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Ethereum', logoUri: 'https://cdn.furucombo.app/assets/img/token/ETH.png', }, - price: '3451.49', + price: '3490.68309921', balance: '0', - apy: '0.03276621465713345077', + apy: '0.02615176993523087836', lstApy: '0', - grossApy: '0.03276621465713345077', + grossApy: '0.02615176993523087836', borrowMin: '0', borrowCap: '1400000', - totalBorrow: '777769.959255229293396444', + totalBorrow: '845471.121118875220746221', }, { token: { @@ -659,14 +680,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Wrapped liquid staked Ether 2.0', logoUri: 'https://cdn.furucombo.app/assets/img/token/wstETH.png', }, - price: '4041.81953479', - balance: '0.000000000199923386', - apy: '0.0041625413173683652', - lstApy: '0.03', - grossApy: '-0.0258374586826316348', + price: '4096.60756363', + balance: '0.000000000199992744', + apy: '0.00526678108038658357', + lstApy: '0.0306', + grossApy: '-0.02533321891961341643', borrowMin: '0', - borrowCap: '24000', - totalBorrow: '17469.458192212269563234', + borrowCap: '48000', + totalBorrow: '28550.086174317579769182', }, { token: { @@ -677,14 +698,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Wrapped BTC', logoUri: 'https://cdn.furucombo.app/assets/img/token/WBTC.svg', }, - price: '61766.29750948', + price: '67214.30913055', balance: '0', - apy: '0.01250893302447089922', + apy: '0.0121603263113706355', lstApy: '0', - grossApy: '0.01250893302447089922', + grossApy: '0.0121603263113706355', borrowMin: '0', borrowCap: '28000', - totalBorrow: '4615.26376158', + totalBorrow: '4723.96692362', }, { token: { @@ -695,14 +716,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'USD Coin', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99976646', + price: '0.99997275', balance: '0', - apy: '0.0882862201979946724', + apy: '0.08698189392544052744', lstApy: '0', - grossApy: '0.0882862201979946724', + grossApy: '0.08698189392544052744', borrowMin: '0', - borrowCap: '1580000000', - totalBorrow: '1250549534.998333', + borrowCap: '2100000000', + totalBorrow: '1321740029.142569', }, { token: { @@ -713,14 +734,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Dai Stablecoin', logoUri: 'https://cdn.furucombo.app/assets/img/token/DAI.png', }, - price: '0.999806', + price: '0.99983633', balance: '0', - apy: '0.09293461914222748949', + apy: '0.08586486555610735681', lstApy: '0', - grossApy: '0.09293461914222748949', + grossApy: '0.08586486555610735681', borrowMin: '0', borrowCap: '271000000', - totalBorrow: '119196469.407416851662864314', + totalBorrow: '117156672.375190590966771372', }, { token: { @@ -731,14 +752,32 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Chainlink', logoUri: 'https://cdn.furucombo.app/assets/img/token/LINK.svg', }, - price: '14.46913', + price: '13.91170892', balance: '0', - apy: '0.00071745104490227539', + apy: '0.00217967097227906922', lstApy: '0', - grossApy: '0.00071745104490227539', + grossApy: '0.00217967097227906922', borrowMin: '0', borrowCap: '13000000', - totalBorrow: '49767.36514500740420718', + totalBorrow: '157918.243637725185997365', + }, + { + token: { + chainId: 1, + address: '0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9', + decimals: 18, + symbol: 'AAVE', + name: 'Aave Token', + logoUri: 'https://cdn.furucombo.app/assets/img/token/AAVE.svg', + }, + price: '96.22135132', + balance: '0', + apy: '0', + lstApy: '0', + grossApy: '0', + borrowMin: '0', + borrowCap: '0', + totalBorrow: '0', }, { token: { @@ -749,14 +788,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Coinbase Wrapped Staked ETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/cbETH.svg', }, - price: '3710.16078124', + price: '3759.38898387', balance: '0', - apy: '0.01808140788884236057', - lstApy: '0.0251', - grossApy: '-0.00701859211115763943', + apy: '0.03326319684287204968', + lstApy: '0.0261', + grossApy: '0.00716319684287204968', borrowMin: '0', borrowCap: '2400', - totalBorrow: '926.914982035434725693', + totalBorrow: '1567.659791907274782482', }, { token: { @@ -767,14 +806,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Tether USD', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDT.svg', }, - price: '0.99893033', + price: '1.00026094', balance: '0', - apy: '0.07497238338249427281', + apy: '0.08299210101994077768', lstApy: '0', - grossApy: '0.07497238338249427281', + grossApy: '0.08299210101994077768', borrowMin: '0', - borrowCap: '1900000000', - totalBorrow: '1308913625.804273', + borrowCap: '2250000000', + totalBorrow: '1376121810.389116', }, { token: { @@ -785,14 +824,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Rocket Pool ETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/rETH.svg', }, - price: '3830.01696', + price: '3881.07180386', balance: '0', - apy: '0.00352129873338082018', - lstApy: '0.0282', - grossApy: '-0.02467870126661917982', + apy: '0.00796159400456774621', + lstApy: '0.027', + grossApy: '-0.01903840599543225379', borrowMin: '0', borrowCap: '19200', - totalBorrow: '1044.10218761046063956', + totalBorrow: '2310.024637953106501718', }, { token: { @@ -803,14 +842,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'LUSD Stablecoin', logoUri: 'https://cdn.furucombo.app/assets/img/token/LUSD.png', }, - price: '0.99827193', + price: '0.99871939', balance: '0', - apy: '0.08425624099100210242', + apy: '0.07433849298624684733', lstApy: '0', - grossApy: '0.08425624099100210242', + grossApy: '0.07433849298624684733', borrowMin: '0', borrowCap: '8000000', - totalBorrow: '3976805.647029094500041468', + totalBorrow: '3799086.295282689532115726', }, { token: { @@ -821,14 +860,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Curve DAO Token', logoUri: 'https://cdn.furucombo.app/assets/img/token/CRV.png', }, - price: '0.291864', + price: '0.2798289', balance: '0', - apy: '0.06203797715105698619', + apy: '0.08948813624233006629', lstApy: '0', - grossApy: '0.06203797715105698619', + grossApy: '0.08948813624233006629', borrowMin: '0', borrowCap: '2750000', - totalBorrow: '1267703.300957292054404776', + totalBorrow: '2751037.273388135365905402', }, { token: { @@ -839,14 +878,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Maker', logoUri: 'https://cdn.furucombo.app/assets/img/token/MKR.png', }, - price: '2574.96591723', + price: '2773.924', balance: '0', - apy: '0.00161109988019218933', + apy: '0.00714526536259445092', lstApy: '0', - grossApy: '0.00161109988019218933', + grossApy: '0.00714526536259445092', borrowMin: '0', borrowCap: '1980', - totalBorrow: '133.042846551952038565', + totalBorrow: '591.923053153404624917', }, { token: { @@ -857,14 +896,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Synthetix Network Token', logoUri: 'https://cdn.furucombo.app/assets/img/token/SNX.png', }, - price: '2.0307072', + price: '1.81416498', balance: '0', - apy: '0.03690958213019414813', + apy: '0.04567392222630226278', lstApy: '0', - grossApy: '0.03690958213019414813', + grossApy: '0.04567392222630226278', borrowMin: '0', borrowCap: '150000', - totalBorrow: '42862.74849244665967621', + totalBorrow: '70648.638420368098129179', }, { token: { @@ -875,14 +914,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Balancer', logoUri: 'https://cdn.furucombo.app/assets/img/token/BAL.png', }, - price: '3.03445305', + price: '2.6052', balance: '0', - apy: '0.08472697043026794235', + apy: '0.09391630223979880191', lstApy: '0', - grossApy: '0.08472697043026794235', + grossApy: '0.09391630223979880191', borrowMin: '0', - borrowCap: '250000', - totalBorrow: '239279.542994513357571836', + borrowCap: '500000', + totalBorrow: '303179.698571318459272783', }, { token: { @@ -893,14 +932,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Uniswap Token', logoUri: 'https://cdn.furucombo.app/assets/img/token/UNI.png', }, - price: '9.58169672', + price: '7.86856', balance: '0', - apy: '0.00728719749268102532', + apy: '0.00603421930171601774', lstApy: '0', - grossApy: '0.00728719749268102532', + grossApy: '0.00603421930171601774', borrowMin: '0', borrowCap: '330000', - totalBorrow: '41229.747621420003131954', + totalBorrow: '42462.612659653833963623', }, { token: { @@ -911,14 +950,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Lido DAO Token', logoUri: 'https://cdn.furucombo.app/assets/img/token/LDO.png', }, - price: '2.34701495', + price: '1.84884647', balance: '0', - apy: '0.0020466769345435445', + apy: '0.00151298285844823709', lstApy: '0', - grossApy: '0.0020466769345435445', + grossApy: '0.00151298285844823709', borrowMin: '0', borrowCap: '1500000', - totalBorrow: '77809.858982415912427416', + totalBorrow: '56961.541286438153308695', }, { token: { @@ -929,14 +968,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Ethereum Name Service', logoUri: 'https://cdn.furucombo.app/assets/img/token/ENS.png', }, - price: '27.07071531', + price: '29.69080967', balance: '0', - apy: '0.00663693163828208788', + apy: '0.00655853900288879279', lstApy: '0', - grossApy: '0.00663693163828208788', + grossApy: '0.00655853900288879279', borrowMin: '0', borrowCap: '40000', - totalBorrow: '7767.226510769338802174', + totalBorrow: '7389.507076088637720299', }, { token: { @@ -947,14 +986,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: '1INCH Token', logoUri: 'https://cdn.furucombo.app/assets/img/token/1INCH.svg', }, - price: '0.40300563', + price: '0.41559233', balance: '0', - apy: '0.0177424979916027472', + apy: '0.02131450355578610075', lstApy: '0', - grossApy: '0.0177424979916027472', + grossApy: '0.02131450355578610075', borrowMin: '0', borrowCap: '475200', - totalBorrow: '257675.039037231281530664', + totalBorrow: '309259.222707666077441514', }, { token: { @@ -965,14 +1004,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Frax', logoUri: 'https://cdn.furucombo.app/assets/img/token/FRAX.png', }, - price: '0.99731092', + price: '0.99746328', balance: '0', - apy: '0.06964669314085828494', + apy: '0.09091844218786712003', lstApy: '0', - grossApy: '0.06964669314085828494', + grossApy: '0.09091844218786712003', borrowMin: '0', borrowCap: '12000000', - totalBorrow: '814846.583934133370241282', + totalBorrow: '717642.384776104119618026', }, { token: { @@ -985,12 +1024,12 @@ describe('Test Aave V3 LendingProtocol', function () { }, price: '1', balance: '0', - apy: '0.11627807024471977228', + apy: '0.07250818117089440143', lstApy: '0', - grossApy: '0.11627807024471977228', + grossApy: '0.07250818117089440143', borrowMin: '0', - borrowCap: '90000000', - totalBorrow: '84755678.215635032511607189', + borrowCap: '105000000', + totalBorrow: '102852318.635937418572158922', }, { token: { @@ -1001,14 +1040,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Rocket Pool', logoUri: 'https://cdn.furucombo.app/assets/img/token/RPL.png', }, - price: '20.69394329', + price: '18.15516745', balance: '0', - apy: '0.06158791590334846622', + apy: '0.06477661216582400633', lstApy: '0', - grossApy: '0.06158791590334846622', + grossApy: '0.06477661216582400633', borrowMin: '0', borrowCap: '500000', - totalBorrow: '288792.895450960850808958', + totalBorrow: '308909.335071416283658924', }, { token: { @@ -1019,11 +1058,11 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Savings Dai', logoUri: 'https://cdn.furucombo.app/assets/img/token/sDAI.svg', }, - price: '1.09217133', + price: '1.09789311', balance: '0', apy: '0', - lstApy: '0.077', - grossApy: '0.077', + lstApy: '0.0677', + grossApy: '0.0677', borrowMin: '0', borrowCap: '0', totalBorrow: '0', @@ -1037,14 +1076,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Curve.Fi USD Stablecoin', logoUri: 'https://cdn.furucombo.app/assets/img/token/crvUSD.svg', }, - price: '0.99589062', + price: '0.99655141', balance: '0', - apy: '0.06372078864796788292', + apy: '0.07673967633058358171', lstApy: '0', - grossApy: '0.06372078864796788292', + grossApy: '0.07673967633058358171', borrowMin: '0', borrowCap: '50000000', - totalBorrow: '537694.286009213895443075', + totalBorrow: '510599.614598877194415612', }, { token: { @@ -1055,14 +1094,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'PayPal USD', logoUri: 'https://cdn.furucombo.app/assets/img/token/PYUSD.webp', }, - price: '0.9986693', + price: '0.99984422', balance: '0', - apy: '0.08946620282306718846', + apy: '0.09003919326805871719', lstApy: '0', - grossApy: '0.08946620282306718846', + grossApy: '0.09003919326805871719', borrowMin: '0', borrowCap: '48000000', - totalBorrow: '21949183.921543', + totalBorrow: '15866472.177594', }, { token: { @@ -1073,14 +1112,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Wrapped eETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/weETH.webp', }, - price: '3595.25941308', + price: '3643.00043268', balance: '0', - apy: '0.04164261015241976729', + apy: '0.02831833384757563295', lstApy: '0', - grossApy: '0.04164261015241976729', + grossApy: '0.02831833384757563295', borrowMin: '0', - borrowCap: '150000', - totalBorrow: '112201.836723110731111438', + borrowCap: '200000', + totalBorrow: '92152.176373840373286617', }, { token: { @@ -1091,14 +1130,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Staked ETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/osETH.webp', }, - price: '3520.49612167', + price: '3567.78971028', balance: '0', - apy: '0.00534373839342765668', + apy: '0.01612400681759389008', lstApy: '0', - grossApy: '0.00534373839342765668', + grossApy: '0.01612400681759389008', borrowMin: '0', borrowCap: '1000', - totalBorrow: '54.764319219119017386', + totalBorrow: '174.660361388940398652', }, { token: { @@ -1109,14 +1148,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'USDe', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDe.webp', }, - price: '0.99949999', + price: '1.00023601', balance: '0', - apy: '0.08279025186696895518', + apy: '0.09383275979898097888', lstApy: '0', - grossApy: '0.08279025186696895518', + grossApy: '0.09383275979898097888', borrowMin: '0', borrowCap: '72000000', - totalBorrow: '41576801.790285414103389622', + totalBorrow: '50729615.007422810246222715', }, { token: { @@ -1127,14 +1166,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Stader ETHx', logoUri: 'https://tokens.1inch.io/0xa35b1b31ce002fbf2058d22f30f95d405200a15b.png', }, - price: '3566.82831897', + price: '3614.38648037', balance: '0', - apy: '0', + apy: '0.00776493877173731347', lstApy: '0', - grossApy: '0', + grossApy: '0.00776493877173731347', borrowMin: '0', borrowCap: '320', - totalBorrow: '0', + totalBorrow: '122.294154447856766526', }, { token: { @@ -1145,7 +1184,7 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Staked USDe', logoUri: 'https://tokens.1inch.io/0x9d39a5de30e57443bff2a8307a4256c8797a3497.png', }, - price: '1.08301437', + price: '1.09095012', balance: '0', apy: '0', lstApy: '0', @@ -1163,7 +1202,6 @@ describe('Test Aave V3 LendingProtocol', function () { blockTag: 32001300, expected: { chainId: 100, - protocolId: 'aave-v3', marketId: 'gnosis', utilization: '0.52772311717694312522', @@ -1401,7 +1439,7 @@ describe('Test Aave V3 LendingProtocol', function () { { chainId: common.ChainId.polygon, account: '0x1DC6074361a3cddEe55A61C92BCf7dE1667e1096', - blockTag: 58000000, + blockTag: 59590000, expected: { chainId: 137, protocolId: 'aave-v3', @@ -1948,16 +1986,16 @@ describe('Test Aave V3 LendingProtocol', function () { { chainId: common.ChainId.base, account: '0xb463c4d7c574bd0a05a1320186378dd6a7aeaa33', - blockTag: 16378163, + blockTag: 17592687, expected: { chainId: 8453, protocolId: 'aave-v3', marketId: 'base', - utilization: '0.4869099815024495391', - healthRate: '2.13078400405472189168', - netAPY: '-0.04927114463873345713', - totalSupplyUSD: '657460.0225507718161608204731', - totalBorrowUSD: '256099.07793503708948', + utilization: '0.50418969765356392583', + healthRate: '2.05775723865123745421', + netAPY: '-0.01644390139551923484', + totalSupplyUSD: '639012.519114378397528968', + totalBorrowUSD: '257746.82304729654659', supplies: [ { token: { @@ -1968,17 +2006,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Ethereum', logoUri: 'https://cdn.furucombo.app/assets/img/token/ETH.png', }, - price: '3457.2193', - balance: '190.170181726907464667', - apy: '0.00352235367608780077', + price: '3268.8', + balance: '195.488411378603278735', + apy: '0.03553785260156504401', lstApy: '0', - grossApy: '0.00352235367608780077', + grossApy: '0.03553785260156504401', usageAsCollateralEnabled: true, ltv: '0.8', liquidationThreshold: '0.83', isNotCollateral: false, - supplyCap: '18000', - totalSupply: '15346.585532152669789635', + supplyCap: '27000', + totalSupply: '22228.669660431776888568', }, { token: { @@ -1989,17 +2027,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Coinbase Wrapped Staked ETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/cbETH.svg', }, - price: '3716.31946174', + price: '3521.23994819', balance: '0', - apy: '0.00094774810196883789', - lstApy: '0.0251', - grossApy: '0.02604774810196883789', + apy: '0.00610711995603014652', + lstApy: '0.026', + grossApy: '0.03210711995603014652', usageAsCollateralEnabled: true, ltv: '0.67', liquidationThreshold: '0.74', isNotCollateral: false, supplyCap: '3000', - totalSupply: '1738.194976663020606199', + totalSupply: '1396.38596056643728553', }, { token: { @@ -2010,17 +2048,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'USD Base Coin', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99979922', + price: '0.99995489', balance: '0', - apy: '0.06054657023218002708', + apy: '0.06952168375927538169', lstApy: '0', - grossApy: '0.06054657023218002708', + grossApy: '0.06952168375927538169', usageAsCollateralEnabled: true, ltv: '0.75', liquidationThreshold: '0.78', isNotCollateral: false, supplyCap: '2000000', - totalSupply: '1988746.935288', + totalSupply: '1516011.190608', }, { token: { @@ -2031,17 +2069,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Wrapped liquid staked Ether 2.0', logoUri: 'https://cdn.furucombo.app/assets/img/token/wstETH.png', }, - price: '4048.19847949', + price: '3836.51930042', balance: '0', - apy: '0.00114798835241154962', - lstApy: '0.03', - grossApy: '0.03114798835241154962', + apy: '0.00173306617789736767', + lstApy: '0.0305', + grossApy: '0.03223306617789736767', usageAsCollateralEnabled: true, ltv: '0.71', liquidationThreshold: '0.76', isNotCollateral: false, - supplyCap: '6000', - totalSupply: '3284.237076727960059721', + supplyCap: '14000', + totalSupply: '4152.556329443991671286', }, { token: { @@ -2052,17 +2090,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'USD Coin', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99979922', + price: '0.99995489', balance: '0', - apy: '0.0635530213526273743', + apy: '0.0908610771429809274', lstApy: '0', - grossApy: '0.0635530213526273743', + grossApy: '0.0908610771429809274', usageAsCollateralEnabled: true, ltv: '0.75', liquidationThreshold: '0.78', isNotCollateral: false, supplyCap: '60000000', - totalSupply: '30305479.502009', + totalSupply: '31133630.574901', }, { token: { @@ -2073,17 +2111,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Wrapped eETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/weETH.webp', }, - price: '3601.09712721', + price: '3412.02933107', balance: '0', - apy: '0.00441053932757435128', + apy: '0.00217936212410040401', lstApy: '0', - grossApy: '0.00441053932757435128', + grossApy: '0.00217936212410040401', usageAsCollateralEnabled: true, ltv: '0.725', liquidationThreshold: '0.75', isNotCollateral: false, - supplyCap: '1200', - totalSupply: '1199.998927150383395898', + supplyCap: '20000', + totalSupply: '19997.66088388888760867', }, ], borrows: [ @@ -2096,14 +2134,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Ethereum', logoUri: 'https://cdn.furucombo.app/assets/img/token/ETH.png', }, - price: '3457.2193', + price: '3268.8', balance: '0', - apy: '0.01188585204208316631', + apy: '0.05229394603017264724', lstApy: '0', - grossApy: '0.01188585204208316631', + grossApy: '0.05229394603017264724', borrowMin: '0', - borrowCap: '9000', - totalBorrow: '5372.829104740948551082', + borrowCap: '18000', + totalBorrow: '17918.81458709516582301', }, { token: { @@ -2114,14 +2152,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Coinbase Wrapped Staked ETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/cbETH.svg', }, - price: '3716.31946174', + price: '3521.23994819', balance: '0', - apy: '0.013253761505633444', - lstApy: '0.0251', - grossApy: '-0.011846238494366556', + apy: '0.03394366521726939601', + lstApy: '0.026', + grossApy: '0.00794366521726939601', borrowMin: '0', - borrowCap: '400', - totalBorrow: '147.126699210177732971', + borrowCap: '800', + totalBorrow: '299.651531148912254813', }, { token: { @@ -2132,14 +2170,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'USD Base Coin', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99979922', + price: '0.99995489', balance: '0', - apy: '0.0945656616008406353', + apy: '0.10493453091657614397', lstApy: '0', - grossApy: '0.0945656616008406353', + grossApy: '0.10493453091657614397', borrowMin: '0', borrowCap: '2000000', - totalBorrow: '1617562.098427', + totalBorrow: '1361803.477555', }, { token: { @@ -2150,14 +2188,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Wrapped liquid staked Ether 2.0', logoUri: 'https://cdn.furucombo.app/assets/img/token/wstETH.png', }, - price: '4048.19847949', + price: '3836.51930042', balance: '0', - apy: '0.01459579611248476891', - lstApy: '0.03', - grossApy: '-0.01540420388751523109', + apy: '0.01796073443296370123', + lstApy: '0.0305', + grossApy: '-0.01253926556703629877', borrowMin: '0', - borrowCap: '400', - totalBorrow: '305.933992929176138221', + borrowCap: '800', + totalBorrow: '475.208925783553810418', }, { token: { @@ -2168,14 +2206,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'USD Coin', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99979922', - balance: '256150.507834', - apy: '0.08626083334597865438', + price: '0.99995489', + balance: '257758.450531', + apy: '0.11243059326145434448', lstApy: '0', - grossApy: '0.08626083334597865438', + grossApy: '0.11243059326145434448', borrowMin: '0', borrowCap: '54000000', - totalBorrow: '25077147.108809', + totalBorrow: '28239186.272687', }, { token: { @@ -2186,14 +2224,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Wrapped eETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/weETH.webp', }, - price: '3601.09712721', + price: '3412.02933107', balance: '0', - apy: '0.04081475463142315469', + apy: '0.02853552845059676438', lstApy: '0', - grossApy: '0.04081475463142315469', + grossApy: '0.02853552845059676438', borrowMin: '0', - borrowCap: '240', - totalBorrow: '240.033659421140054675', + borrowCap: '9000', + totalBorrow: '2813.600534322741807336', }, ], }, @@ -2201,16 +2239,16 @@ describe('Test Aave V3 LendingProtocol', function () { { chainId: common.ChainId.arbitrum, account: '0xccFa0530B9d52f970d1A2dAEa670ce58E4176389', - blockTag: 226000000, + blockTag: 236156735, expected: { chainId: 42161, protocolId: 'aave-v3', marketId: 'arbitrum', utilization: '1', - healthRate: '0.92373319886645237809', - netAPY: '0.05351844805161426993', - totalSupplyUSD: '13822724.6022020401641153257158205', - totalBorrowUSD: '11821543.76300418188881007779992', + healthRate: '0.92416393520027586478', + netAPY: '0.06252796694312336534', + totalSupplyUSD: '13442723.45628058592062845740607994', + totalBorrowUSD: '11491198.8295239557193213412026', supplies: [ { token: { @@ -2221,17 +2259,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Dai Stablecoin', logoUri: 'https://cdn.furucombo.app/assets/img/token/DAI.png', }, - price: '0.9998575', + price: '0.99986706', balance: '0', - apy: '0.08208871277084876253', + apy: '0.05067734015727998499', lstApy: '0', - grossApy: '0.08208871277084876253', + grossApy: '0.05067734015727998499', usageAsCollateralEnabled: true, ltv: '0.63', liquidationThreshold: '0.77', isNotCollateral: false, supplyCap: '50000000', - totalSupply: '11408173.624791716916935195', + totalSupply: '11112757.936606032469260506', }, { token: { @@ -2242,17 +2280,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'ChainLink Token', logoUri: 'https://cdn.furucombo.app/assets/img/token/LINK.svg', }, - price: '13.97788069', + price: '13.435392', balance: '0', - apy: '0.0000845601417804633', + apy: '0.00026969597630532294', lstApy: '0', - grossApy: '0.0000845601417804633', + grossApy: '0.00026969597630532294', usageAsCollateralEnabled: true, ltv: '0.7', liquidationThreshold: '0.775', isNotCollateral: false, supplyCap: '2000000', - totalSupply: '1841003.7021122210388616', + totalSupply: '1938932.949944574410679027', }, { token: { @@ -2263,17 +2301,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Bridged USDC', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99998806', + price: '0.99996231', balance: '0', - apy: '0.07612519528707912269', + apy: '0.05246652555188966765', lstApy: '0', - grossApy: '0.07612519528707912269', + grossApy: '0.05246652555188966765', usageAsCollateralEnabled: true, ltv: '0.75', liquidationThreshold: '0.78', isNotCollateral: false, supplyCap: '26000000', - totalSupply: '11847053.324763', + totalSupply: '11397970.22617', }, { token: { @@ -2284,17 +2322,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Wrapped BTC', logoUri: 'https://cdn.furucombo.app/assets/img/token/WBTC.svg', }, - price: '60987.74456364', + price: '66993', balance: '0', - apy: '0.00033836898438067921', + apy: '0.00041779261653669306', lstApy: '0', - grossApy: '0.00033836898438067921', + grossApy: '0.00041779261653669306', usageAsCollateralEnabled: true, ltv: '0.73', liquidationThreshold: '0.78', isNotCollateral: false, supplyCap: '5000', - totalSupply: '3527.49087676', + totalSupply: '4140.24470092', }, { token: { @@ -2305,17 +2343,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Ethereum', logoUri: 'https://cdn.furucombo.app/assets/img/token/ETH.png', }, - price: '3366.21432', + price: '3265.4074', balance: '0', - apy: '0.02081643680285221447', + apy: '0.0177943286682527797', lstApy: '0', - grossApy: '0.02081643680285221447', + grossApy: '0.0177943286682527797', usageAsCollateralEnabled: true, ltv: '0.825', liquidationThreshold: '0.85', isNotCollateral: false, - supplyCap: '120000', - totalSupply: '86791.276499338226395613', + supplyCap: '140000', + totalSupply: '112595.601953465420767752', }, { token: { @@ -2326,17 +2364,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Tether USD', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDT.svg', }, - price: '0.99971', + price: '0.99981', balance: '0', - apy: '0.0615743234844530917', + apy: '0.057586424528497139', lstApy: '0', - grossApy: '0.0615743234844530917', + grossApy: '0.057586424528497139', usageAsCollateralEnabled: true, ltv: '0.75', liquidationThreshold: '0.78', isNotCollateral: false, supplyCap: '130000000', - totalSupply: '79605767.547391', + totalSupply: '85300231.871868', }, { token: { @@ -2347,7 +2385,7 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Aave Token', logoUri: 'https://cdn.furucombo.app/assets/img/token/AAVE.svg', }, - price: '92.7602255', + price: '102.56118064', balance: '0', apy: '0', lstApy: '0', @@ -2357,7 +2395,7 @@ describe('Test Aave V3 LendingProtocol', function () { liquidationThreshold: '0.65', isNotCollateral: false, supplyCap: '3600', - totalSupply: '3599.938424936449656531', + totalSupply: '3599.835328525975350499', }, { token: { @@ -2368,17 +2406,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Wrapped liquid staked Ether 2.0', logoUri: 'https://cdn.furucombo.app/assets/img/token/wstETH.png', }, - price: '3941.31693746', - balance: '3507.133483944115190425', - apy: '0.00092372220687743929', - lstApy: '0.0302', - grossApy: '0.03112372220687743929', + price: '3832.85184431', + balance: '3507.237952919252507174', + apy: '0.00017379139279767172', + lstApy: '0.0305', + grossApy: '0.03067379139279767172', usageAsCollateralEnabled: true, ltv: '0.7', liquidationThreshold: '0.79', isNotCollateral: false, supplyCap: '69000', - totalSupply: '40546.422127019846558423', + totalSupply: '46066.266266305045969935', }, { token: { @@ -2389,17 +2427,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Rocket Pool ETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/rETH.svg', }, - price: '3735.11403295', + price: '3631.11270861', balance: '0', - apy: '0.00011169941434587345', - lstApy: '0.0282', - grossApy: '0.02831169941434587345', + apy: '0.00041839101377318084', + lstApy: '0.0269', + grossApy: '0.02731839101377318084', usageAsCollateralEnabled: true, ltv: '0.67', liquidationThreshold: '0.74', isNotCollateral: false, supplyCap: '5100', - totalSupply: '3062.350364304856633158', + totalSupply: '3044.688880785124674058', }, { token: { @@ -2410,17 +2448,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'LUSD Stablecoin', logoUri: 'https://cdn.furucombo.app/assets/img/token/LUSD.png', }, - price: '0.99785578', + price: '0.99825326', balance: '0', - apy: '0.05664096233483124825', + apy: '0.03614783227255168938', lstApy: '0', - grossApy: '0.05664096233483124825', + grossApy: '0.03614783227255168938', usageAsCollateralEnabled: false, ltv: '0', liquidationThreshold: '0', isNotCollateral: false, supplyCap: '2200000', - totalSupply: '822797.604027609430529474', + totalSupply: '776252.176957225950812885', }, { token: { @@ -2431,17 +2469,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'USD Coin', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99998806', + price: '0.99996231', balance: '0', - apy: '0.05226028789404342549', + apy: '0.06530252683666000141', lstApy: '0', - grossApy: '0.05226028789404342549', + grossApy: '0.06530252683666000141', usageAsCollateralEnabled: true, ltv: '0.75', liquidationThreshold: '0.78', isNotCollateral: false, supplyCap: '350000000', - totalSupply: '209249787.679936', + totalSupply: '256662240.358968', }, { token: { @@ -2452,17 +2490,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Frax', logoUri: 'https://cdn.furucombo.app/assets/img/token/FRAX.png', }, - price: '0.99765734', + price: '0.99695405', balance: '0', - apy: '0.06110256279233765502', + apy: '0.03970026606487941736', lstApy: '0', - grossApy: '0.06110256279233765502', + grossApy: '0.03970026606487941736', usageAsCollateralEnabled: false, ltv: '0', liquidationThreshold: '0.72', isNotCollateral: false, supplyCap: '7000000', - totalSupply: '316517.473979311206222579', + totalSupply: '293871.49602589090439739', }, { token: { @@ -2473,17 +2511,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Arbitrum', logoUri: 'https://cdn.furucombo.app/assets/img/token/ARB.svg', }, - price: '0.8058999', + price: '0.72849293', balance: '0', - apy: '0.0067410499884729957', + apy: '0.00695738215560293534', lstApy: '0', - grossApy: '0.0067410499884729957', + grossApy: '0.00695738215560293534', usageAsCollateralEnabled: true, ltv: '0.58', liquidationThreshold: '0.63', isNotCollateral: false, supplyCap: '40000000', - totalSupply: '23503929.888702495616932056', + totalSupply: '29437921.521701193640652761', }, { token: { @@ -2494,17 +2532,38 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Wrapped eETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/weETH.webp', }, - price: '3505.74061167', + price: '3408.48807718', balance: '0', - apy: '0.00437232747081290185', + apy: '0.00156027327775300596', lstApy: '0', - grossApy: '0.00437232747081290185', + grossApy: '0.00156027327775300596', usageAsCollateralEnabled: true, ltv: '0.725', liquidationThreshold: '0.75', isNotCollateral: false, - supplyCap: '72000', - totalSupply: '71998.095608425500002209', + supplyCap: '75000', + totalSupply: '74998.929831846973892879', + }, + { + token: { + chainId: 42161, + address: '0x7dfF72693f6A4149b17e7C6314655f6A9F7c8B33', + decimals: 18, + symbol: 'GHO', + name: 'Gho Token', + logoUri: 'https://tokens-data.1inch.io/images/42161/0x7dff72693f6a4149b17e7c6314655f6a9f7c8b33.png', + }, + price: '1', + balance: '0', + apy: '0.07617874625219549412', + lstApy: '0', + grossApy: '0.07617874625219549412', + usageAsCollateralEnabled: false, + ltv: '0', + liquidationThreshold: '0', + isNotCollateral: false, + supplyCap: '1000000', + totalSupply: '398892.612781690837576516', }, ], borrows: [ @@ -2517,14 +2576,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Dai Stablecoin', logoUri: 'https://cdn.furucombo.app/assets/img/token/DAI.png', }, - price: '0.9998575', + price: '0.99986706', balance: '0', - apy: '0.12746338201591346557', + apy: '0.07704823965250571035', lstApy: '0', - grossApy: '0.12746338201591346557', + grossApy: '0.07704823965250571035', borrowMin: '0', borrowCap: '30000000', - totalBorrow: '9739112.200382496057470622', + totalBorrow: '9440176.943928900733561957', }, { token: { @@ -2535,14 +2594,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'ChainLink Token', logoUri: 'https://cdn.furucombo.app/assets/img/token/LINK.svg', }, - price: '13.97788069', + price: '13.435392', balance: '0', - apy: '0.0040630505947190354', + apy: '0.0072673999659724848', lstApy: '0', - grossApy: '0.0040630505947190354', + grossApy: '0.0072673999659724848', borrowMin: '0', borrowCap: '484490', - totalBorrow: '47988.89301186383659566', + totalBorrow: '90257.508867723377139611', }, { token: { @@ -2553,14 +2612,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Bridged USDC', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99998806', + price: '0.99996231', balance: '0', - apy: '0.15517828284278664101', + apy: '0.10308536248850283175', lstApy: '0', - grossApy: '0.15517828284278664101', + grossApy: '0.10308536248850283175', borrowMin: '0', borrowCap: '24000000', - totalBorrow: '5803678.042503', + totalBorrow: '5378372.448157', }, { token: { @@ -2571,14 +2630,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Wrapped BTC', logoUri: 'https://cdn.furucombo.app/assets/img/token/WBTC.svg', }, - price: '60987.74456364', + price: '66993', balance: '0', - apy: '0.00614991785131723621', + apy: '0.00683587247627235593', lstApy: '0', - grossApy: '0.00614991785131723621', + grossApy: '0.00683587247627235593', borrowMin: '0', borrowCap: '1115', - totalBorrow: '243.30776904', + totalBorrow: '317.31659608', }, { token: { @@ -2589,14 +2648,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Ethereum', logoUri: 'https://cdn.furucombo.app/assets/img/token/ETH.png', }, - price: '3366.21432', - balance: '3511.821482300681879581', - apy: '0.02733268635250545031', + price: '3265.4074', + balance: '3519.070493171527607649', + apy: '0.02526406791888361078', lstApy: '0', - grossApy: '0.02733268635250545031', + grossApy: '0.02526406791888361078', borrowMin: '0', - borrowCap: '90000', - totalBorrow: '78015.535244821263653307', + borrowCap: '100000', + totalBorrow: '93646.211643744086503636', }, { token: { @@ -2607,14 +2666,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Tether USD', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDT.svg', }, - price: '0.99971', + price: '0.99981', balance: '0', - apy: '0.08536994805966557939', + apy: '0.07193191139094213039', lstApy: '0', - grossApy: '0.08536994805966557939', + grossApy: '0.07193191139094213039', borrowMin: '0', borrowCap: '120000000', - totalBorrow: '63033577.377647', + totalBorrow: '74673053.135773', }, { token: { @@ -2625,14 +2684,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Wrapped liquid staked Ether 2.0', logoUri: 'https://cdn.furucombo.app/assets/img/token/wstETH.png', }, - price: '3941.31693746', + price: '3832.85184431', balance: '0', - apy: '0.01181619615259605774', - lstApy: '0.0302', - grossApy: '-0.01838380384740394226', + apy: '0.00595882092026221415', + lstApy: '0.0305', + grossApy: '-0.02454117907973778585', borrowMin: '0', borrowCap: '4800', - totalBorrow: '3749.304244214890860355', + totalBorrow: '1585.204512719524966484', }, { token: { @@ -2643,14 +2702,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Rocket Pool ETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/rETH.svg', }, - price: '3735.11403295', + price: '3631.11270861', balance: '0', - apy: '0.00453136182072584484', - lstApy: '0.0282', - grossApy: '-0.02366863817927415516', + apy: '0.0087878038122559985', + lstApy: '0.0269', + grossApy: '-0.0181121961877440015', borrowMin: '0', borrowCap: '1360', - totalBorrow: '89.005379123164626804', + totalBorrow: '171.252525564590539382', }, { token: { @@ -2661,14 +2720,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'LUSD Stablecoin', logoUri: 'https://cdn.furucombo.app/assets/img/token/LUSD.png', }, - price: '0.99785578', + price: '0.99825326', balance: '0', - apy: '0.09201126573568981018', + apy: '0.06189374648850201186', lstApy: '0', - grossApy: '0.09201126573568981018', + grossApy: '0.06189374648850201186', borrowMin: '0', borrowCap: '1800000', - totalBorrow: '643840.638074885805936468', + totalBorrow: '573826.827419300408363021', }, { token: { @@ -2679,14 +2738,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'USD Coin', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99998806', + price: '0.99996231', balance: '0', - apy: '0.07813569893817514567', + apy: '0.08745237299552984751', lstApy: '0', - grossApy: '0.07813569893817514567', + grossApy: '0.08745237299552984751', borrowMin: '0', borrowCap: '320000000', - totalBorrow: '157432625.715443', + totalBorrow: '215198851.390919', }, { token: { @@ -2697,14 +2756,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Frax', logoUri: 'https://cdn.furucombo.app/assets/img/token/FRAX.png', }, - price: '0.99765734', + price: '0.99695405', balance: '0', - apy: '0.0899175620839348554', + apy: '0.06107783096264955101', lstApy: '0', - grossApy: '0.0899175620839348554', + grossApy: '0.06107783096264955101', borrowMin: '0', borrowCap: '5500000', - totalBorrow: '272603.186803783369296721', + totalBorrow: '241264.661216556922907906', }, { token: { @@ -2715,14 +2774,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Arbitrum', logoUri: 'https://cdn.furucombo.app/assets/img/token/ARB.svg', }, - price: '0.8058999', + price: '0.72849293', balance: '0', - apy: '0.0368047453972033863', + apy: '0.03739942174265482974', lstApy: '0', - grossApy: '0.0368047453972033863', + grossApy: '0.03739942174265482974', borrowMin: '0', borrowCap: '16500000', - totalBorrow: '5461253.082004171774666716', + totalBorrow: '6948636.720079167468685306', }, { token: { @@ -2733,14 +2792,32 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Wrapped eETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/weETH.webp', }, - price: '3505.74061167', + price: '3408.48807718', balance: '0', - apy: '0.04063440784213039755', + apy: '0.02409601869592720659', lstApy: '0', - grossApy: '0.04063440784213039755', + grossApy: '0.02409601869592720659', borrowMin: '0', borrowCap: '25000', - totalBorrow: '14339.143300487575428106', + totalBorrow: '8928.904925203289002726', + }, + { + token: { + chainId: 42161, + address: '0x7dfF72693f6A4149b17e7C6314655f6A9F7c8B33', + decimals: 18, + symbol: 'GHO', + name: 'Gho Token', + logoUri: 'https://tokens-data.1inch.io/images/42161/0x7dff72693f6a4149b17e7c6314655f6a9f7c8b33.png', + }, + price: '1', + balance: '0', + apy: '0.1099229488353142868', + lstApy: '0', + grossApy: '0.1099229488353142868', + borrowMin: '0', + borrowCap: '900000', + totalBorrow: '312045.998201832345094477', }, ], }, @@ -2748,16 +2825,16 @@ describe('Test Aave V3 LendingProtocol', function () { { chainId: common.ChainId.optimism, account: '0x7b9CDCC6831796fCcB21b5f7241e2cEd813Efe92', - blockTag: 113571686, + blockTag: 123157473, expected: { chainId: 10, protocolId: 'aave-v3', marketId: 'optimism', - utilization: '1', - healthRate: '0.92207500097807484087', - netAPY: '0.05171424874509312398', - totalSupplyUSD: '7129880.78864845658706943890608614', - totalBorrowUSD: '6185944.3373569923772633536008896', + utilization: '0', + healthRate: 'Infinity', + netAPY: '0', + totalSupplyUSD: '0', + totalBorrowUSD: '0', supplies: [ { token: { @@ -2766,18 +2843,19 @@ describe('Test Aave V3 LendingProtocol', function () { decimals: 18, symbol: 'DAI', name: 'Dai Stablecoin', + logoUri: 'https://cdn.furucombo.app/assets/img/token/DAI.png', }, - price: '1.00002282', + price: '0.99968412', balance: '0', - apy: '0.08029571572141981405', + apy: '0.04151905101421121735', lstApy: '0', - grossApy: '0.08029571572141981405', + grossApy: '0.04151905101421121735', usageAsCollateralEnabled: true, - ltv: '0.78', - liquidationThreshold: '0.83', + ltv: '0.63', + liquidationThreshold: '0.77', isNotCollateral: false, supplyCap: '25000000', - totalSupply: '2585801.985637176281924099', + totalSupply: '3438785.50143242843653221', }, { token: { @@ -2786,38 +2864,19 @@ describe('Test Aave V3 LendingProtocol', function () { decimals: 18, symbol: 'LINK', name: 'ChainLink Token', + logoUri: 'https://cdn.furucombo.app/assets/img/token/LINK.svg', }, - price: '14.64277', + price: '12.83066828', balance: '0', - apy: '0.00031629974871617226', + apy: '0.00022947299990358419', lstApy: '0', - grossApy: '0.00031629974871617226', + grossApy: '0.00022947299990358419', usageAsCollateralEnabled: true, ltv: '0.7', liquidationThreshold: '0.75', isNotCollateral: false, - supplyCap: '210000', - totalSupply: '204117.456638770661150949', - }, - { - token: { - chainId: 10, - address: '0x8c6f28f2F1A3C87F0f938b96d27520d9751ec8d9', - decimals: 18, - symbol: 'sUSD', - name: 'Synth sUSD', - }, - price: '0.99889539', - balance: '0', - apy: '0.02912717500053536556', - lstApy: '0', - grossApy: '0.02912717500053536556', - usageAsCollateralEnabled: true, - ltv: '0.6', - liquidationThreshold: '0.75', - isNotCollateral: false, - supplyCap: '20000000', - totalSupply: '6281520.249974342500361567', + supplyCap: '235000', + totalSupply: '201443.15200911709867884', }, { token: { @@ -2826,18 +2885,19 @@ describe('Test Aave V3 LendingProtocol', function () { decimals: 6, symbol: 'USDC.e', name: 'USD Coin (Bridged from Ethereum)', + logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '1.00000221', + price: '0.99995', balance: '0', - apy: '0.05478173148480717051', + apy: '0.03353420256486209187', lstApy: '0', - grossApy: '0.05478173148480717051', + grossApy: '0.03353420256486209187', usageAsCollateralEnabled: true, - ltv: '0.8', - liquidationThreshold: '0.85', + ltv: '0.75', + liquidationThreshold: '0.8', isNotCollateral: false, - supplyCap: '25000000', - totalSupply: '19231384.088047', + supplyCap: '18000000', + totalSupply: '9511791.967923', }, { token: { @@ -2846,18 +2906,40 @@ describe('Test Aave V3 LendingProtocol', function () { decimals: 8, symbol: 'WBTC', name: 'Wrapped BTC', + logoUri: 'https://cdn.furucombo.app/assets/img/token/WBTC.svg', }, - price: '42472.674242', + price: '64150', balance: '0', - apy: '0.0004181808344552407', + apy: '0.00033142693127474243', lstApy: '0', - grossApy: '0.0004181808344552407', + grossApy: '0.00033142693127474243', usageAsCollateralEnabled: true, ltv: '0.73', liquidationThreshold: '0.78', isNotCollateral: false, supplyCap: '1200', - totalSupply: '509.84485152', + totalSupply: '718.24490673', + }, + { + token: { + chainId: 10, + address: '0x0000000000000000000000000000000000000000', + decimals: 18, + symbol: 'ETH', + name: 'Ethereum', + logoUri: 'https://cdn.furucombo.app/assets/img/token/ETH.png', + }, + price: '3147.2772', + balance: '0', + apy: '0.01898988684333419819', + lstApy: '0', + grossApy: '0.01898988684333419819', + usageAsCollateralEnabled: true, + ltv: '0.8', + liquidationThreshold: '0.825', + isNotCollateral: false, + supplyCap: '35900', + totalSupply: '18168.540706782435274265', }, { token: { @@ -2866,18 +2948,19 @@ describe('Test Aave V3 LendingProtocol', function () { decimals: 6, symbol: 'USDT', name: 'Tether USD', + logoUri: 'https://cdn.furucombo.app/assets/img/token/USDT.svg', }, - price: '0.99976223', + price: '0.99999411', balance: '0', - apy: '0.1155507491940290518', + apy: '0.05194447583936829321', lstApy: '0', - grossApy: '0.1155507491940290518', - usageAsCollateralEnabled: false, + grossApy: '0.05194447583936829321', + usageAsCollateralEnabled: true, ltv: '0.75', - liquidationThreshold: '0.8', + liquidationThreshold: '0.78', isNotCollateral: false, supplyCap: '25000000', - totalSupply: '5923879.53636', + totalSupply: '12245067.927892', }, { token: { @@ -2886,8 +2969,9 @@ describe('Test Aave V3 LendingProtocol', function () { decimals: 18, symbol: 'AAVE', name: 'Aave Token', + logoUri: 'https://cdn.furucombo.app/assets/img/token/AAVE.svg', }, - price: '107.3828', + price: '89.123625', balance: '0', apy: '0', lstApy: '0', @@ -2897,47 +2981,28 @@ describe('Test Aave V3 LendingProtocol', function () { liquidationThreshold: '0.65', isNotCollateral: false, supplyCap: '45000', - totalSupply: '4337.076855148333607792', + totalSupply: '7687.679079424824660974', }, { token: { chainId: 10, - address: '0x0000000000000000000000000000000000000000', + address: '0x8c6f28f2F1A3C87F0f938b96d27520d9751ec8d9', decimals: 18, - symbol: 'ETH', - name: 'Ethereum', + symbol: 'sUSD', + name: 'Synth sUSD', + logoUri: 'https://cdn.furucombo.app/assets/img/token/sUSD.svg', }, - price: '2253.0864232', + price: '0.99934426', balance: '0', - apy: '0.01759972129931819265', + apy: '0.00882571281876570584', lstApy: '0', - grossApy: '0.01759972129931819265', + grossApy: '0.00882571281876570584', usageAsCollateralEnabled: true, - ltv: '0.8', - liquidationThreshold: '0.825', - isNotCollateral: false, - supplyCap: '35900', - totalSupply: '17312.435028802928656026', - }, - { - token: { - chainId: 10, - address: '0x1F32b1c2345538c0c6f582fCB022739c4A194Ebb', - decimals: 18, - symbol: 'wstETH', - name: 'Wrapped liquid staked Ether 2.0', - }, - price: '2591.60640163', - balance: '2751.143377390985329378', - apy: '0.00006280656369123281', - lstApy: '0.0324', - grossApy: '0.03246280656369123281', - usageAsCollateralEnabled: true, - ltv: '0.71', - liquidationThreshold: '0.8', + ltv: '0.6', + liquidationThreshold: '0.7', isNotCollateral: false, - supplyCap: '34500', - totalSupply: '19470.083054554338894097', + supplyCap: '11000000', + totalSupply: '8414662.743441202285178043', }, { token: { @@ -2946,38 +3011,40 @@ describe('Test Aave V3 LendingProtocol', function () { decimals: 18, symbol: 'OP', name: 'Optimism', + logoUri: 'https://cdn.furucombo.app/assets/img/token/OP.svg', }, - price: '2.18156955', + price: '1.67731273', balance: '0', - apy: '0.00033439753394630285', + apy: '0.00098136017709488586', lstApy: '0', - grossApy: '0.00033439753394630285', + grossApy: '0.00098136017709488586', usageAsCollateralEnabled: true, - ltv: '0.3', - liquidationThreshold: '0.4', + ltv: '0.58', + liquidationThreshold: '0.63', isNotCollateral: false, - supplyCap: '10000000', - totalSupply: '4580520.485436663242117524', + supplyCap: '13000000', + totalSupply: '8375842.856531306512204362', }, { token: { chainId: 10, - address: '0x9Bcef72be871e61ED4fBbc7630889beE758eb81D', + address: '0x1F32b1c2345538c0c6f582fCB022739c4A194Ebb', decimals: 18, - symbol: 'rETH', - name: 'Rocket Pool ETH', + symbol: 'wstETH', + name: 'Wrapped liquid staked Ether 2.0', + logoUri: 'https://cdn.furucombo.app/assets/img/token/wstETH.png', }, - price: '2461.68955583', + price: '3693.89063925', balance: '0', - apy: '0.00006157040312459567', - lstApy: '0.0275', - grossApy: '0.02756157040312459567', + apy: '0.00008388334379919762', + lstApy: '0.0305', + grossApy: '0.03058388334379919762', usageAsCollateralEnabled: true, - ltv: '0.67', - liquidationThreshold: '0.74', + ltv: '0.71', + liquidationThreshold: '0.8', isNotCollateral: false, - supplyCap: '6000', - totalSupply: '576.352858191538500054', + supplyCap: '34500', + totalSupply: '21037.044902561018689406', }, { token: { @@ -2986,18 +3053,40 @@ describe('Test Aave V3 LendingProtocol', function () { decimals: 18, symbol: 'LUSD', name: 'LUSD Stablecoin', + logoUri: 'https://cdn.furucombo.app/assets/img/token/LUSD.png', }, - price: '0.99939599', + price: '0.9973155', balance: '0', - apy: '0.10086907307902019713', + apy: '0.03564279499935253107', lstApy: '0', - grossApy: '0.10086907307902019713', + grossApy: '0.03564279499935253107', usageAsCollateralEnabled: false, ltv: '0', liquidationThreshold: '0', isNotCollateral: false, supplyCap: '3000000', - totalSupply: '132938.933841075547543289', + totalSupply: '229789.969422448923938108', + }, + { + token: { + chainId: 10, + address: '0x9Bcef72be871e61ED4fBbc7630889beE758eb81D', + decimals: 18, + symbol: 'rETH', + name: 'Rocket Pool ETH', + logoUri: 'https://cdn.furucombo.app/assets/img/token/rETH.svg', + }, + price: '3499.50535174', + balance: '0', + apy: '0.00013462115254781932', + lstApy: '0.0269', + grossApy: '0.02703462115254781932', + usageAsCollateralEnabled: true, + ltv: '0.67', + liquidationThreshold: '0.74', + isNotCollateral: false, + supplyCap: '6000', + totalSupply: '672.689943348838936392', }, { token: { @@ -3006,18 +3095,19 @@ describe('Test Aave V3 LendingProtocol', function () { decimals: 6, symbol: 'USDC', name: 'USD Coin', + logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '1.00000221', + price: '0.99995', balance: '0', - apy: '0.14230125938934205202', + apy: '0.0737593563772350033', lstApy: '0', - grossApy: '0.14230125938934205202', + grossApy: '0.0737593563772350033', usageAsCollateralEnabled: true, - ltv: '0.8', - liquidationThreshold: '0.85', + ltv: '0.75', + liquidationThreshold: '0.78', isNotCollateral: false, - supplyCap: '25000000', - totalSupply: '1599300.085799', + supplyCap: '50000000', + totalSupply: '37550730.778163', }, ], borrows: [ @@ -3028,15 +3118,16 @@ describe('Test Aave V3 LendingProtocol', function () { decimals: 18, symbol: 'DAI', name: 'Dai Stablecoin', + logoUri: 'https://cdn.furucombo.app/assets/img/token/DAI.png', }, - price: '1.00002282', + price: '0.99968412', balance: '0', - apy: '0.10214629003321339804', + apy: '0.06470731442687866421', lstApy: '0', - grossApy: '0.10214629003321339804', + grossApy: '0.06470731442687866421', borrowMin: '0', borrowCap: '16000000', - totalBorrow: '2198806.672716259158323742', + totalBorrow: '2901736.767085007637437439', }, { token: { @@ -3045,32 +3136,16 @@ describe('Test Aave V3 LendingProtocol', function () { decimals: 18, symbol: 'LINK', name: 'ChainLink Token', + logoUri: 'https://cdn.furucombo.app/assets/img/token/LINK.svg', }, - price: '14.64277', + price: '12.83066828', balance: '0', - apy: '0.00787257455741770749', + apy: '0.00670177554605690237', lstApy: '0', - grossApy: '0.00787257455741770749', + grossApy: '0.00670177554605690237', borrowMin: '0', borrowCap: '84000', - totalBorrow: '10289.83331713380027938', - }, - { - token: { - chainId: 10, - address: '0x8c6f28f2F1A3C87F0f938b96d27520d9751ec8d9', - decimals: 18, - symbol: 'sUSD', - name: 'Synth sUSD', - }, - price: '0.99889539', - balance: '0', - apy: '0.04566415286176893977', - lstApy: '0', - grossApy: '0.04566415286176893977', - borrowMin: '0', - borrowCap: '13000000', - totalBorrow: '4487774.83306114914761885', + totalBorrow: '8649.807567015845946574', }, { token: { @@ -3079,15 +3154,16 @@ describe('Test Aave V3 LendingProtocol', function () { decimals: 6, symbol: 'USDC.e', name: 'USD Coin (Bridged from Ethereum)', + logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '1.00000221', + price: '0.99995', balance: '0', - apy: '0.078596936193978136', + apy: '0.05848004824815891039', lstApy: '0', - grossApy: '0.078596936193978136', + grossApy: '0.05848004824815891039', borrowMin: '0', - borrowCap: '20000000', - totalBorrow: '16065042.364108', + borrowCap: '15500000', + totalBorrow: '6404935.232582', }, { token: { @@ -3096,15 +3172,34 @@ describe('Test Aave V3 LendingProtocol', function () { decimals: 8, symbol: 'WBTC', name: 'Wrapped BTC', + logoUri: 'https://cdn.furucombo.app/assets/img/token/WBTC.svg', }, - price: '42472.674242', + price: '64150', balance: '0', - apy: '0.00683905789364176548', + apy: '0.00608632238269864622', lstApy: '0', - grossApy: '0.00683905789364176548', + grossApy: '0.00608632238269864622', borrowMin: '0', borrowCap: '250', - totalBorrow: '39.09363874', + totalBorrow: '49.03002938', + }, + { + token: { + chainId: 10, + address: '0x0000000000000000000000000000000000000000', + decimals: 18, + symbol: 'ETH', + name: 'Ethereum', + logoUri: 'https://cdn.furucombo.app/assets/img/token/ETH.png', + }, + price: '3147.2772', + balance: '0', + apy: '0.02610201087749982363', + lstApy: '0', + grossApy: '0.02610201087749982363', + borrowMin: '0', + borrowCap: '19745', + totalBorrow: '15605.645048245605637611', }, { token: { @@ -3113,66 +3208,70 @@ describe('Test Aave V3 LendingProtocol', function () { decimals: 6, symbol: 'USDT', name: 'Tether USD', + logoUri: 'https://cdn.furucombo.app/assets/img/token/USDT.svg', }, - price: '0.99976223', + price: '0.99999411', balance: '0', - apy: '0.14946330461076310507', + apy: '0.06597171963728436113', lstApy: '0', - grossApy: '0.14946330461076310507', + grossApy: '0.06597171963728436113', borrowMin: '0', borrowCap: '16000000', - totalBorrow: '5008876.169012', + totalBorrow: '10444091.635555', }, { token: { chainId: 10, - address: '0x0000000000000000000000000000000000000000', + address: '0x8c6f28f2F1A3C87F0f938b96d27520d9751ec8d9', decimals: 18, - symbol: 'ETH', - name: 'Ethereum', + symbol: 'sUSD', + name: 'Synth sUSD', + logoUri: 'https://cdn.furucombo.app/assets/img/token/sUSD.svg', }, - price: '2253.0864232', - balance: '2745.542414023895564728', - apy: '0.02952515678478624892', + price: '0.99934426', + balance: '0', + apy: '0.03032424249074175057', lstApy: '0', - grossApy: '0.02952515678478624892', + grossApy: '0.03032424249074175057', borrowMin: '0', - borrowCap: '19745', - totalBorrow: '12212.252255057979726948', + borrowCap: '10000000', + totalBorrow: '3094573.884335714240510606', }, { token: { chainId: 10, - address: '0x1F32b1c2345538c0c6f582fCB022739c4A194Ebb', + address: '0x4200000000000000000000000000000000000042', decimals: 18, - symbol: 'wstETH', - name: 'Wrapped liquid staked Ether 2.0', + symbol: 'OP', + name: 'Optimism', + logoUri: 'https://cdn.furucombo.app/assets/img/token/OP.svg', }, - price: '2591.60640163', + price: '1.67731273', balance: '0', - apy: '0.00425087768018463859', - lstApy: '0.0324', - grossApy: '-0.02814912231981536141', + apy: '0.01390617898190495756', + lstApy: '0', + grossApy: '0.01390617898190495756', borrowMin: '0', - borrowCap: '1500', - totalBorrow: '339.143213014800666487', + borrowCap: '1300000', + totalBorrow: '743617.934302150178707528', }, { token: { chainId: 10, - address: '0x9Bcef72be871e61ED4fBbc7630889beE758eb81D', + address: '0x1F32b1c2345538c0c6f582fCB022739c4A194Ebb', decimals: 18, - symbol: 'rETH', - name: 'Rocket Pool ETH', + symbol: 'wstETH', + name: 'Wrapped liquid staked Ether 2.0', + logoUri: 'https://cdn.furucombo.app/assets/img/token/wstETH.png', }, - price: '2461.68955583', + price: '3693.89063925', balance: '0', - apy: '0.00336234068910269273', - lstApy: '0.0275', - grossApy: '-0.02413765931089730727', + apy: '0.00464167335866774621', + lstApy: '0.0305', + grossApy: '-0.02585832664133225379', borrowMin: '0', - borrowCap: '720', - totalBorrow: '12.437007329155728376', + borrowCap: '1500', + totalBorrow: '448.285669099180991439', }, { token: { @@ -3181,15 +3280,34 @@ describe('Test Aave V3 LendingProtocol', function () { decimals: 18, symbol: 'LUSD', name: 'LUSD Stablecoin', + logoUri: 'https://cdn.furucombo.app/assets/img/token/LUSD.png', }, - price: '0.99939599', + price: '0.9973155', balance: '0', - apy: '0.13934785921335083626', + apy: '0.0614545492271973017', lstApy: '0', - grossApy: '0.13934785921335083626', + grossApy: '0.0614545492271973017', borrowMin: '0', borrowCap: '1210000', - totalBorrow: '108812.761681151745153015', + totalBorrow: '168698.778387885543106154', + }, + { + token: { + chainId: 10, + address: '0x9Bcef72be871e61ED4fBbc7630889beE758eb81D', + decimals: 18, + symbol: 'rETH', + name: 'Rocket Pool ETH', + logoUri: 'https://cdn.furucombo.app/assets/img/token/rETH.svg', + }, + price: '3499.50535174', + balance: '0', + apy: '0.00497569282824848995', + lstApy: '0.0269', + grossApy: '-0.02192430717175151005', + borrowMin: '0', + borrowCap: '720', + totalBorrow: '21.463717450406484612', }, { token: { @@ -3198,15 +3316,16 @@ describe('Test Aave V3 LendingProtocol', function () { decimals: 6, symbol: 'USDC', name: 'USD Coin', + logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '1.00000221', + price: '0.99995', balance: '0', - apy: '0.17412319034353027801', + apy: '0.0929966347570889436', lstApy: '0', - grossApy: '0.17412319034353027801', + grossApy: '0.0929966347570889436', borrowMin: '0', - borrowCap: '20000000', - totalBorrow: '1473203.598876', + borrowCap: '40000000', + totalBorrow: '33394100.307973', }, ], }, @@ -3643,16 +3762,16 @@ describe('Test Aave V3 LendingProtocol', function () { { chainId: common.ChainId.metis, account: '0x6859dA14835424957a1E6B397D8026B1D9fF7e1E', - blockTag: 17000000, + blockTag: 17800000, expected: { chainId: 1088, protocolId: 'aave-v3', marketId: 'metis', - utilization: '0.99909751218653930308', - healthRate: '1.05472859140437163989', - netAPY: '-0.00798447531539906177', - totalSupplyUSD: '7120116.45922664748192', - totalBorrowUSD: '5609952.94820009350092', + utilization: '0.99467586953231476346', + healthRate: '1.05353091057858318134', + netAPY: '-0.01833552648716129625', + totalSupplyUSD: '2694736.43108477475597', + totalBorrowUSD: '2093789.39988632430037', supplies: [ { token: { @@ -3663,38 +3782,37 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'DAI Token', logoUri: 'https://cdn.furucombo.app/assets/img/token/DAI.png', }, - price: '0.99979847', + price: '0.99987377', balance: '0', - apy: '0.07686739216443117104', + apy: '0.03954569739522100471', lstApy: '0', - grossApy: '0.07686739216443117104', + grossApy: '0.03954569739522100471', usageAsCollateralEnabled: true, ltv: '0.63', liquidationThreshold: '0.77', isNotCollateral: false, supplyCap: '1240000', - totalSupply: '791772.828254762449943579', + totalSupply: '769734.361036019818046414', }, { token: { chainId: 1088, address: '0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000', decimals: 18, - symbol: 'METIS(ERC20)', - name: 'Metis ERC20', - logoUri: 'https://cdn.furucombo.app/assets/img/token/METIS.svg', + symbol: 'Metis', + name: 'Metis Token', }, - price: '61.64469171', + price: '50.3441782', balance: '0', - apy: '0.00002427458317697214', + apy: '0.00051666594647010714', lstApy: '0', - grossApy: '0.00002427458317697214', + grossApy: '0.00051666594647010714', usageAsCollateralEnabled: false, ltv: '0', liquidationThreshold: '0', isNotCollateral: false, supplyCap: '600000', - totalSupply: '251948.236280438640969547', + totalSupply: '229838.397296662202003483', }, { token: { @@ -3705,17 +3823,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'USDC Token', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99999713', - balance: '4417704.749184', - apy: '0.04232103994685542949', + price: '0.99993079', + balance: '1001723.492367', + apy: '0.02821583020336951645', lstApy: '0', - grossApy: '0.04232103994685542949', + grossApy: '0.02821583020336951645', usageAsCollateralEnabled: true, ltv: '0.8', liquidationThreshold: '0.85', isNotCollateral: false, supplyCap: '14500000', - totalSupply: '11518899.661039', + totalSupply: '9377262.719774', }, { token: { @@ -3726,17 +3844,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'USDT Token', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDT.svg', }, - price: '0.99966', - balance: '2703343.525654', - apy: '0.04853454160748589713', + price: '1.00022148', + balance: '1692707.367173', + apy: '0.04222534320271481098', lstApy: '0', - grossApy: '0.04853454160748589713', + grossApy: '0.04222534320271481098', usageAsCollateralEnabled: true, ltv: '0.77', liquidationThreshold: '0.8', isNotCollateral: false, supplyCap: '12000000', - totalSupply: '8205168.81531', + totalSupply: '6879232.210414', }, { token: { @@ -3747,17 +3865,17 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Ether', logoUri: 'https://cdn.furucombo.app/assets/img/token/WETH.svg', }, - price: '3031.03483831', + price: '3443.48', balance: '0', - apy: '0.00150594498067634552', + apy: '0.00229449692940302402', lstApy: '0', - grossApy: '0.00150594498067634552', + grossApy: '0.00229449692940302402', usageAsCollateralEnabled: true, ltv: '0.8', liquidationThreshold: '0.825', isNotCollateral: false, - supplyCap: '1800', - totalSupply: '1507.929756759060691014', + supplyCap: '2300', + totalSupply: '862.700237428055253287', }, ], borrows: [ @@ -3770,32 +3888,31 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'DAI Token', logoUri: 'https://cdn.furucombo.app/assets/img/token/DAI.png', }, - price: '0.99979847', + price: '0.99987377', balance: '0', - apy: '0.12901999840775093085', + apy: '0.06958042989809227889', lstApy: '0', - grossApy: '0.12901999840775093085', + grossApy: '0.06958042989809227889', borrowMin: '0', borrowCap: '1110000', - totalBorrow: '647863.500346221036907754', + totalBorrow: '591936.043278890020970995', }, { token: { chainId: 1088, address: '0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000', decimals: 18, - symbol: 'METIS(ERC20)', - name: 'Metis ERC20', - logoUri: 'https://cdn.furucombo.app/assets/img/token/METIS.svg', + symbol: 'Metis', + name: 'Metis Token', }, - price: '61.64469171', + price: '50.3441782', balance: '0', - apy: '0.00210991186613756314', + apy: '0.009770011613394291', lstApy: '0', - grossApy: '0.00210991186613756314', + grossApy: '0.009770011613394291', borrowMin: '0', borrowCap: '32000', - totalBorrow: '3413.804675599478583504', + totalBorrow: '14365.456367917835355862', }, { token: { @@ -3806,14 +3923,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'USDC Token', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', }, - price: '0.99999713', - balance: '3014469.305484', - apy: '0.05697485744797950244', + price: '0.99993079', + balance: '801396.633343', + apy: '0.04644587371660305242', lstApy: '0', - grossApy: '0.05697485744797950244', + grossApy: '0.04644587371660305242', borrowMin: '0', borrowCap: '13000000', - totalBorrow: '9587263.843333', + totalBorrow: '6386005.486247', }, { token: { @@ -3824,14 +3941,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'USDT Token', logoUri: 'https://cdn.furucombo.app/assets/img/token/USDT.svg', }, - price: '0.99966', - balance: '2596375.061764', - apy: '0.06104107845388223526', + price: '1.00022148', + balance: '1292162.043155', + apy: '0.05690995688059505913', lstApy: '0', - grossApy: '0.06104107845388223526', + grossApy: '0.05690995688059505913', borrowMin: '0', borrowCap: '11000000', - totalBorrow: '7306911.332526', + totalBorrow: '5711617.026853', }, { token: { @@ -3842,14 +3959,14 @@ describe('Test Aave V3 LendingProtocol', function () { name: 'Ether', logoUri: 'https://cdn.furucombo.app/assets/img/token/WETH.svg', }, - price: '3031.03483831', + price: '3443.48', balance: '0', - apy: '0.01556461919948366662', + apy: '0.01589536887841909803', lstApy: '0', - grossApy: '0.01556461919948366662', + grossApy: '0.01589536887841909803', borrowMin: '0', borrowCap: '720', - totalBorrow: '172.887582749427035671', + totalBorrow: '147.499671820604510921', }, ], }, diff --git a/packages/lending/src/protocols/aave-v3/lending-protocol.ts b/packages/lending/src/protocols/aave-v3/lending-protocol.ts index ceb9671..56dc035 100644 --- a/packages/lending/src/protocols/aave-v3/lending-protocol.ts +++ b/packages/lending/src/protocols/aave-v3/lending-protocol.ts @@ -18,15 +18,7 @@ import { SupplyParams, WithdrawParams, } from 'src/protocol.type'; -import { - DISPLAY_NAME, - ID, - Reserve, - getContractAddress, - isBorrowEnabled, - isSupplyEnabled, - supportedChainIds, -} from './configs'; +import { DISPLAY_NAME, ID, ReserveMap, ReserveTokens, getContractAddress, supportedChainIds } from './configs'; import { PoolDataProviderInterface } from './contracts/PoolDataProvider'; import { Portfolio } from 'src/protocol.portfolio'; import { Protocol } from 'src/protocol'; @@ -46,8 +38,8 @@ export class LendingProtocol extends Protocol { readonly name = DISPLAY_NAME; readonly market: Market; - private reserves: logics.aavev3.ReserveTokens[] = []; - private reserveMap: Record = {}; + private reserveTokens: ReserveTokens[] = []; + private reserveMap: ReserveMap = {}; private hasNativeToken = false; constructor(chainId: number, provider?: providers.Provider) { @@ -63,23 +55,25 @@ export class LendingProtocol extends Protocol { async initializeReservesConfig() { const service = new logics.aavev3.Service(this.chainId, this.provider); - const reserves = await service.getReserveTokens(); - const reserveMap: Record = {}; + const { reserveTokens } = await service.getReserveTokens(); + + const reserveMap: ReserveMap = {}; let hasNativeToken = false; - for (const { asset, aToken, stableDebtToken, variableDebtToken } of reserves) { + for (const reserveToken of reserveTokens) { + const { asset, aToken } = reserveToken; if (asset.isNative) hasNativeToken = true; if (asset.isWrapped) { - reserveMap[asset.unwrapped.address] = { aToken, asset }; - reserves.push({ asset: asset.unwrapped, aToken, stableDebtToken, variableDebtToken }); + reserveMap[asset.unwrapped.address] = reserveToken; + reserveTokens.push({ ...reserveToken, asset: asset.unwrapped }); } - reserveMap[asset.address] = { aToken, asset }; - reserveMap[aToken.address] = { aToken, asset }; + reserveMap[asset.address] = reserveToken; + reserveMap[aToken.address] = reserveToken; } - this.reserves = reserves; + this.reserveTokens = reserveTokens; this.reserveMap = reserveMap; this.hasNativeToken = hasNativeToken; } @@ -132,32 +126,26 @@ export class LendingProtocol extends Protocol { return this._aTokenIface; } - private _tokensForDeposit?: common.Token[]; + private _supplyTokenList?: common.Token[]; - async getTokensForDeposit() { - if (!this._tokensForDeposit) { + async getSupplyTokenList() { + if (!this._supplyTokenList) { const tokenList = await apisdk.protocols.aavev3.getSupplyTokenList(this.chainId); - const tokens = tokenList.filter((tokens) => isSupplyEnabled(this.chainId, tokens[0])).map((tokens) => tokens[0]); - - this._tokensForDeposit = tokens; + this._supplyTokenList = tokenList.map((tokens) => tokens[0]); } - return this._tokensForDeposit; + return this._supplyTokenList; } - private _tokensForBorrow?: common.Token[]; - - async getTokensForBorrow() { - if (!this._tokensForBorrow) { - const tokenList = await apisdk.protocols.aavev3.getBorrowTokenList(this.chainId); - - const tokens = tokenList.filter((token) => isBorrowEnabled(this.chainId, token)); + private _borrowTokenList?: common.Token[]; - this._tokensForBorrow = tokens; + async getBorrowTokenList() { + if (!this._borrowTokenList) { + this._borrowTokenList = await apisdk.protocols.aavev3.getBorrowTokenList(this.chainId); } - return this._tokensForBorrow; + return this._borrowTokenList; } getMarketName() { @@ -184,7 +172,7 @@ export class LendingProtocol extends Protocol { async getReserveDataMap() { if (!this._reserveDataMap) { const calls: common.Multicall3.CallStruct[] = []; - for (const { asset } of this.reserves) { + for (const { asset } of this.reserveTokens) { calls.push({ target: this.poolDataProvider.address, callData: this.poolDataProviderIface.encodeFunctionData('getReserveConfigurationData', [ @@ -208,7 +196,7 @@ export class LendingProtocol extends Protocol { this._reserveDataMap = {}; let j = 0; - for (const { asset } of this.reserves) { + for (const { asset } of this.reserveTokens) { const { ltv, liquidationThreshold, usageAsCollateralEnabled } = this.poolDataProviderIface.decodeFunctionResult( 'getReserveConfigurationData', returnData[j] @@ -251,12 +239,12 @@ export class LendingProtocol extends Protocol { } async getAssetPriceMap() { - const assetAddresses = this.reserves.map(({ asset }) => asset.wrapped.address); + const assetAddresses = this.reserveTokens.map(({ asset }) => asset.wrapped.address); const assetPrices = await this.priceOracle.getAssetsPrices(assetAddresses, { blockTag: this.blockTag }); const assetPriceMap: Record = {}; for (let i = 0; i < assetAddresses.length; i++) { - assetPriceMap[this.reserves[i].asset.address] = common.toBigUnit(assetPrices[i], 8); + assetPriceMap[this.reserveTokens[i].asset.address] = common.toBigUnit(assetPrices[i], 8); } return assetPriceMap; @@ -264,7 +252,7 @@ export class LendingProtocol extends Protocol { async getUserBalancesMap(account: string) { const calls: common.Multicall3.CallStruct[] = []; - for (const { asset, aToken } of this.reserves) { + for (const { asset, aToken } of this.reserveTokens) { calls.push({ target: aToken.address, callData: this.aTokenIface.encodeFunctionData('scaledBalanceOf', [account]), @@ -287,8 +275,8 @@ export class LendingProtocol extends Protocol { } > = {}; let j = 0; - for (let i = 0; i < this.reserves.length; i++) { - const { asset } = this.reserves[i]; + for (let i = 0; i < this.reserveTokens.length; i++) { + const { asset } = this.reserveTokens[i]; const { liquidityIndex } = reserveDataMap[asset.address]; const [scaledBalance] = this.aTokenIface.decodeFunctionResult('scaledBalanceOf', returnData[j]); @@ -318,12 +306,12 @@ export class LendingProtocol extends Protocol { const assetPriceMap = await this.getAssetPriceMap(); const userBalancesMap = await this.getUserBalancesMap(account); const lstTokenAPYMap = await this.getLstTokenAPYMap(this.chainId); - const tokensForDeposit = await this.getTokensForDeposit(); - const tokensForBorrow = await this.getTokensForBorrow(); + const supplyTokenList = await this.getSupplyTokenList(); + const borrowTokenList = await this.getBorrowTokenList(); const supplies: SupplyObject[] = []; - for (const token of tokensForDeposit) { + for (const token of supplyTokenList) { if (this.hasNativeToken && token.isWrapped) continue; const reserveData = reserveDataMap[token.address]; @@ -360,7 +348,7 @@ export class LendingProtocol extends Protocol { } const borrows: BorrowObject[] = []; - for (const token of tokensForBorrow) { + for (const token of borrowTokenList) { if (this.hasNativeToken && token.isWrapped) continue; const { borrowAPY: apy, borrowCap, totalBorrow } = reserveDataMap[token.address]; diff --git a/packages/lending/src/protocols/morphoblue/adapter.test.ts b/packages/lending/src/protocols/morphoblue/adapter.test.ts index d5c1934..102c4d2 100644 --- a/packages/lending/src/protocols/morphoblue/adapter.test.ts +++ b/packages/lending/src/protocols/morphoblue/adapter.test.ts @@ -273,7 +273,7 @@ describe('Test Adapter for Morpho Blue', async function () { // leverage only have one scenario - leverage by collateral token context('Test leverageByCollateral', function () { const account = '0x9edcb464C0AfdD01a5Ffbd09309b437C7dadeAB3'; - const blockTag = 20180000; + const blockTag = 20380000; let portfolio: Portfolio; diff --git a/packages/lending/src/protocols/radiant-v2/adapter.test.ts b/packages/lending/src/protocols/radiant-v2/adapter.test.ts index dc4883d..82f36b1 100644 --- a/packages/lending/src/protocols/radiant-v2/adapter.test.ts +++ b/packages/lending/src/protocols/radiant-v2/adapter.test.ts @@ -8,7 +8,7 @@ import { mainnetTokens } from './tokens'; describe('Test Adapter for Radiant V2', async function () { const chainId = common.ChainId.mainnet; - const blockTag = 20150000; + const blockTag = 20370000; let adapter: Adapter; let protocol: LendingProtocol; @@ -20,7 +20,7 @@ describe('Test Adapter for Radiant V2', async function () { context('Test openByCollateral', function () { const account = '0x9edcb464C0AfdD01a5Ffbd09309b437C7dadeAB3'; - const blockTag = 20150000; + const blockTag = 20370000; let portfolio: Portfolio; @@ -113,7 +113,7 @@ describe('Test Adapter for Radiant V2', async function () { context('Test openByDebt', function () { const account = '0xBBaCb7F97BA96aa90E5603CFb47EaE09517C8731'; - const blockTag = 20150000; + const blockTag = 20370000; let portfolio: Portfolio; @@ -205,7 +205,7 @@ describe('Test Adapter for Radiant V2', async function () { }); context('Test close', function () { - const blockTag = 20150000; + const blockTag = 20370000; let portfolio: Portfolio; @@ -243,18 +243,18 @@ describe('Test Adapter for Radiant V2', async function () { expect(afterPortfolio.totalBorrowUSD).to.be.eq(0); expect(afterPortfolio.totalSupplyUSD).to.be.eq(0); - expect(logics).has.length(21); + expect(logics).has.length(18); expect(logics[0].rid).to.eq('permit2:pull-token'); expect(logics[1].rid).to.eq('radiant-v2:withdraw'); expect(logics[1].fields.balanceBps).to.eq(common.BPS_BASE); - expect(logics[2].rid).to.contain('swap-token'); - expect(logics[3].rid).to.eq('permit2:pull-token'); - expect(logics[4].rid).to.eq('radiant-v2:withdraw'); - expect(logics[4].fields.balanceBps).to.eq(common.BPS_BASE); - expect(logics[5].rid).to.contain('swap-token'); - expect(logics[6].rid).to.eq('permit2:pull-token'); - expect(logics[7].rid).to.eq('radiant-v2:withdraw'); - expect(logics[7].fields.balanceBps).to.eq(common.BPS_BASE); + expect(logics[2].rid).to.eq('permit2:pull-token'); + expect(logics[3].rid).to.eq('radiant-v2:withdraw'); + expect(logics[3].fields.balanceBps).to.eq(common.BPS_BASE); + expect(logics[4].rid).to.contain('swap-token'); + expect(logics[5].rid).to.eq('permit2:pull-token'); + expect(logics[6].rid).to.eq('radiant-v2:withdraw'); + expect(logics[6].fields.balanceBps).to.eq(common.BPS_BASE); + expect(logics[7].rid).to.contain('swap-token'); expect(logics[8].rid).to.eq('permit2:pull-token'); expect(logics[9].rid).to.eq('radiant-v2:withdraw'); expect(logics[9].fields.balanceBps).to.eq(common.BPS_BASE); @@ -267,11 +267,7 @@ describe('Test Adapter for Radiant V2', async function () { expect(logics[15].rid).to.eq('radiant-v2:withdraw'); expect(logics[15].fields.balanceBps).to.eq(common.BPS_BASE); expect(logics[16].rid).to.contain('swap-token'); - expect(logics[17].rid).to.eq('permit2:pull-token'); - expect(logics[18].rid).to.eq('radiant-v2:withdraw'); - expect(logics[18].fields.balanceBps).to.eq(common.BPS_BASE); - expect(logics[19].rid).to.contain('swap-token'); - expect(logics[20].rid).to.contain('utility:wrapped-native-token'); + expect(logics[17].rid).to.contain('utility:wrapped-native-token'); }); it('success - collateral positions only', async function () { @@ -707,7 +703,7 @@ describe('Test Adapter for Radiant V2', async function () { let portfolio: Portfolio; before(async function () { - protocol.setBlockTag(20150000); + protocol.setBlockTag(20380000); portfolio = await protocol.getPortfolio(account); }); @@ -757,7 +753,7 @@ describe('Test Adapter for Radiant V2', async function () { }); it('insufficient dest collateral balance', async function () { - const srcToken = mainnetTokens.wstETH; + const srcToken = mainnetTokens.ETH; const destToken = mainnetTokens.USDC; const destCollateral = portfolio.findSupply(destToken)!; diff --git a/packages/lending/src/protocols/radiant-v2/configs.ts b/packages/lending/src/protocols/radiant-v2/configs.ts index 927ac88..d1c16e7 100644 --- a/packages/lending/src/protocols/radiant-v2/configs.ts +++ b/packages/lending/src/protocols/radiant-v2/configs.ts @@ -1,14 +1,11 @@ -import { arbitrumTokens } from './tokens'; import * as common from '@protocolink/common'; import * as logics from '@protocolink/logics'; export const ID = 'radiant-v2'; export const DISPLAY_NAME = 'Radiant V2'; -export interface Reserve { - asset: common.Token; - rToken: common.Token; -} +export type ReserveTokens = logics.radiantv2.ReserveTokens; +export type ReserveMap = Record; type ContractName = 'ProtocolDataProvider' | 'PriceOracle'; @@ -47,23 +44,3 @@ export function getContractAddress(chainId: number, name: ContractName) { const { contractMap } = configs.find((configs) => configs.chainId === chainId)!; return contractMap[name]; } - -const supplyDisabledMap: Record = { - [common.ChainId.mainnet]: [], - [common.ChainId.bnb]: [], - [common.ChainId.arbitrum]: [], -}; - -const borrowDisabledMap: Record = { - [common.ChainId.mainnet]: [], - [common.ChainId.bnb]: [], - [common.ChainId.arbitrum]: [arbitrumTokens.gmETH.address, arbitrumTokens.gmBTC.address], -}; - -export const isSupplyEnabled = (chainId: number, token: common.Token) => { - return !supplyDisabledMap[chainId].includes(token.address); -}; - -export const isBorrowEnabled = (chainId: number, token: common.Token) => { - return !borrowDisabledMap[chainId].includes(token.address); -}; diff --git a/packages/lending/src/protocols/radiant-v2/lending-protocol.test.ts b/packages/lending/src/protocols/radiant-v2/lending-protocol.test.ts index 23f7dac..9a0c590 100644 --- a/packages/lending/src/protocols/radiant-v2/lending-protocol.test.ts +++ b/packages/lending/src/protocols/radiant-v2/lending-protocol.test.ts @@ -1,10 +1,9 @@ -import { JsonRpcProvider } from '@ethersproject/providers'; import { LendingProtocol } from './lending-protocol'; import { Portfolio } from 'src/protocol.portfolio'; -import { arbitrumTokens, bnbTokens, mainnetTokens } from './tokens'; import * as common from '@protocolink/common'; import { expect } from 'chai'; import { filterPortfolio } from 'src/protocol.utils'; +import { mainnetTokens } from './tokens'; describe('Test Radiant V2 LendingProtocol', function () { context('Test getPortfolio', function () { @@ -198,149 +197,252 @@ describe('Test Radiant V2 LendingProtocol', function () { { chainId: common.ChainId.bnb, account: '0xA15aEF397F9Dc9dE23C8e3Df8A289B21D4cA8fCD', - blockTag: 38738990, + blockTag: 40750000, expected: { chainId: 56, protocolId: 'radiant-v2', marketId: 'bnb', utilization: '1', - healthRate: '1.03627738230590567017', - totalSupplyUSD: '7113376.792946228696130057217', - totalBorrowUSD: '5148266.94649033938170577969', + healthRate: '1.04397149107568892179', + netAPY: '-0.14511936117721748453', + totalSupplyUSD: '5420653.9101024398073132710459', + totalBorrowUSD: '3894254.2658896485547761754501', supplies: [ { - token: bnbTokens.BTCB, - price: '62129.33', - balance: '114.493054935484124489', - apy: '0.0018842556485471865', + token: { + chainId: 56, + address: '0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c', + decimals: 18, + symbol: 'BTCB', + name: 'BTCB Token', + logoUri: 'https://cdn.furucombo.app/assets/img/token/WBTC.svg', + }, + price: '66423.8747', + balance: '81.607011551592827365', + apy: '0.00743715701231068815', + lstApy: '0', + grossApy: '0.00743715701231068815', usageAsCollateralEnabled: true, ltv: '0.7', liquidationThreshold: '0.75', isNotCollateral: false, supplyCap: '0', - totalSupply: '1084.102838189283152716', + totalSupply: '314.713276593408263741', }, { - token: bnbTokens.USDT, - price: '0.99970008', + token: { + chainId: 56, + address: '0x55d398326f99059fF775485246999027B3197955', + decimals: 18, + symbol: 'USDT', + name: 'Tether USD', + logoUri: 'https://cdn.furucombo.app/assets/img/token/USDT.svg', + }, + price: '1.00009', balance: '0', - apy: '0.02809968318672521642', + apy: '0.02693578345076532001', + lstApy: '0', + grossApy: '0.02693578345076532001', usageAsCollateralEnabled: true, ltv: '0.8', liquidationThreshold: '0.85', isNotCollateral: false, supplyCap: '0', - totalSupply: '9582650.310842046916079284', + totalSupply: '5281559.447581482359161025', }, { - token: bnbTokens.USDC, - price: '1.000018', + token: { + chainId: 56, + address: '0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d', + decimals: 18, + symbol: 'USDC', + name: 'Binance-Peg USD Coin', + logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', + }, + price: '0.99999', balance: '0', - apy: '0.01251803618013794467', + apy: '0.0262962471792050187', + lstApy: '0', + grossApy: '0.0262962471792050187', usageAsCollateralEnabled: true, ltv: '0.8', liquidationThreshold: '0.85', isNotCollateral: false, supplyCap: '0', - totalSupply: '1311271.707413182088378375', + totalSupply: '611805.710651091785850711', }, { - token: bnbTokens.ETH, - price: '2907.3027', - balance: '0.000000000656295226', - apy: '0.00677823374176924093', + token: { + chainId: 56, + address: '0x2170Ed0880ac9A755fd29B2688956BD959F933F8', + decimals: 18, + symbol: 'ETH', + name: 'Binance-Peg Ethereum Token', + logoUri: 'https://cdn.furucombo.app/assets/img/token/ETH.png', + }, + price: '3461.01', + balance: '0.000000000657194888', + apy: '0.00352224184639154924', + lstApy: '0', + grossApy: '0.00352224184639154924', usageAsCollateralEnabled: true, ltv: '0.8', liquidationThreshold: '0.825', isNotCollateral: false, supplyCap: '0', - totalSupply: '1118.474147562476422245', + totalSupply: '855.67953711314166328', }, { - token: bnbTokens.BNB, - price: '566.5998', - balance: '0.000000263852488316', - apy: '0.03966107938030156714', + token: { + chainId: 56, + address: '0x0000000000000000000000000000000000000000', + decimals: 18, + symbol: 'BNB', + name: 'BNB', + logoUri: 'https://cdn.furucombo.app/assets/img/token/BNB.svg', + }, + price: '588.18732', + balance: '0.00000026472977847', + apy: '0.01068440988350536256', + lstApy: '0', + grossApy: '0.01068440988350536256', usageAsCollateralEnabled: true, ltv: '0.8', liquidationThreshold: '0.825', isNotCollateral: false, supplyCap: '0', - totalSupply: '19635.216840550330009192', + totalSupply: '36986.018906083101779589', }, { - token: bnbTokens.wBETH, - price: '3017.76764108', + token: { + chainId: 56, + address: '0xa2E3356610840701BDf5611a53974510Ae27E2e1', + decimals: 18, + symbol: 'wBETH', + name: 'Wrapped Binance Beacon ETH', + logoUri: 'https://cdn.furucombo.app/assets/img/token/wBETH.png', + }, + price: '3613.1197149', balance: '0', - apy: '0.01238230639109096255', + apy: '0.00574667576360947439', + lstApy: '0', + grossApy: '0.00574667576360947439', usageAsCollateralEnabled: true, ltv: '0.67', liquidationThreshold: '0.75', isNotCollateral: false, supplyCap: '0', - totalSupply: '969.973021380570422044', + totalSupply: '347.372210704468812237', }, ], borrows: [ { - token: bnbTokens.BTCB, - price: '62129.33', - balance: '82.863712621564394493', - apy: '0.02976988296074147581', - grossApy: '0.02976988296074147581', + token: { + chainId: 56, + address: '0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c', + decimals: 18, + symbol: 'BTCB', + name: 'BTCB Token', + logoUri: 'https://cdn.furucombo.app/assets/img/token/WBTC.svg', + }, + price: '66423.8747', + balance: '58.627327651056895583', + apy: '0.06723351317914074627', + lstApy: '0', + grossApy: '0.06723351317914074627', borrowMin: '0', borrowCap: '0', - totalBorrow: '278.272527950440262515', + totalBorrow: '143.348465059984868198', }, { - token: bnbTokens.USDT, - price: '0.99970008', + token: { + chainId: 56, + address: '0x55d398326f99059fF775485246999027B3197955', + decimals: 18, + symbol: 'USDT', + name: 'Tether USD', + logoUri: 'https://cdn.furucombo.app/assets/img/token/USDT.svg', + }, + price: '1.00009', balance: '0', - apy: '0.15507688545570079884', - grossApy: '0.15507688545570079884', + apy: '0.15164317170302552927', + lstApy: '0', + grossApy: '0.15164317170302552927', borrowMin: '0', borrowCap: '0', - totalBorrow: '7368045.665148012727993507', + totalBorrow: '3977149.60370022582825684', }, { - token: bnbTokens.USDC, - price: '1.000018', + token: { + chainId: 56, + address: '0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d', + decimals: 18, + symbol: 'USDC', + name: 'Binance-Peg USD Coin', + logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', + }, + price: '0.99999', balance: '0', - apy: '0.10141224907698186083', - grossApy: '0.10141224907698186083', + apy: '0.14972799375318408806', + lstApy: '0', + grossApy: '0.14972799375318408806', borrowMin: '0', borrowCap: '0', - totalBorrow: '675538.856929831366139788', + totalBorrow: '455281.343824141725086861', }, { - token: bnbTokens.ETH, - price: '2907.3027', + token: { + chainId: 56, + address: '0x2170Ed0880ac9A755fd29B2688956BD959F933F8', + decimals: 18, + symbol: 'ETH', + name: 'Binance-Peg Ethereum Token', + logoUri: 'https://cdn.furucombo.app/assets/img/token/ETH.png', + }, + price: '3461.01', balance: '0', - apy: '0.06186185971038594771', - grossApy: '0.06186185971038594771', + apy: '0.04425520372631329501', + lstApy: '0', + grossApy: '0.04425520372631329501', borrowMin: '0', borrowCap: '0', - totalBorrow: '503.514650192829467621', + totalBorrow: '277.90834040502096607', }, { - token: bnbTokens.BNB, - price: '566.5998', + token: { + chainId: 56, + address: '0x0000000000000000000000000000000000000000', + decimals: 18, + symbol: 'BNB', + name: 'BNB', + logoUri: 'https://cdn.furucombo.app/assets/img/token/BNB.svg', + }, + price: '588.18732', balance: '0', - apy: '0.24293350514121534581', - grossApy: '0.24293350514121534581', + apy: '0.08911711348089979253', + lstApy: '0', + grossApy: '0.08911711348089979253', borrowMin: '0', borrowCap: '0', - totalBorrow: '14047.112894395678975454', + totalBorrow: '18418.239773461628669793', }, { - token: bnbTokens.wBETH, - price: '3017.76764108', + token: { + chainId: 56, + address: '0xa2E3356610840701BDf5611a53974510Ae27E2e1', + decimals: 18, + symbol: 'wBETH', + name: 'Wrapped Binance Beacon ETH', + logoUri: 'https://cdn.furucombo.app/assets/img/token/wBETH.png', + }, + price: '3613.1197149', balance: '0', - apy: '0.1292138860658574247', - grossApy: '0.1292138860658574247', + apy: '0.08645846241079914598', + lstApy: '0', + grossApy: '0.08645846241079914598', borrowMin: '0', borrowCap: '0', - totalBorrow: '392.931959676069635801', + totalBorrow: '96.022043455969143073', }, ], }, diff --git a/packages/lending/src/protocols/radiant-v2/lending-protocol.ts b/packages/lending/src/protocols/radiant-v2/lending-protocol.ts index e449a46..a04b17d 100644 --- a/packages/lending/src/protocols/radiant-v2/lending-protocol.ts +++ b/packages/lending/src/protocols/radiant-v2/lending-protocol.ts @@ -15,15 +15,7 @@ import { SupplyParams, WithdrawParams, } from 'src/protocol.type'; -import { - DISPLAY_NAME, - ID, - Reserve, - getContractAddress, - isBorrowEnabled, - isSupplyEnabled, - supportedChainIds, -} from './configs'; +import { DISPLAY_NAME, ID, ReserveMap, ReserveTokens, getContractAddress, supportedChainIds } from './configs'; import { Portfolio } from 'src/protocol.portfolio'; import { PriceOracleInterface } from './contracts/PriceOracle'; import { Protocol } from 'src/protocol'; @@ -46,8 +38,8 @@ export class LendingProtocol extends Protocol { readonly market: Market; readonly preferredFlashLoanProtocolId = logics.radiantv2.FlashLoanLogic.protocolId; - private reserves: logics.radiantv2.ReserveTokens[] = []; - private reserveMap: Record = {}; + private reserveTokens: ReserveTokens[] = []; + private reserveMap: ReserveMap = {}; constructor(chainId: number, provider?: providers.Provider) { super(chainId, provider); @@ -62,20 +54,23 @@ export class LendingProtocol extends Protocol { async initializeReservesConfig() { const service = new logics.radiantv2.Service(this.chainId, this.provider); - const reserves = await service.getReserveTokens(); - const reserveMap: Record = {}; + const { reserveTokens } = await service.getReserveTokens(); + + const reserveMap: ReserveMap = {}; + + for (const reserveToken of reserveTokens) { + const { asset, rToken } = reserveToken; - for (const { asset, rToken, stableDebtToken, variableDebtToken } of reserves) { if (asset.isWrapped) { - reserveMap[asset.unwrapped.address] = { rToken, asset }; - reserves.push({ asset: asset.unwrapped, rToken, stableDebtToken, variableDebtToken }); + reserveMap[asset.unwrapped.address] = reserveToken; + reserveTokens.push({ ...reserveToken, asset: asset.unwrapped }); } - reserveMap[asset.address] = { rToken, asset }; - reserveMap[rToken.address] = { rToken, asset }; + reserveMap[asset.address] = reserveToken; + reserveMap[rToken.address] = reserveToken; } - this.reserves = reserves; + this.reserveTokens = reserveTokens; this.reserveMap = reserveMap; } @@ -127,32 +122,26 @@ export class LendingProtocol extends Protocol { return this._aTokenIface; } - private _tokensForDeposit?: common.Token[]; + private _depositTokenList?: common.Token[]; - async getTokensForDeposit() { - if (!this._tokensForDeposit) { + async getDepositTokenList() { + if (!this._depositTokenList) { const tokenList = await apisdk.protocols.radiantv2.getDepositTokenList(this.chainId); - const tokens = tokenList.filter((tokens) => isSupplyEnabled(this.chainId, tokens[0])).map((tokens) => tokens[0]); - - this._tokensForDeposit = tokens; + this._depositTokenList = tokenList.map((tokens) => tokens[0]); } - return this._tokensForDeposit; + return this._depositTokenList; } - private _tokensForBorrow?: common.Token[]; - - async getTokensForBorrow() { - if (!this._tokensForBorrow) { - const tokenList = await apisdk.protocols.radiantv2.getBorrowTokenList(this.chainId); - - const tokens = tokenList.filter((token) => isBorrowEnabled(this.chainId, token)); + private _borrowTokenList?: common.Token[]; - this._tokensForBorrow = tokens; + async getBorrowTokenList() { + if (!this._borrowTokenList) { + this._borrowTokenList = await apisdk.protocols.radiantv2.getBorrowTokenList(this.chainId); } - return this._tokensForBorrow; + return this._borrowTokenList; } getMarketName() { @@ -175,7 +164,7 @@ export class LendingProtocol extends Protocol { async getReserveDataMap() { if (!this._reserveDataMap) { const calls: common.Multicall3.CallStruct[] = []; - for (const { asset, rToken } of this.reserves) { + for (const { asset, rToken } of this.reserveTokens) { calls.push({ target: this.protocolDataProvider.address, callData: this.protocolDataProviderIface.encodeFunctionData('getReserveConfigurationData', [ @@ -195,7 +184,7 @@ export class LendingProtocol extends Protocol { this._reserveDataMap = {}; let j = 0; - for (const { asset } of this.reserves) { + for (const { asset } of this.reserveTokens) { const { ltv, liquidationThreshold, usageAsCollateralEnabled } = this.protocolDataProviderIface.decodeFunctionResult('getReserveConfigurationData', returnData[j]); j++; @@ -227,12 +216,12 @@ export class LendingProtocol extends Protocol { } async getAssetPriceMap() { - const assetAddresses = this.reserves.map(({ asset }) => asset.wrapped.address); + const assetAddresses = this.reserveTokens.map(({ asset }) => asset.wrapped.address); const assetPrices = await this.priceOracle.getAssetsPrices(assetAddresses, { blockTag: this.blockTag }); const assetPriceMap: Record = {}; - for (let i = 0; i < this.reserves.length; i++) { - assetPriceMap[this.reserves[i].asset.address] = common.toBigUnit(assetPrices[i], 8); + for (let i = 0; i < this.reserveTokens.length; i++) { + assetPriceMap[this.reserveTokens[i].asset.address] = common.toBigUnit(assetPrices[i], 8); } return assetPriceMap; @@ -240,7 +229,7 @@ export class LendingProtocol extends Protocol { async getUserBalancesMap(account: string) { const calls: common.Multicall3.CallStruct[] = []; - for (const { asset, rToken } of this.reserves) { + for (const { asset, rToken } of this.reserveTokens) { calls.push({ target: rToken.address, callData: this.erc20Iface.encodeFunctionData('balanceOf', [account]) }); calls.push({ target: this.protocolDataProvider.address, @@ -257,8 +246,8 @@ export class LendingProtocol extends Protocol { { supplyBalance: string; variableBorrowBalance: string; usageAsCollateralEnabled: boolean } > = {}; let j = 0; - for (let i = 0; i < this.reserves.length; i++) { - const { asset } = this.reserves[i]; + for (let i = 0; i < this.reserveTokens.length; i++) { + const { asset } = this.reserveTokens[i]; const [aTokenBalance] = this.erc20Iface.decodeFunctionResult('balanceOf', returnData[j]); j++; @@ -284,11 +273,11 @@ export class LendingProtocol extends Protocol { const assetPriceMap = await this.getAssetPriceMap(); const userBalancesMap = await this.getUserBalancesMap(account); const lstTokenAPYMap = await this.getLstTokenAPYMap(this.chainId); - const tokensForDeposit = await this.getTokensForDeposit(); - const tokensForBorrow = await this.getTokensForBorrow(); + const depositTokenList = await this.getDepositTokenList(); + const borrowTokenList = await this.getBorrowTokenList(); const supplies: SupplyObject[] = []; - for (const token of tokensForDeposit) { + for (const token of depositTokenList) { if (token.isWrapped) continue; const reserveData = reserveDataMap[token.address]; @@ -318,7 +307,7 @@ export class LendingProtocol extends Protocol { } const borrows: BorrowObject[] = []; - for (const token of tokensForBorrow) { + for (const token of borrowTokenList) { if (token.isWrapped) continue; const { variableBorrowAPY: apy, totalBorrow } = reserveDataMap[token.address]; diff --git a/packages/lending/src/protocols/spark/adapter.test.ts b/packages/lending/src/protocols/spark/adapter.test.ts index 46a8ed6..a784511 100644 --- a/packages/lending/src/protocols/spark/adapter.test.ts +++ b/packages/lending/src/protocols/spark/adapter.test.ts @@ -9,7 +9,7 @@ import { mainnetTokens } from './tokens'; describe('Test Adapter for Spark', async function () { const chainId = common.ChainId.mainnet; - const blockTag = 20175734; + const blockTag = 20370000; let adapter: Adapter; let protocol: LendingProtocol; diff --git a/packages/lending/src/protocols/spark/configs.ts b/packages/lending/src/protocols/spark/configs.ts index 90ff4e1..25205bd 100644 --- a/packages/lending/src/protocols/spark/configs.ts +++ b/packages/lending/src/protocols/spark/configs.ts @@ -1,14 +1,11 @@ import * as common from '@protocolink/common'; -import { gnosisTokens, mainnetTokens } from './tokens'; import * as logics from '@protocolink/logics'; export const ID = 'spark'; export const DISPLAY_NAME = 'Spark'; -export interface Reserve { - asset: common.Token; - aToken: common.Token; -} +export type ReserveTokens = logics.spark.ReserveTokens; +export type ReserveMap = Record; type ContractName = 'Pool' | 'PoolDataProvider' | 'AaveOracle'; @@ -44,21 +41,3 @@ export function getContractAddress(chainId: number, name: ContractName) { const { contractMap } = configs.find((configs) => configs.chainId === chainId)!; return contractMap[name]; } - -const supplyDisabledMap: Record = { - [common.ChainId.mainnet]: [], - [common.ChainId.gnosis]: [], -}; - -const borrowDisabledMap: Record = { - [common.ChainId.mainnet]: [mainnetTokens.sDAI.address], - [common.ChainId.gnosis]: [gnosisTokens.GNO.address, gnosisTokens.sDAI.address], -}; - -export const isSupplyEnabled = (chainId: number, token: common.Token) => { - return !supplyDisabledMap[chainId].includes(token.address); -}; - -export const isBorrowEnabled = (chainId: number, token: common.Token) => { - return !borrowDisabledMap[chainId].includes(token.address); -}; diff --git a/packages/lending/src/protocols/spark/lending-protocol.test.ts b/packages/lending/src/protocols/spark/lending-protocol.test.ts index 9ae0b9a..12f4a9c 100644 --- a/packages/lending/src/protocols/spark/lending-protocol.test.ts +++ b/packages/lending/src/protocols/spark/lending-protocol.test.ts @@ -10,16 +10,16 @@ describe('Test Spark LendingProtocol', function () { { chainId: common.ChainId.mainnet, account: '0x8bf7058bfe4cf0d1fdfd41f43816c5555c17431d', - blockTag: 20150000, + blockTag: 20370000, expected: { chainId: 1, protocolId: 'spark', marketId: 'mainnet', - utilization: '0.79678822323883319484', - healthRate: '1.27034397902718399131', - netAPY: '-0.13536489433507799406', - totalSupplyUSD: '2601932.82695974972973709827', - totalBorrowUSD: '1700015.336027643795802814', + utilization: '0.65532291216483930002', + healthRate: '1.54457459545777779405', + netAPY: '-0.05357165839973362067', + totalSupplyUSD: '3186082.28551260819278927529872469', + totalBorrowUSD: '1712088.431825922097645183', supplies: [ { token: { @@ -32,15 +32,15 @@ describe('Test Spark LendingProtocol', function () { }, price: '1', balance: '0', - apy: '0.08506539453004319342', + apy: '0.07683935389321952679', lstApy: '0', - grossApy: '0.08506539453004319342', + grossApy: '0.07683935389321952679', usageAsCollateralEnabled: true, ltv: '0', liquidationThreshold: '0.0001', isNotCollateral: false, supplyCap: '0', - totalSupply: '970979516.80904012484787946', + totalSupply: '978819959.209930667227190254', }, { token: { @@ -51,17 +51,17 @@ describe('Test Spark LendingProtocol', function () { name: 'Savings Dai', logoUri: 'https://cdn.furucombo.app/assets/img/token/sDAI.svg', }, - price: '1.09090239', + price: '1.09789311', balance: '0', apy: '0', - lstApy: '0.077', - grossApy: '0.077', + lstApy: '0.0677', + grossApy: '0.0677', usageAsCollateralEnabled: true, ltv: '0.79', liquidationThreshold: '0.8', isNotCollateral: false, supplyCap: '57238691', - totalSupply: '15820457.979376171851586115', + totalSupply: '18667428.990478263013922088', }, { token: { @@ -74,15 +74,15 @@ describe('Test Spark LendingProtocol', function () { }, price: '1', balance: '0', - apy: '0.06488613968469418005', + apy: '0.0563823178297332399', lstApy: '0', - grossApy: '0.06488613968469418005', + grossApy: '0.0563823178297332399', usageAsCollateralEnabled: false, ltv: '0', liquidationThreshold: '0', isNotCollateral: false, supplyCap: '60000000', - totalSupply: '2573573.982811', + totalSupply: '2603915.071201', }, { token: { @@ -93,17 +93,17 @@ describe('Test Spark LendingProtocol', function () { name: 'Ethereum', logoUri: 'https://cdn.furucombo.app/assets/img/token/ETH.png', }, - price: '3494.6068', - balance: '744.556677151704085775', - apy: '0.01188094252979843285', + price: '3490.68309921', + balance: '912.738909537125249589', + apy: '0.0182050474957308344', lstApy: '0', - grossApy: '0.01188094252979843285', + grossApy: '0.0182050474957308344', usageAsCollateralEnabled: true, ltv: '0.82', liquidationThreshold: '0.83', isNotCollateral: false, - supplyCap: '392853', - totalSupply: '242964.53151064801522744', + supplyCap: '403526', + totalSupply: '240205.673360739665288574', }, { token: { @@ -114,17 +114,17 @@ describe('Test Spark LendingProtocol', function () { name: 'Wrapped liquid staked Ether 2.0', logoUri: 'https://cdn.furucombo.app/assets/img/token/wstETH.png', }, - price: '4090.63672006', + price: '4096.60756363', balance: '0', - apy: '0.00000018736689798449', - lstApy: '0.0302', - grossApy: '0.03020018736689798449', + apy: '0.00000074909973864423', + lstApy: '0.0306', + grossApy: '0.03060074909973864423', usageAsCollateralEnabled: true, ltv: '0.79', liquidationThreshold: '0.8', isNotCollateral: false, - supplyCap: '559623', - totalSupply: '518630.88531647902529718', + supplyCap: '614522', + totalSupply: '564390.586912743627552133', }, { token: { @@ -135,17 +135,17 @@ describe('Test Spark LendingProtocol', function () { name: 'Wrapped BTC', logoUri: 'https://cdn.furucombo.app/assets/img/token/WBTC.svg', }, - price: '64268.87322622', + price: '67214.30913055', balance: '0', - apy: '0.00009490993643960992', + apy: '0.0001159633210487029', lstApy: '0', - grossApy: '0.00009490993643960992', + grossApy: '0.0001159633210487029', usageAsCollateralEnabled: true, ltv: '0.74', liquidationThreshold: '0.75', isNotCollateral: false, - supplyCap: '6050', - totalSupply: '5574.61109955', + supplyCap: '6049', + totalSupply: '5499.78712016', }, { token: { @@ -156,17 +156,17 @@ describe('Test Spark LendingProtocol', function () { name: 'Rocket Pool ETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/rETH.svg', }, - price: '3876.74130142', + price: '3881.07180386', balance: '0', - apy: '0.00000347315814995589', - lstApy: '0.0282', - grossApy: '0.02820347315814995589', + apy: '0.00000096321954778242', + lstApy: '0.027', + grossApy: '0.02700096321954778242', usageAsCollateralEnabled: true, ltv: '0.79', liquidationThreshold: '0.8', isNotCollateral: false, - supplyCap: '48520', - totalSupply: '39031.633141864210921579', + supplyCap: '48947', + totalSupply: '39156.34699525170627965', }, { token: { @@ -179,15 +179,15 @@ describe('Test Spark LendingProtocol', function () { }, price: '1', balance: '0', - apy: '0.17653029292621809349', + apy: '0.06721727075826540115', lstApy: '0', - grossApy: '0.17653029292621809349', + grossApy: '0.06721727075826540115', usageAsCollateralEnabled: false, ltv: '0', liquidationThreshold: '0', isNotCollateral: false, supplyCap: '30000000', - totalSupply: '231087.822426', + totalSupply: '248005.812301', }, { token: { @@ -198,7 +198,7 @@ describe('Test Spark LendingProtocol', function () { name: 'Wrapped eETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/weETH.webp', }, - price: '3638.78762183', + price: '3643.00043268', balance: '0', apy: '0', lstApy: '0', @@ -207,8 +207,8 @@ describe('Test Spark LendingProtocol', function () { ltv: '0.72', liquidationThreshold: '0.73', isNotCollateral: false, - supplyCap: '7704', - totalSupply: '2773.528693390597260508', + supplyCap: '56850', + totalSupply: '52892.690695916432954295', }, ], borrows: [ @@ -222,13 +222,31 @@ describe('Test Spark LendingProtocol', function () { logoUri: 'https://cdn.furucombo.app/assets/img/token/DAI.png', }, price: '1', - balance: '1700015.336027643795802814', - apy: '0.08999999999999999998', + balance: '1712088.431825922097645183', + apy: '0.07999999999999999995', lstApy: '0', - grossApy: '0.08999999999999999998', + grossApy: '0.07999999999999999995', borrowMin: '0', borrowCap: '0', - totalBorrow: '920150499.78030561465224941', + totalBorrow: '941846029.246625767038886899', + }, + { + token: { + chainId: 1, + address: '0x83F20F44975D03b1b09e64809B757c47f942BEeA', + decimals: 18, + symbol: 'sDAI', + name: 'Savings Dai', + logoUri: 'https://cdn.furucombo.app/assets/img/token/sDAI.svg', + }, + price: '1.09789311', + balance: '0', + apy: '0.01005016708256663351', + lstApy: '0.0677', + grossApy: '-0.05764983291743336649', + borrowMin: '0', + borrowCap: '0', + totalBorrow: '0', }, { token: { @@ -241,12 +259,12 @@ describe('Test Spark LendingProtocol', function () { }, price: '1', balance: '0', - apy: '0.0809400739070207213', + apy: '0.07111542520437467183', lstApy: '0', - grossApy: '0.0809400739070207213', + grossApy: '0.07111542520437467183', borrowMin: '0', borrowCap: '7677918', - totalBorrow: '2191019.352047', + totalBorrow: '2191695.514938', }, { token: { @@ -257,14 +275,14 @@ describe('Test Spark LendingProtocol', function () { name: 'Ethereum', logoUri: 'https://cdn.furucombo.app/assets/img/token/ETH.png', }, - price: '3494.6068', + price: '3490.68309921', balance: '0', - apy: '0.01875730304327349679', + apy: '0.02323368294003780377', lstApy: '0', - grossApy: '0.01875730304327349679', + grossApy: '0.02323368294003780377', borrowMin: '0', - borrowCap: '174706', - totalBorrow: '162583.542147196213411733', + borrowCap: '219288', + totalBorrow: '198674.538161914337593624', }, { token: { @@ -275,14 +293,14 @@ describe('Test Spark LendingProtocol', function () { name: 'Wrapped liquid staked Ether 2.0', logoUri: 'https://cdn.furucombo.app/assets/img/token/wstETH.png', }, - price: '4090.63672006', + price: '4096.60756363', balance: '0', - apy: '0.0025119360225730149', - lstApy: '0.0302', - grossApy: '-0.0276880639774269851', + apy: '0.00253798344877928981', + lstApy: '0.0306', + grossApy: '-0.02806201655122071019', borrowMin: '0', - borrowCap: '142', - totalBorrow: '45.568946461169606586', + borrowCap: '296', + totalBorrow: '196.228708919009674041', }, { token: { @@ -293,14 +311,14 @@ describe('Test Spark LendingProtocol', function () { name: 'Wrapped BTC', logoUri: 'https://cdn.furucombo.app/assets/img/token/WBTC.svg', }, - price: '64268.87322622', + price: '67214.30913055', balance: '0', - apy: '0.00199054407925222943', + apy: '0.00220049053243771844', lstApy: '0', - grossApy: '0.00199054407925222943', + grossApy: '0.00220049053243771844', borrowMin: '0', - borrowCap: '432', - totalBorrow: '332.56624751', + borrowCap: '462', + totalBorrow: '362.67032039', }, { token: { @@ -311,14 +329,14 @@ describe('Test Spark LendingProtocol', function () { name: 'Rocket Pool ETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/rETH.svg', }, - price: '3876.74130142', + price: '3881.07180386', balance: '0', - apy: '0.0027363392464678893', - lstApy: '0.0282', - grossApy: '-0.0254636607535321107', + apy: '0.00257192807298261536', + lstApy: '0.027', + grossApy: '-0.02442807192701738464', borrowMin: '0', - borrowCap: '163', - totalBorrow: '58.364826089291420047', + borrowCap: '106', + totalBorrow: '17.274876705167749567', }, { token: { @@ -331,12 +349,12 @@ describe('Test Spark LendingProtocol', function () { }, price: '1', balance: '0', - apy: '0.19094817722008477749', + apy: '0.07768876436500163347', lstApy: '0', - grossApy: '0.19094817722008477749', + grossApy: '0.07768876436500163347', borrowMin: '0', borrowCap: '3151044', - totalBorrow: '226683.621566', + totalBorrow: '227426.714532', }, { token: { @@ -347,7 +365,7 @@ describe('Test Spark LendingProtocol', function () { name: 'Wrapped eETH', logoUri: 'https://cdn.furucombo.app/assets/img/token/weETH.webp', }, - price: '3638.78762183', + price: '3643.00043268', balance: '0', apy: '0.051271096334354555', lstApy: '0', @@ -362,16 +380,16 @@ describe('Test Spark LendingProtocol', function () { { chainId: common.ChainId.gnosis, account: '0xed374ece52ab111bdbaee9f1013429f474c883ba', - blockTag: 34670000, + blockTag: 35127000, expected: { chainId: 100, protocolId: 'spark', marketId: 'gnosis', utilization: '1', - healthRate: '66.22313042620073282914', - netAPY: '0.06758674765709174823', - totalSupplyUSD: '0.52479814300329596073120645', - totalBorrowUSD: '0.00594352141579157858042094', + healthRate: '64.74912683945969295912', + netAPY: '0.08420652611326825989', + totalSupplyUSD: '0.5278642149929004401339792', + totalBorrowUSD: '0.00611433955718774649901525', supplies: [ { token: { @@ -383,16 +401,16 @@ describe('Test Spark LendingProtocol', function () { logoUri: 'https://cdn.furucombo.app/assets/img/token/xDAI.svg', }, price: '1', - balance: '0.524797609259734908', - apy: '0.06659314737760115447', + balance: '0.527863666320895678', + apy: '0.08299317978989202667', lstApy: '0', - grossApy: '0.06659314737760115447', + grossApy: '0.08299317978989202667', usageAsCollateralEnabled: true, ltv: '0', liquidationThreshold: '0.75', isNotCollateral: false, supplyCap: '20000000', - totalSupply: '5201978.747319461305417626', + totalSupply: '4847804.997708114875429876', }, { token: { @@ -403,17 +421,17 @@ describe('Test Spark LendingProtocol', function () { name: 'Wrapped Ether on xDai', logoUri: 'https://cdn.furucombo.app/assets/img/token/WETH.svg', }, - price: '3378.18992021', + price: '3464.85560584', balance: '0', - apy: '0.00143565389586164745', + apy: '0.00159305220583107531', lstApy: '0', - grossApy: '0.00143565389586164745', + grossApy: '0.00159305220583107531', usageAsCollateralEnabled: true, ltv: '0.7', liquidationThreshold: '0.75', isNotCollateral: false, supplyCap: '5000', - totalSupply: '1730.169232376271297257', + totalSupply: '1740.080363495989168184', }, { token: { @@ -424,17 +442,17 @@ describe('Test Spark LendingProtocol', function () { name: 'Wrapped liquid staked Ether 2.0 from Mainnet', logoUri: 'https://cdn.furucombo.app/assets/img/token/wstETH.png', }, - price: '3955.65976923', - balance: '0.000000000134931615', - apy: '0.00000009164896877563', - lstApy: '0.0302', - grossApy: '0.03020009164896877563', + price: '4066.29684745', + balance: '0.000000000134931616', + apy: '0.00000008669562609401', + lstApy: '0.0306', + grossApy: '0.03060008669562609401', usageAsCollateralEnabled: true, ltv: '0.65', liquidationThreshold: '0.725', isNotCollateral: false, supplyCap: '15000', - totalSupply: '7045.636056469244191749', + totalSupply: '7014.463596960524555261', }, { token: { @@ -445,7 +463,7 @@ describe('Test Spark LendingProtocol', function () { name: 'Gnosis Token on xDai', logoUri: 'https://cdn.furucombo.app/assets/img/token/GNO.png', }, - price: '282.25735346', + price: '238.91696466', balance: '0', apy: '0', lstApy: '0', @@ -455,7 +473,7 @@ describe('Test Spark LendingProtocol', function () { liquidationThreshold: '0.5', isNotCollateral: false, supplyCap: '100000', - totalSupply: '50792.470631786130088309', + totalSupply: '57410.979740091645026716', }, { token: { @@ -466,17 +484,17 @@ describe('Test Spark LendingProtocol', function () { name: 'Savings xDAI ', logoUri: 'https://cdn.furucombo.app/assets/img/token/sDAI.svg', }, - price: '1.09012557', + price: '1.09764761', balance: '0', apy: '0', - lstApy: '0.1035', - grossApy: '0.1035', + lstApy: '0.0896', + grossApy: '0.0896', usageAsCollateralEnabled: true, ltv: '0.7', liquidationThreshold: '0.75', isNotCollateral: false, supplyCap: '40000000', - totalSupply: '2413060.464050747079318239', + totalSupply: '2322351.773200468161357898', }, { token: { @@ -489,15 +507,15 @@ describe('Test Spark LendingProtocol', function () { }, price: '1', balance: '0', - apy: '0.04031825326941188248', + apy: '0.05696031019647857311', lstApy: '0', - grossApy: '0.04031825326941188248', + grossApy: '0.05696031019647857311', usageAsCollateralEnabled: false, ltv: '0', liquidationThreshold: '0', isNotCollateral: false, supplyCap: '10000000', - totalSupply: '875914.238229', + totalSupply: '368554.914103', }, { token: { @@ -510,15 +528,15 @@ describe('Test Spark LendingProtocol', function () { }, price: '1', balance: '0', - apy: '0.04973581219793704575', + apy: '0.01958662647868358699', lstApy: '0', - grossApy: '0.04973581219793704575', + grossApy: '0.01958662647868358699', usageAsCollateralEnabled: false, ltv: '0', liquidationThreshold: '0', isNotCollateral: false, supplyCap: '10000000', - totalSupply: '501494.853783', + totalSupply: '503374.949569', }, { token: { @@ -529,17 +547,38 @@ describe('Test Spark LendingProtocol', function () { name: 'Monerium EUR emoney', logoUri: 'https://cdn.furucombo.app/assets/img/token/EURe.svg', }, - price: '1.06821', + price: '1.08366', balance: '0', - apy: '0.04272023504573387169', + apy: '0.04178691679211345166', lstApy: '0', - grossApy: '0.04272023504573387169', + grossApy: '0.04178691679211345166', usageAsCollateralEnabled: false, ltv: '0', liquidationThreshold: '0', isNotCollateral: false, supplyCap: '5000000', - totalSupply: '514539.854324959728001926', + totalSupply: '513250.33703281832133448', + }, + { + token: { + chainId: 100, + address: '0x2a22f9c3b484c3629090FeED35F17Ff8F88f76F0', + decimals: 6, + symbol: 'USDC.e', + name: 'Bridged USDC (Gnosis)', + logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', + }, + price: '1', + balance: '0', + apy: '0.03228137494751144417', + lstApy: '0', + grossApy: '0.03228137494751144417', + usageAsCollateralEnabled: false, + ltv: '0', + liquidationThreshold: '0', + isNotCollateral: false, + supplyCap: '10000000', + totalSupply: '907721.198316', }, ], borrows: [ @@ -554,12 +593,12 @@ describe('Test Spark LendingProtocol', function () { }, price: '1', balance: '0', - apy: '0.08348389047388561465', + apy: '0.09326338549974106702', lstApy: '0', - grossApy: '0.08348389047388561465', + grossApy: '0.09326338549974106702', borrowMin: '0', borrowCap: '16000000', - totalBorrow: '4405872.903221623929093855', + totalBorrow: '4567694.279161831300748862', }, { token: { @@ -570,14 +609,14 @@ describe('Test Spark LendingProtocol', function () { name: 'Wrapped Ether on xDai', logoUri: 'https://cdn.furucombo.app/assets/img/token/WETH.svg', }, - price: '3378.18992021', + price: '3464.85560584', balance: '0', - apy: '0.0070828223259550443', + apy: '0.00746210354413100221', lstApy: '0', - grossApy: '0.0070828223259550443', + grossApy: '0.00746210354413100221', borrowMin: '0', borrowCap: '3000', - totalBorrow: '390.838016814541498549', + totalBorrow: '414.050586198367622466', }, { token: { @@ -588,14 +627,50 @@ describe('Test Spark LendingProtocol', function () { name: 'Wrapped liquid staked Ether 2.0 from Mainnet', logoUri: 'https://cdn.furucombo.app/assets/img/token/wstETH.png', }, - price: '3955.65976923', - balance: '0.000001502536052778', - apy: '0.01005104862555524841', - lstApy: '0.0302', - grossApy: '-0.02014895137444475159', + price: '4066.29684745', + balance: '0.000001503662862445', + apy: '0.01005100098480449348', + lstApy: '0.0306', + grossApy: '-0.02054899901519550652', borrowMin: '0', borrowCap: '100', - totalBorrow: '0.092239536518913207', + totalBorrow: '0.086873088850392222', + }, + { + token: { + chainId: 100, + address: '0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb', + decimals: 18, + symbol: 'GNO', + name: 'Gnosis Token on xDai', + logoUri: 'https://cdn.furucombo.app/assets/img/token/GNO.png', + }, + price: '238.91696466', + balance: '0', + apy: '0', + lstApy: '0', + grossApy: '0', + borrowMin: '0', + borrowCap: '0', + totalBorrow: '0', + }, + { + token: { + chainId: 100, + address: '0xaf204776c7245bF4147c2612BF6e5972Ee483701', + decimals: 18, + symbol: 'sDAI', + name: 'Savings xDAI ', + logoUri: 'https://cdn.furucombo.app/assets/img/token/sDAI.svg', + }, + price: '1.09764761', + balance: '0', + apy: '0', + lstApy: '0.0896', + grossApy: '0.0896', + borrowMin: '0', + borrowCap: '0', + totalBorrow: '0', }, { token: { @@ -608,12 +683,12 @@ describe('Test Spark LendingProtocol', function () { }, price: '1', balance: '0', - apy: '0.06662932421477983648', + apy: '0.08677484168423271006', lstApy: '0', - grossApy: '0.06662932421477983648', + grossApy: '0.08677484168423271006', borrowMin: '0', - borrowCap: '8000000', - totalBorrow: '596606.15362', + borrowCap: '1000000', + totalBorrow: '273066.99768', }, { token: { @@ -626,12 +701,12 @@ describe('Test Spark LendingProtocol', function () { }, price: '1', balance: '0', - apy: '0.07409612776044139288', + apy: '0.04622294894325546943', lstApy: '0', - grossApy: '0.07409612776044139288', + grossApy: '0.04622294894325546943', borrowMin: '0', borrowCap: '8000000', - totalBorrow: '378507.507327', + totalBorrow: '240276.736692', }, { token: { @@ -642,14 +717,32 @@ describe('Test Spark LendingProtocol', function () { name: 'Monerium EUR emoney', logoUri: 'https://cdn.furucombo.app/assets/img/token/EURe.svg', }, - price: '1.06821', + price: '1.08366', balance: '0', - apy: '0.0507043847775819476', + apy: '0.05014530046254622927', lstApy: '0', - grossApy: '0.0507043847775819476', + grossApy: '0.05014530046254622927', borrowMin: '0', borrowCap: '4000000', - totalBorrow: '483682.456791976017259709', + totalBorrow: '477445.791940291068748337', + }, + { + token: { + chainId: 100, + address: '0x2a22f9c3b484c3629090FeED35F17Ff8F88f76F0', + decimals: 6, + symbol: 'USDC.e', + name: 'Bridged USDC (Gnosis)', + logoUri: 'https://cdn.furucombo.app/assets/img/token/USDC.svg', + }, + price: '1', + balance: '0', + apy: '0.0595351925846023677', + lstApy: '0', + grossApy: '0.0595351925846023677', + borrowMin: '0', + borrowCap: '8000000', + totalBorrow: '554132.794253', }, ], }, diff --git a/packages/lending/src/protocols/spark/lending-protocol.ts b/packages/lending/src/protocols/spark/lending-protocol.ts index e6e9184..220df75 100644 --- a/packages/lending/src/protocols/spark/lending-protocol.ts +++ b/packages/lending/src/protocols/spark/lending-protocol.ts @@ -18,15 +18,7 @@ import { SupplyParams, WithdrawParams, } from 'src/protocol.type'; -import { - DISPLAY_NAME, - ID, - Reserve, - getContractAddress, - isBorrowEnabled, - isSupplyEnabled, - supportedChainIds, -} from './configs'; +import { DISPLAY_NAME, ID, ReserveMap, ReserveTokens, getContractAddress, supportedChainIds } from './configs'; import { PoolDataProviderInterface } from './contracts/PoolDataProvider'; import { Portfolio } from 'src/protocol.portfolio'; import { Protocol } from 'src/protocol'; @@ -46,8 +38,8 @@ export class LendingProtocol extends Protocol { readonly name = DISPLAY_NAME; readonly market: Market; - private reserves: logics.spark.ReserveTokens[] = []; - private reserveMap: Record = {}; + private reserveTokens: ReserveTokens[] = []; + private reserveMap: ReserveMap = {}; private hasNativeToken = false; constructor(chainId: number, provider?: providers.Provider) { @@ -63,23 +55,25 @@ export class LendingProtocol extends Protocol { async initializeReservesConfig() { const service = new logics.spark.Service(this.chainId, this.provider); - const reserves = await service.getReserveTokens(); - const reserveMap: Record = {}; + const { reserveTokens } = await service.getReserveTokens(); + + const reserveMap: ReserveMap = {}; let hasNativeToken = false; - for (const { asset, aToken, stableDebtToken, variableDebtToken } of reserves) { + for (const reserveToken of reserveTokens) { + const { asset, aToken } = reserveToken; if (asset.isNative) hasNativeToken = true; if (asset.isWrapped) { - reserveMap[asset.unwrapped.address] = { aToken, asset }; - reserves.push({ asset: asset.unwrapped, aToken, stableDebtToken, variableDebtToken }); + reserveMap[asset.unwrapped.address] = reserveToken; + reserveTokens.push({ ...reserveToken, asset: asset.unwrapped }); } - reserveMap[asset.address] = { aToken, asset }; - reserveMap[aToken.address] = { aToken, asset }; + reserveMap[asset.address] = reserveToken; + reserveMap[aToken.address] = reserveToken; } - this.reserves = reserves; + this.reserveTokens = reserveTokens; this.reserveMap = reserveMap; this.hasNativeToken = hasNativeToken; } @@ -132,32 +126,26 @@ export class LendingProtocol extends Protocol { return this._aTokenIface; } - private _tokensForDeposit?: common.Token[]; + private _supplyTokenList?: common.Token[]; - async getTokensForDeposit() { - if (!this._tokensForDeposit) { + async getSupplyTokenList() { + if (!this._supplyTokenList) { const tokenList = await apisdk.protocols.spark.getSupplyTokenList(this.chainId); - const tokens = tokenList.filter((tokens) => isSupplyEnabled(this.chainId, tokens[0])).map((tokens) => tokens[0]); - - this._tokensForDeposit = tokens; + this._supplyTokenList = tokenList.map((tokens) => tokens[0]); } - return this._tokensForDeposit; + return this._supplyTokenList; } - private _tokensForBorrow?: common.Token[]; - - async getTokensForBorrow() { - if (!this._tokensForBorrow) { - const tokenList = await apisdk.protocols.spark.getBorrowTokenList(this.chainId); - - const tokens = tokenList.filter((token) => isBorrowEnabled(this.chainId, token)); + private _borrowTokenList?: common.Token[]; - this._tokensForBorrow = tokens; + async getBorrowTokenList() { + if (!this._borrowTokenList) { + this._borrowTokenList = await apisdk.protocols.spark.getBorrowTokenList(this.chainId); } - return this._tokensForBorrow; + return this._borrowTokenList; } getMarketName() { @@ -184,7 +172,7 @@ export class LendingProtocol extends Protocol { async getReserveDataMap() { if (!this._reserveDataMap) { const calls: common.Multicall3.CallStruct[] = []; - for (const { asset } of this.reserves) { + for (const { asset } of this.reserveTokens) { calls.push({ target: this.poolDataProvider.address, callData: this.poolDataProviderIface.encodeFunctionData('getReserveConfigurationData', [ @@ -208,7 +196,7 @@ export class LendingProtocol extends Protocol { this._reserveDataMap = {}; let j = 0; - for (const { asset } of this.reserves) { + for (const { asset } of this.reserveTokens) { const { ltv, liquidationThreshold, usageAsCollateralEnabled } = this.poolDataProviderIface.decodeFunctionResult( 'getReserveConfigurationData', returnData[j] @@ -251,12 +239,12 @@ export class LendingProtocol extends Protocol { } async getAssetPriceMap() { - const assetAddresses = this.reserves.map(({ asset }) => asset.wrapped.address); + const assetAddresses = this.reserveTokens.map(({ asset }) => asset.wrapped.address); const assetPrices = await this.priceOracle.getAssetsPrices(assetAddresses, { blockTag: this.blockTag }); const assetPriceMap: Record = {}; for (let i = 0; i < assetAddresses.length; i++) { - assetPriceMap[this.reserves[i].asset.address] = common.toBigUnit(assetPrices[i], 8); + assetPriceMap[this.reserveTokens[i].asset.address] = common.toBigUnit(assetPrices[i], 8); } return assetPriceMap; @@ -264,7 +252,7 @@ export class LendingProtocol extends Protocol { async getUserBalancesMap(account: string) { const calls: common.Multicall3.CallStruct[] = []; - for (const { asset, aToken } of this.reserves) { + for (const { asset, aToken } of this.reserveTokens) { calls.push({ target: aToken.address, callData: this.aTokenIface.encodeFunctionData('scaledBalanceOf', [account]), @@ -287,8 +275,8 @@ export class LendingProtocol extends Protocol { } > = {}; let j = 0; - for (let i = 0; i < this.reserves.length; i++) { - const { asset } = this.reserves[i]; + for (let i = 0; i < this.reserveTokens.length; i++) { + const { asset } = this.reserveTokens[i]; const { liquidityIndex } = reserveDataMap[asset.address]; const [scaledBalance] = this.aTokenIface.decodeFunctionResult('scaledBalanceOf', returnData[j]); @@ -318,11 +306,11 @@ export class LendingProtocol extends Protocol { const assetPriceMap = await this.getAssetPriceMap(); const userBalancesMap = await this.getUserBalancesMap(account); const lstTokenAPYMap = await this.getLstTokenAPYMap(this.chainId); - const tokensForDeposit = await this.getTokensForDeposit(); - const tokensForBorrow = await this.getTokensForBorrow(); + const supplyTokenList = await this.getSupplyTokenList(); + const borrowTokenList = await this.getBorrowTokenList(); const supplies: SupplyObject[] = []; - for (const token of tokensForDeposit) { + for (const token of supplyTokenList) { if (this.hasNativeToken && token.isWrapped) continue; const reserveData = reserveDataMap[token.address]; @@ -359,7 +347,7 @@ export class LendingProtocol extends Protocol { } const borrows: BorrowObject[] = []; - for (const token of tokensForBorrow) { + for (const token of borrowTokenList) { if (this.hasNativeToken && token.isWrapped) continue; const { borrowAPY: apy, borrowCap, totalBorrow } = reserveDataMap[token.address]; diff --git a/yarn.lock b/yarn.lock index 4837956..f8e3b2c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1083,32 +1083,7 @@ node-addon-api "^3.2.1" node-gyp-build "^4.3.0" -"@protocolink/common@^0.3.11": - version "0.3.11" - resolved "https://registry.yarnpkg.com/@protocolink/common/-/common-0.3.11.tgz#5782d838ce97d3b1f7f141e41a7c64560bed6846" - integrity sha512-71tpyy5g70rgSgLZEqbF+zeUpUEWaq8raV/5yw14aWbp1CBUtMnfYGyrqyHJf0e+VNkA4AwCiaZpywZ2JSCMwA== - dependencies: - "@types/lodash" "^4.14.195" - axios "^1.3.6" - axios-retry "^3.5.1" - bignumber.js "^9.1.1" - ethers "^5.7.2" - lodash "^4.17.21" - tiny-invariant "^1.3.1" - type-fest "^3.12.0" - zksync-web3 "^0.14.3" - -"@protocolink/core@^0.4.13": - version "0.4.13" - resolved "https://registry.yarnpkg.com/@protocolink/core/-/core-0.4.13.tgz#844c6c31d1ea60a0a5db8fd6b89104b006aaaefd" - integrity sha512-Ufapa3YUKVBzxMAeU6AgAQJqHmBagsH5lkr6bVwvHj7RyoSXD6TJVuOEXKA+jZuUZbgYYMNZBGj7LPCbIUMhsA== - dependencies: - "@protocolink/common" "^0.3.11" - "@uniswap/permit2-sdk" "^1.2.0" - ethers "^5.7.2" - tiny-invariant "^1.3.1" - -"@protocolink/logics@^1.3.0", "@protocolink/logics@^1.5.1": +"@protocolink/logics@^1.5.1": version "1.5.1" resolved "https://registry.yarnpkg.com/@protocolink/logics/-/logics-1.5.1.tgz#ebc94a60644e8fd4505430467e7a0dd35631d9ed" integrity sha512-PoeBvqewf4OxrolWkir3MDgA21Bu+6uRavlGf4NUlyuz6VTQMHXKTq+xk9+XVBxRaLUn4tCTVwWjcDjRY9/wWA==