From f12a609be82dd713dc6f438ac2f34f1fc2d56fdc Mon Sep 17 00:00:00 2001 From: therealemjy Date: Mon, 16 Dec 2024 14:21:48 +0100 Subject: [PATCH] fix: useGetPools hook --- apps/evm/__mocks__/@venusprotocol/chains.ts | 39 + apps/evm/src/__mocks__/api/markets.json | 1283 ----------------- apps/evm/src/__mocks__/models/chains.ts | 5 + .../useGetPoolLiquidationIncentive.ts | 19 +- .../useGetPools/__testUtils__/fakeData.ts | 87 +- .../__snapshots__/index.prime.spec.ts.snap | 216 +-- .../__snapshots__/index.spec.ts.snap | 72 +- .../getPools/formatOutput/index.ts | 24 +- .../api/queries/useGetPools/getPools/index.ts | 26 +- .../useGetLiquidationThresholdPercentage.tsx | 21 +- apps/evm/src/setupTests.tsx | 3 + apps/evm/src/utilities/index.ts | 1 + .../isPoolIsolated/__tests__/index.spec.tsx | 56 + .../src/utilities/isPoolIsolated/index.tsx | 14 + 14 files changed, 376 insertions(+), 1490 deletions(-) create mode 100644 apps/evm/__mocks__/@venusprotocol/chains.ts delete mode 100644 apps/evm/src/__mocks__/api/markets.json create mode 100644 apps/evm/src/__mocks__/models/chains.ts create mode 100644 apps/evm/src/utilities/isPoolIsolated/__tests__/index.spec.tsx create mode 100644 apps/evm/src/utilities/isPoolIsolated/index.tsx diff --git a/apps/evm/__mocks__/@venusprotocol/chains.ts b/apps/evm/__mocks__/@venusprotocol/chains.ts new file mode 100644 index 0000000000..b2eaf8c3ae --- /dev/null +++ b/apps/evm/__mocks__/@venusprotocol/chains.ts @@ -0,0 +1,39 @@ +import { ChainId } from '__mocks__/models/chains'; +import { isolatedPool, legacyCorePool } from '__mocks__/models/pools'; +import { bnb, eth } from '__mocks__/models/tokens'; +export { ChainId } from '__mocks__/models/chains'; + +export const chainMetadata = { + [ChainId.BSC_MAINNET]: { + name: 'BNB Chain', + logoSrc: 'fake-logo-src-bsc-mainnet', + explorerUrl: 'https://bscscan.com', + layerZeroScanUrl: 'https://layerzeroscan.com', + blockTimeMs: 3000, + blocksPerDay: 28800, + corePoolComptrollerContractAddress: legacyCorePool.comptrollerAddress, + nativeToken: bnb, + }, + [ChainId.BSC_TESTNET]: { + name: 'BNB testnet', + logoSrc: 'fake-logo-src-bsc-testnet', + explorerUrl: 'https://testnet.bscscan.com', + layerZeroScanUrl: 'https://testnet.layerzeroscan.com', + blockTimeMs: 3000, + blocksPerDay: 28800, + corePoolComptrollerContractAddress: legacyCorePool.comptrollerAddress, + nativeToken: bnb, + }, + [ChainId.ETHEREUM]: { + name: 'Ethereum', + logoSrc: 'fake-logo-src-bsc-ethereum', + explorerUrl: 'https://etherscan.io', + layerZeroScanUrl: 'https://layerzeroscan.com', + blockTimeMs: 12000, + blocksPerDay: 7200, + corePoolComptrollerContractAddress: isolatedPool.comptrollerAddress, + lstPoolComptrollerContractAddress: '0xF522cd0360EF8c2FF48B648d53EA1717Ec0F3Ac3', + lstPoolVWstEthContractAddress: '0x4a240F0ee138697726C8a3E43eFE6Ac3593432CB', + nativeToken: eth, + }, +}; diff --git a/apps/evm/src/__mocks__/api/markets.json b/apps/evm/src/__mocks__/api/markets.json deleted file mode 100644 index 7a3e1821b0..0000000000 --- a/apps/evm/src/__mocks__/api/markets.json +++ /dev/null @@ -1,1283 +0,0 @@ -{ - "limit": 100, - "page": 0, - "total": 22, - "result": [ - { - "address": "0x714db6c38A17883964B68a07d56cE331501d9eb6", - "chainId": "97", - "symbol": "vAAVE", - "name": "Venus AAVE", - "underlyingAddress": "0x4B7268FC7C727B88c5Fc127D41b491BfAe63e144", - "underlyingName": "Aave Token", - "underlyingSymbol": "AAVE", - "underlyingDecimal": 18, - "borrowerDailyXvsMantissa": "12500000000000006400", - "supplierDailyXvsMantissa": "12500000000000006400", - "xvsBorrowIndex": "85118563287737462261471437372685634421", - "xvsSupplyIndex": "6601715752309389703740065071275333955", - "borrowRatePerBlock": "794031465", - "supplyRatePerBlock": "33138342", - "exchangeRateMantissa": "2155014452534515249", - "underlyingPriceMantissa": "124208800000000000000", - "totalBorrowsMantissa": "932010469362685774563", - "totalSupplyMantissa": "10362809970497229629502", - "cashMantissa": "21399994785927617654795", - "totalReservesMantissa": "0", - "reserveFactorMantissa": "0", - "collateralFactorMantissa": "550000000000000000", - "borrowApy": "0.835863542000393987", - "supplyApy": "0.034745604995460892", - "borrowXvsApy": "28.638082890878194012", - "supplyXvsApy": "1.056900678515979334", - "borrowXvsApr": "0.2526119390", - "supplyXvsApr": "0.0105425809", - "liquidityCents": "265806767.2366326275760901", - "tokenPriceCents": "12420.88", - "totalDistributedMantissa": "465622489062457507", - "lastCalculatedXvsAccruedBlockNumber": "40813640", - "supplyCapsMantissa": "115792089237316195423570985008687907853269984665640564039457584007913129639935", - "borrowCapsMantissa": "0", - "borrowerCount": 8, - "supplierCount": 9, - "estimatedPrimeBorrowApyBoost": null, - "estimatedPrimeSupplyApyBoost": null, - "pausedActionsBitmap": 0, - "isListed": true, - "poolComptrollerAddress": "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D", - "rewardsDistributors": [ - { - "marketAddress": "0x714db6c38A17883964B68a07d56cE331501d9eb6", - "rewardTokenAddress": "0xB9e0E753630434d7863528cc73CB7AC638a7c8ff", - "chainId": "97", - "lastRewardingSupplyBlockOrTimestamp": "0", - "lastRewardingBorrowBlockOrTimestamp": "0", - "supplySpeed": "434027777777778", - "borrowSpeed": "434027777777778", - "priceMantissa": "6409500000000000000", - "rewardsDistributorContractAddress": null, - "createdAt": "2024-06-18T14:48:54.000Z", - "updatedAt": "2024-09-03T14:58:33.000Z" - } - ] - }, - { - "address": "0x37C28DE42bA3d22217995D146FC684B2326Ede64", - "chainId": "97", - "symbol": "vADA", - "name": "Venus ADA", - "underlyingAddress": "0xcD34BC54106bd45A04Ed99EBcC2A6a3e70d7210F", - "underlyingName": "Binance-Peg Cardano Token", - "underlyingSymbol": "ADA", - "underlyingDecimal": 18, - "borrowerDailyXvsMantissa": "87499999999999872000", - "supplierDailyXvsMantissa": "87499999999999872000", - "xvsBorrowIndex": "1017736040995462295185676239178815537", - "xvsSupplyIndex": "1136999179013848911275960797314132729007991", - "borrowRatePerBlock": "5878105048", - "supplyRatePerBlock": "2456497735", - "exchangeRateMantissa": "216243797287914552404234393", - "underlyingPriceMantissa": "320610000000000000", - "totalBorrowsMantissa": "9089570141028019779483855", - "totalSupplyMantissa": "100582091306961905", - "cashMantissa": "12660683222349162890595202", - "totalReservesMantissa": "0", - "reserveFactorMantissa": "0", - "collateralFactorMantissa": "600000000000000000", - "borrowApy": "6.355400573963748019", - "supplyApy": "2.608546875574209802", - "borrowXvsApy": "7.255545114199961792", - "supplyXvsApy": "2.970618685146700051", - "borrowXvsApr": "0.0702432601", - "supplyXvsApr": "0.0293551082", - "liquidityCents": "405914164.7917365114353727", - "tokenPriceCents": "32.061", - "totalDistributedMantissa": "8041772673564487536114", - "lastCalculatedXvsAccruedBlockNumber": "40813640", - "supplyCapsMantissa": "115792089237316195423570985008687907853269984665640564039457584007913129639935", - "borrowCapsMantissa": "0", - "borrowerCount": 10, - "supplierCount": 6, - "estimatedPrimeBorrowApyBoost": null, - "estimatedPrimeSupplyApyBoost": null, - "pausedActionsBitmap": 0, - "isListed": true, - "poolComptrollerAddress": "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D", - "rewardsDistributors": [ - { - "marketAddress": "0x37C28DE42bA3d22217995D146FC684B2326Ede64", - "rewardTokenAddress": "0xB9e0E753630434d7863528cc73CB7AC638a7c8ff", - "chainId": "97", - "lastRewardingSupplyBlockOrTimestamp": "0", - "lastRewardingBorrowBlockOrTimestamp": "0", - "supplySpeed": "3038194444444440", - "borrowSpeed": "3038194444444440", - "priceMantissa": "6409500000000000000", - "rewardsDistributorContractAddress": null, - "createdAt": "2024-06-18T14:48:54.000Z", - "updatedAt": "2024-09-03T14:58:33.000Z" - } - ] - }, - { - "address": "0x2E7222e51c0f6e98610A1543Aa3836E092CDe62c", - "chainId": "97", - "symbol": "vBNB", - "name": "Venus BNB", - "underlyingAddress": null, - "underlyingName": "BNB", - "underlyingSymbol": "BNB", - "underlyingDecimal": 18, - "borrowerDailyXvsMantissa": "1499999990400000000000", - "supplierDailyXvsMantissa": "1499999990400000000000", - "xvsBorrowIndex": "105691042801504980925475682131713519630", - "xvsSupplyIndex": "8141544355417915063944376628824300520342639914", - "borrowRatePerBlock": "98326552387", - "supplyRatePerBlock": "90101857759", - "exchangeRateMantissa": "1773447735505080749666848858", - "underlyingPriceMantissa": "522556865270000000000", - "totalBorrowsMantissa": "1031519833913146342793186", - "totalSupplyMantissa": "476055424862453", - "cashMantissa": "5556233762724731858", - "totalReservesMantissa": "187265974949682677258591", - "reserveFactorMantissa": "250000000000000000", - "collateralFactorMantissa": "800000000000000000", - "borrowApy": "179.916227241628238879", - "supplyApy": "156.852648288428633396", - "borrowXvsApy": "0.651346878430104129", - "supplyXvsApy": "0.796390771213776658", - "borrowXvsApr": "0.0065102420", - "supplyXvsApr": "0.0079542420", - "liquidityCents": "290344.8097756772853617", - "tokenPriceCents": "52255.686527", - "totalDistributedMantissa": "259157084689196533384895", - "lastCalculatedXvsAccruedBlockNumber": "43377938", - "supplyCapsMantissa": "115792089237316195423570985008687907853269984665640564039457584007913129639935", - "borrowCapsMantissa": "0", - "borrowerCount": 263, - "supplierCount": 923, - "estimatedPrimeBorrowApyBoost": null, - "estimatedPrimeSupplyApyBoost": null, - "pausedActionsBitmap": 0, - "isListed": true, - "poolComptrollerAddress": "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D", - "rewardsDistributors": [ - { - "marketAddress": "0x2E7222e51c0f6e98610A1543Aa3836E092CDe62c", - "rewardTokenAddress": "0xB9e0E753630434d7863528cc73CB7AC638a7c8ff", - "chainId": "97", - "lastRewardingSupplyBlockOrTimestamp": "0", - "lastRewardingBorrowBlockOrTimestamp": "0", - "supplySpeed": "52083333000000000", - "borrowSpeed": "52083333000000000", - "priceMantissa": "6409500000000000000", - "rewardsDistributorContractAddress": null, - "createdAt": "2024-06-18T14:48:54.000Z", - "updatedAt": "2024-09-03T14:58:32.000Z" - } - ] - }, - { - "address": "0xb6e9322C49FD75a367Fcb17B0Fcd62C5070EbCBe", - "chainId": "97", - "symbol": "vBTC", - "name": "Venus BTC", - "underlyingAddress": "0xA808e341e8e723DC6BA0Bb5204Bafc2330d7B8e4", - "underlyingName": "BTCB Token", - "underlyingSymbol": "BTCB", - "underlyingDecimal": 18, - "borrowerDailyXvsMantissa": "1499999990400000000000", - "supplierDailyXvsMantissa": "1499999990400000000000", - "xvsBorrowIndex": "9405325536598357827724273005107028015331", - "xvsSupplyIndex": "1108558237039195785170238927132072069589267959679", - "borrowRatePerBlock": "11477039266", - "supplyRatePerBlock": "10396128619", - "exchangeRateMantissa": "267618928698396193302449922", - "underlyingPriceMantissa": "57726369000000000000000", - "totalBorrowsMantissa": "1954267680841100177596", - "totalSupplyMantissa": "7255510166453", - "cashMantissa": "0", - "totalReservesMantissa": "12555822934626074494", - "reserveFactorMantissa": "100000000000000000", - "collateralFactorMantissa": "800000000000000000", - "borrowApy": "12.783088574229786432", - "supplyApy": "11.512709317018632846", - "borrowXvsApy": "3.150600133555122671", - "supplyXvsApy": "3.171291877006591725", - "borrowXvsApr": "0.0311064164", - "supplyXvsApr": "0.0313075620", - "liquidityCents": "0", - "tokenPriceCents": "5772636.9", - "totalDistributedMantissa": "15618541847887808851523", - "lastCalculatedXvsAccruedBlockNumber": "41769612", - "supplyCapsMantissa": "115792089237316195423570985008687907853269984665640564039457584007913129639935", - "borrowCapsMantissa": "0", - "borrowerCount": 49, - "supplierCount": 30, - "estimatedPrimeBorrowApyBoost": "0", - "estimatedPrimeSupplyApyBoost": "0", - "pausedActionsBitmap": 0, - "isListed": true, - "poolComptrollerAddress": "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D", - "rewardsDistributors": [ - { - "marketAddress": "0xb6e9322C49FD75a367Fcb17B0Fcd62C5070EbCBe", - "rewardTokenAddress": "0xB9e0E753630434d7863528cc73CB7AC638a7c8ff", - "chainId": "97", - "lastRewardingSupplyBlockOrTimestamp": "0", - "lastRewardingBorrowBlockOrTimestamp": "0", - "supplySpeed": "52083333000000000", - "borrowSpeed": "52083333000000000", - "priceMantissa": "6409500000000000000", - "rewardsDistributorContractAddress": null, - "createdAt": "2024-06-18T14:48:54.000Z", - "updatedAt": "2024-09-03T14:58:33.000Z" - } - ] - }, - { - "address": "0x08e0A5575De71037aE36AbfAfb516595fE68e5e4", - "chainId": "97", - "symbol": "vBUSD", - "name": "Venus BUSD", - "underlyingAddress": "0x8301F2213c0eeD49a7E28Ae4c3e91722919B8B47", - "underlyingName": "BUSD", - "underlyingSymbol": "BUSD", - "underlyingDecimal": 18, - "borrowerDailyXvsMantissa": "0", - "supplierDailyXvsMantissa": "0", - "xvsBorrowIndex": "1977151763630172707382704323704603564", - "xvsSupplyIndex": "38295216010831373328189928188548146574423007", - "borrowRatePerBlock": "1902587521", - "supplyRatePerBlock": "0", - "exchangeRateMantissa": "203276602375088268292741033", - "underlyingPriceMantissa": "1000006200000000000", - "totalBorrowsMantissa": "246624445312815898417382769450", - "totalSupplyMantissa": "4919405329327832875221358523019", - "cashMantissa": "1000000000805039591593730097030595646249", - "totalReservesMantissa": "0", - "reserveFactorMantissa": "1000000000000000000", - "collateralFactorMantissa": "0", - "borrowApy": "2.014488270427066776", - "supplyApy": "0", - "borrowXvsApy": "0", - "supplyXvsApy": "0", - "borrowXvsApr": "0.0000000000", - "supplyXvsApr": "0.0000000000", - "liquidityCents": "100000620080504458283919.7978157197235942", - "tokenPriceCents": "100.00062", - "totalDistributedMantissa": "9656421926", - "lastCalculatedXvsAccruedBlockNumber": "40610282", - "supplyCapsMantissa": "0", - "borrowCapsMantissa": "1", - "borrowerCount": 438, - "supplierCount": 933, - "estimatedPrimeBorrowApyBoost": null, - "estimatedPrimeSupplyApyBoost": null, - "pausedActionsBitmap": 133, - "isListed": true, - "poolComptrollerAddress": "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D", - "rewardsDistributors": [ - { - "marketAddress": "0x08e0A5575De71037aE36AbfAfb516595fE68e5e4", - "rewardTokenAddress": "0xB9e0E753630434d7863528cc73CB7AC638a7c8ff", - "chainId": "97", - "lastRewardingSupplyBlockOrTimestamp": "0", - "lastRewardingBorrowBlockOrTimestamp": "0", - "supplySpeed": "0", - "borrowSpeed": "0", - "priceMantissa": "6409500000000000000", - "rewardsDistributorContractAddress": null, - "createdAt": "2024-06-18T14:48:54.000Z", - "updatedAt": "2024-09-03T14:58:33.000Z" - } - ] - }, - { - "address": "0xeDaC03D29ff74b5fDc0CC936F6288312e1459BC6", - "chainId": "97", - "symbol": "vCAKE", - "name": "Venus CAKE", - "underlyingAddress": "0xe8bd7cCC165FAEb9b81569B05424771B9A20cbEF", - "underlyingName": "CAKE", - "underlyingSymbol": "CAKE", - "underlyingDecimal": 18, - "borrowerDailyXvsMantissa": "87499999999999872000", - "supplierDailyXvsMantissa": "87499999999999872000", - "xvsBorrowIndex": "350539516507092513631266656739249188367", - "xvsSupplyIndex": "16966874130639415131680527385403644991373451866", - "borrowRatePerBlock": "2106158768", - "supplyRatePerBlock": "22535277", - "exchangeRateMantissa": "232365889426639360267554271", - "underlyingPriceMantissa": "1686000000000000000", - "totalBorrowsMantissa": "51355434309380964571964", - "totalSupplyMantissa": "15491857541329692", - "cashMantissa": "3548423822152483349893210", - "totalReservesMantissa": "0", - "reserveFactorMantissa": "250000000000000000", - "collateralFactorMantissa": "600000000000000000", - "borrowApy": "2.23241502900537543", - "supplyApy": "0.023626964646132097", - "borrowXvsApy": "948.664906542644205177", - "supplyXvsApy": "3.420614327600371608", - "borrowXvsApr": "2.3641830138", - "supplyXvsApr": "0.0337280808", - "liquidityCents": "598264256.4149086927919952", - "tokenPriceCents": "168.6", - "totalDistributedMantissa": "8501886931768998951051", - "lastCalculatedXvsAccruedBlockNumber": "42653243", - "supplyCapsMantissa": "115792089237316195423570985008687907853269984665640564039457584007913129639935", - "borrowCapsMantissa": "50000000000000000000000", - "borrowerCount": 8, - "supplierCount": 13, - "estimatedPrimeBorrowApyBoost": null, - "estimatedPrimeSupplyApyBoost": null, - "pausedActionsBitmap": 0, - "isListed": true, - "poolComptrollerAddress": "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D", - "rewardsDistributors": [ - { - "marketAddress": "0xeDaC03D29ff74b5fDc0CC936F6288312e1459BC6", - "rewardTokenAddress": "0xB9e0E753630434d7863528cc73CB7AC638a7c8ff", - "chainId": "97", - "lastRewardingSupplyBlockOrTimestamp": "0", - "lastRewardingBorrowBlockOrTimestamp": "0", - "supplySpeed": "3038194444444440", - "borrowSpeed": "3038194444444440", - "priceMantissa": "6409500000000000000", - "rewardsDistributorContractAddress": null, - "createdAt": "2024-06-18T14:48:54.000Z", - "updatedAt": "2024-09-03T14:58:33.000Z" - } - ] - }, - { - "address": "0xF912d3001CAf6DC4ADD366A62Cc9115B4303c9A9", - "chainId": "97", - "symbol": "vDOGE", - "name": "Venus DOGE", - "underlyingAddress": "0x67D262CE2b8b846d9B94060BC04DC40a83F0e25B", - "underlyingName": "DOGE", - "underlyingSymbol": "DOGE", - "underlyingDecimal": 8, - "borrowerDailyXvsMantissa": "45805000000000032000", - "supplierDailyXvsMantissa": "45805000000000032000", - "xvsBorrowIndex": "29477570890004228395941234702634547672863854277799208", - "xvsSupplyIndex": "27936096259934623016561227838755567528706818", - "borrowRatePerBlock": "2002755593", - "supplyRatePerBlock": "21088351", - "exchangeRateMantissa": "22127481133731064", - "underlyingPriceMantissa": "977800000000000000000000000", - "totalBorrowsMantissa": "1076723700152567", - "totalSupplyMantissa": "4621230319469918525", - "cashMantissa": "101179463008544036", - "totalReservesMantissa": "0", - "reserveFactorMantissa": "0", - "collateralFactorMantissa": "800000000000000000", - "borrowApy": "2.12166207506541981", - "supplyApy": "0.022109777257975513", - "borrowXvsApy": "10.681893261541533268", - "supplyXvsApy": "0.106937559332461288", - "borrowXvsApr": "0.1017830823", - "supplyXvsApr": "0.0010717421", - "liquidityCents": "9893327892.97543584008", - "tokenPriceCents": "9.778", - "totalDistributedMantissa": "81799852571307832068", - "lastCalculatedXvsAccruedBlockNumber": "40813640", - "supplyCapsMantissa": "115792089237316195423570985008687907853269984665640564039457584007913129639935", - "borrowCapsMantissa": "0", - "borrowerCount": 12, - "supplierCount": 4, - "estimatedPrimeBorrowApyBoost": null, - "estimatedPrimeSupplyApyBoost": null, - "pausedActionsBitmap": 0, - "isListed": true, - "poolComptrollerAddress": "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D", - "rewardsDistributors": [ - { - "marketAddress": "0xF912d3001CAf6DC4ADD366A62Cc9115B4303c9A9", - "rewardTokenAddress": "0xB9e0E753630434d7863528cc73CB7AC638a7c8ff", - "chainId": "97", - "lastRewardingSupplyBlockOrTimestamp": "0", - "lastRewardingBorrowBlockOrTimestamp": "0", - "supplySpeed": "1590451388888890", - "borrowSpeed": "1590451388888890", - "priceMantissa": "6409500000000000000", - "rewardsDistributorContractAddress": null, - "createdAt": "2024-06-18T14:48:54.000Z", - "updatedAt": "2024-09-03T14:58:33.000Z" - } - ] - }, - { - "address": "0x162D005F0Fff510E54958Cfc5CF32A3180A84aab", - "chainId": "97", - "symbol": "vETH", - "name": "Venus ETH", - "underlyingAddress": "0x98f7A83361F7Ac8765CcEBAB1425da6b341958a7", - "underlyingName": "Ethereum Token", - "underlyingSymbol": "ETH", - "underlyingDecimal": 18, - "borrowerDailyXvsMantissa": "250000012800000000000", - "supplierDailyXvsMantissa": "250000012800000000000", - "xvsBorrowIndex": "268589938372675892994578512370576569759", - "xvsSupplyIndex": "13805526024990152334999386496181183990421862352", - "borrowRatePerBlock": "11428816224", - "supplyRatePerBlock": "10300305713", - "exchangeRateMantissa": "265653038049231291803344237", - "underlyingPriceMantissa": "2446538900000000000000", - "totalBorrowsMantissa": "15135219324740320369457", - "totalSupplyMantissa": "56894145058707", - "cashMantissa": "0", - "totalReservesMantissa": "21116842681145210304", - "reserveFactorMantissa": "100000000000000000", - "collateralFactorMantissa": "800000000000000000", - "borrowApy": "12.726106336788702714", - "supplyApy": "11.400780963386549066", - "borrowXvsApy": "1.587596592520731068", - "supplyXvsApy": "1.589832212603489454", - "borrowXvsApr": "0.0157948754", - "supplyXvsApr": "0.0158169433", - "liquidityCents": "0", - "tokenPriceCents": "244653.89", - "totalDistributedMantissa": "770610123023466747020", - "lastCalculatedXvsAccruedBlockNumber": "40813640", - "supplyCapsMantissa": "115792089237316195423570985008687907853269984665640564039457584007913129639935", - "borrowCapsMantissa": "0", - "borrowerCount": 35, - "supplierCount": 25, - "estimatedPrimeBorrowApyBoost": "0", - "estimatedPrimeSupplyApyBoost": "0", - "pausedActionsBitmap": 0, - "isListed": true, - "poolComptrollerAddress": "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D", - "rewardsDistributors": [ - { - "marketAddress": "0x162D005F0Fff510E54958Cfc5CF32A3180A84aab", - "rewardTokenAddress": "0xB9e0E753630434d7863528cc73CB7AC638a7c8ff", - "chainId": "97", - "lastRewardingSupplyBlockOrTimestamp": "0", - "lastRewardingBorrowBlockOrTimestamp": "0", - "supplySpeed": "8680556000000000", - "borrowSpeed": "8680556000000000", - "priceMantissa": "6409500000000000000", - "rewardsDistributorContractAddress": null, - "createdAt": "2024-06-18T14:48:54.000Z", - "updatedAt": "2024-09-03T14:58:33.000Z" - } - ] - }, - { - "address": "0xF06e662a00796c122AaAE935EC4F0Be3F74f5636", - "chainId": "97", - "symbol": "vFDUSD", - "name": "Venus FDUSD", - "underlyingAddress": "0xcF27439fA231af9931ee40c4f27Bb77B83826F3C", - "underlyingName": "First Digital USD", - "underlyingSymbol": "FDUSD", - "underlyingDecimal": 18, - "borrowerDailyXvsMantissa": "4999999999999996800", - "supplierDailyXvsMantissa": "4999999999999996800", - "xvsBorrowIndex": "72309412846065359669169680816853700396255739746", - "xvsSupplyIndex": "431910243846800487986776637097922605992467636", - "borrowRatePerBlock": "654015", - "supplyRatePerBlock": "58", - "exchangeRateMantissa": "10000000001895916581414104083", - "underlyingPriceMantissa": "1000000000000000000", - "totalBorrowsMantissa": "1000002116574035040", - "totalSupplyMantissa": "1000000000001", - "cashMantissa": "9998999999789342546376", - "totalReservesMantissa": "0", - "reserveFactorMantissa": "100000000000000000", - "collateralFactorMantissa": "750000000000000000", - "borrowApy": "0.000685619348701698", - "supplyApy": "0.000000060802560018", - "borrowXvsApy": "1000000", - "supplyXvsApy": "220.484512694700409915", - "borrowXvsApr": "11697.3127417716", - "supplyXvsApr": "1.1697337498", - "liquidityCents": "999899.9999789342546376", - "tokenPriceCents": "100", - "totalDistributedMantissa": "725658854166666202244", - "lastCalculatedXvsAccruedBlockNumber": "40330700", - "supplyCapsMantissa": "5500000000000000000000000", - "borrowCapsMantissa": "4400000000000000000000000", - "borrowerCount": 1, - "supplierCount": 2, - "estimatedPrimeBorrowApyBoost": null, - "estimatedPrimeSupplyApyBoost": null, - "pausedActionsBitmap": 0, - "isListed": true, - "poolComptrollerAddress": "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D", - "rewardsDistributors": [ - { - "marketAddress": "0xF06e662a00796c122AaAE935EC4F0Be3F74f5636", - "rewardTokenAddress": "0xB9e0E753630434d7863528cc73CB7AC638a7c8ff", - "chainId": "97", - "lastRewardingSupplyBlockOrTimestamp": "0", - "lastRewardingBorrowBlockOrTimestamp": "0", - "supplySpeed": "173611111111111", - "borrowSpeed": "173611111111111", - "priceMantissa": "6409500000000000000", - "rewardsDistributorContractAddress": null, - "createdAt": "2024-06-18T14:48:54.000Z", - "updatedAt": "2024-09-03T14:58:33.000Z" - } - ] - }, - { - "address": "0xAfc13BC065ABeE838540823431055D2ea52eBA52", - "chainId": "97", - "symbol": "vLTC", - "name": "Venus LTC", - "underlyingAddress": "0x969F147B6b8D81f86175de33206A4FD43dF17913", - "underlyingName": "Litecoin Token", - "underlyingSymbol": "LTC", - "underlyingDecimal": 18, - "borrowerDailyXvsMantissa": "250000012800000000000", - "supplierDailyXvsMantissa": "250000012800000000000", - "xvsBorrowIndex": "321358523398000000010831693964764549022765455853397163883", - "xvsSupplyIndex": "438901240485943276689544632773456407273653745", - "borrowRatePerBlock": "11402809068", - "supplyRatePerBlock": "10248810129", - "exchangeRateMantissa": "251415701150693845575391004", - "underlyingPriceMantissa": "64781729000000000000", - "totalBorrowsMantissa": "345330590935747400499587", - "totalSupplyMantissa": "1375382739904149", - "cashMantissa": "462224967816607358036", - "totalReservesMantissa": "0", - "reserveFactorMantissa": "100000000000000000", - "collateralFactorMantissa": "600000000000000000", - "borrowApy": "12.695387179561544987", - "supplyApy": "11.340676542337701886", - "borrowXvsApy": "2.641411313772282414", - "supplyXvsApy": "2.637834474900266459", - "borrowXvsApr": "0.0261438450", - "supplyXvsApr": "0.0261088983", - "liquidityCents": "2994373.2602129179567694", - "tokenPriceCents": "6478.1729", - "totalDistributedMantissa": "14424596326849945425398", - "lastCalculatedXvsAccruedBlockNumber": "42399093", - "supplyCapsMantissa": "115792089237316195423570985008687907853269984665640564039457584007913129639935", - "borrowCapsMantissa": "0", - "borrowerCount": 27, - "supplierCount": 18, - "estimatedPrimeBorrowApyBoost": null, - "estimatedPrimeSupplyApyBoost": null, - "pausedActionsBitmap": 0, - "isListed": true, - "poolComptrollerAddress": "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D", - "rewardsDistributors": [ - { - "marketAddress": "0xAfc13BC065ABeE838540823431055D2ea52eBA52", - "rewardTokenAddress": "0xB9e0E753630434d7863528cc73CB7AC638a7c8ff", - "chainId": "97", - "lastRewardingSupplyBlockOrTimestamp": "0", - "lastRewardingBorrowBlockOrTimestamp": "0", - "supplySpeed": "8680556000000000", - "borrowSpeed": "8680556000000000", - "priceMantissa": "6409500000000000000", - "rewardsDistributorContractAddress": null, - "createdAt": "2024-06-18T14:48:54.000Z", - "updatedAt": "2024-09-03T14:58:33.000Z" - } - ] - }, - { - "address": "0x3619bdDc61189F33365CC572DF3a68FB3b316516", - "chainId": "97", - "symbol": "vMATIC", - "name": "Venus MATIC", - "underlyingAddress": "0xcfeb0103d4BEfa041EA4c2dACce7B3E83E1aE7E3", - "underlyingName": "Polygon", - "underlyingSymbol": "MATIC", - "underlyingDecimal": 18, - "borrowerDailyXvsMantissa": "0", - "supplierDailyXvsMantissa": "0", - "xvsBorrowIndex": "1000000000000000000000000000000000000", - "xvsSupplyIndex": "1000000000000000000000000000000000000", - "borrowRatePerBlock": "6267125814", - "supplyRatePerBlock": "1725215392", - "exchangeRateMantissa": "959012059148581915724511904", - "underlyingPriceMantissa": "406592670000000000", - "totalBorrowsMantissa": "4306173407219413942425029", - "totalSupplyMantissa": "14680303852746521", - "cashMantissa": "9772415019529887636730721", - "totalReservesMantissa": "0", - "reserveFactorMantissa": "100000000000000000", - "collateralFactorMantissa": "600000000000000000", - "borrowApy": "6.789946785599375754", - "supplyApy": "1.824985862525394149", - "borrowXvsApy": "0", - "supplyXvsApy": "0", - "borrowXvsApr": "0.0000000000", - "supplyXvsApr": "0.0000000000", - "liquidityCents": "397339231.5138759159018333", - "tokenPriceCents": "40.659267", - "totalDistributedMantissa": "0", - "lastCalculatedXvsAccruedBlockNumber": "42776399", - "supplyCapsMantissa": "115792089237316195423570985008687907853269984665640564039457584007913129639935", - "borrowCapsMantissa": "0", - "borrowerCount": 8, - "supplierCount": 6, - "estimatedPrimeBorrowApyBoost": null, - "estimatedPrimeSupplyApyBoost": null, - "pausedActionsBitmap": 0, - "isListed": true, - "poolComptrollerAddress": "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D", - "rewardsDistributors": [ - { - "marketAddress": "0x3619bdDc61189F33365CC572DF3a68FB3b316516", - "rewardTokenAddress": "0xB9e0E753630434d7863528cc73CB7AC638a7c8ff", - "chainId": "97", - "lastRewardingSupplyBlockOrTimestamp": "0", - "lastRewardingBorrowBlockOrTimestamp": "0", - "supplySpeed": "0", - "borrowSpeed": "0", - "priceMantissa": "6409500000000000000", - "rewardsDistributorContractAddress": null, - "createdAt": "2024-06-18T14:48:54.000Z", - "updatedAt": "2024-09-03T14:58:33.000Z" - } - ] - }, - { - "address": "0x74469281310195A04840Daf6EdF576F559a3dE80", - "chainId": "97", - "symbol": "vSXP", - "name": "Venus SXP", - "underlyingAddress": "0x75107940Cf1121232C0559c747A986DEfbc69DA9", - "underlyingName": "SXP", - "underlyingSymbol": "SXP", - "underlyingDecimal": 18, - "borrowerDailyXvsMantissa": "24999999999999984000", - "supplierDailyXvsMantissa": "24999999999999984000", - "xvsBorrowIndex": "2214118777264877536505516095372072208", - "xvsSupplyIndex": "92030607810320351810386787595126360793714730", - "borrowRatePerBlock": "11612791560", - "supplyRatePerBlock": "10668241746", - "exchangeRateMantissa": "252388541107195703411128782", - "underlyingPriceMantissa": "196071650000000000", - "totalBorrowsMantissa": "1254947258163647298227534213569428", - "totalSupplyMantissa": "4871269223886847400340315", - "cashMantissa": "0", - "totalReservesMantissa": "25494725406464402806465223027321", - "reserveFactorMantissa": "100000000000000000", - "collateralFactorMantissa": "500000000000000000", - "borrowApy": "12.943653105664683333", - "supplyApy": "11.831169702098985539", - "borrowXvsApy": "0.000000023704197974", - "supplyXvsApy": "0.000000024195743574", - "borrowXvsApr": "0.0000000002", - "supplyXvsApr": "0.0000000002", - "liquidityCents": "0", - "tokenPriceCents": "19.607165", - "totalDistributedMantissa": "50444713385654794", - "lastCalculatedXvsAccruedBlockNumber": "40813640", - "supplyCapsMantissa": "1007000000000000000000000000000000", - "borrowCapsMantissa": "0", - "borrowerCount": 277, - "supplierCount": 661, - "estimatedPrimeBorrowApyBoost": null, - "estimatedPrimeSupplyApyBoost": null, - "pausedActionsBitmap": 0, - "isListed": true, - "poolComptrollerAddress": "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D", - "rewardsDistributors": [ - { - "marketAddress": "0x74469281310195A04840Daf6EdF576F559a3dE80", - "rewardTokenAddress": "0xB9e0E753630434d7863528cc73CB7AC638a7c8ff", - "chainId": "97", - "lastRewardingSupplyBlockOrTimestamp": "0", - "lastRewardingBorrowBlockOrTimestamp": "0", - "supplySpeed": "868055555555555", - "borrowSpeed": "868055555555555", - "priceMantissa": "6409500000000000000", - "rewardsDistributorContractAddress": null, - "createdAt": "2024-06-18T14:48:54.000Z", - "updatedAt": "2024-09-03T14:58:33.000Z" - } - ] - }, - { - "address": "0x6AF3Fdb3282c5bb6926269Db10837fa8Aec67C04", - "chainId": "97", - "symbol": "vTRX", - "name": "Venus TRX", - "underlyingAddress": "0x7D21841DC10BA1C5797951EFc62fADBBDD06704B", - "underlyingName": "TRON", - "underlyingSymbol": "TRX", - "underlyingDecimal": 6, - "borrowerDailyXvsMantissa": "24999999999999984000", - "supplierDailyXvsMantissa": "24999999999999984000", - "xvsBorrowIndex": "3206120070683388844186748616448660508496352622374", - "xvsSupplyIndex": "117133827040061860395551187737238783537930745", - "borrowRatePerBlock": "181750044826", - "supplyRatePerBlock": "174507013343", - "exchangeRateMantissa": "50437671786208427", - "underlyingPriceMantissa": "151239800000000000000000000000", - "totalBorrowsMantissa": "6057002965093", - "totalSupplyMantissa": "100058590996759", - "cashMantissa": "0", - "totalReservesMantissa": "1010280593008", - "reserveFactorMantissa": "200000000000000000", - "collateralFactorMantissa": "600000000000000000", - "borrowApy": "568.825359528345682152", - "supplyApy": "520.161775569854727359", - "borrowXvsApy": "6.573577685405158249", - "supplyXvsApy": "7.94039480487733241", - "borrowXvsApr": "0.0638459193", - "supplyXvsApr": "0.0766269459", - "liquidityCents": "0", - "tokenPriceCents": "15.12398", - "totalDistributedMantissa": "4124113459493255217238", - "lastCalculatedXvsAccruedBlockNumber": "40813640", - "supplyCapsMantissa": "115792089237316195423570985008687907853269984665640564039457584007913129639935", - "borrowCapsMantissa": "0", - "borrowerCount": 1, - "supplierCount": 3, - "estimatedPrimeBorrowApyBoost": null, - "estimatedPrimeSupplyApyBoost": null, - "pausedActionsBitmap": 0, - "isListed": true, - "poolComptrollerAddress": "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D", - "rewardsDistributors": [ - { - "marketAddress": "0x6AF3Fdb3282c5bb6926269Db10837fa8Aec67C04", - "rewardTokenAddress": "0xB9e0E753630434d7863528cc73CB7AC638a7c8ff", - "chainId": "97", - "lastRewardingSupplyBlockOrTimestamp": "0", - "lastRewardingBorrowBlockOrTimestamp": "0", - "supplySpeed": "868055555555555", - "borrowSpeed": "868055555555555", - "priceMantissa": "6409500000000000000", - "rewardsDistributorContractAddress": null, - "createdAt": "2024-06-18T14:48:54.000Z", - "updatedAt": "2024-09-03T14:58:33.000Z" - } - ] - }, - { - "address": "0x369Fea97f6fB7510755DCA389088d9E2e2819278", - "chainId": "97", - "symbol": "vTRXOLD", - "name": "Venus TRXOLD", - "underlyingAddress": "0x19E7215abF8B2716EE807c9f4b83Af0e7f92653F", - "underlyingName": "TRON", - "underlyingSymbol": "TRX", - "underlyingDecimal": 18, - "borrowerDailyXvsMantissa": "25000000000000012800", - "supplierDailyXvsMantissa": "25000000000000012800", - "xvsBorrowIndex": "1116319444444458592972336404424292900444743561428437019", - "xvsSupplyIndex": "894606301239538712616137272975672334071540266", - "borrowRatePerBlock": "187623505280", - "supplyRatePerBlock": "183235531222", - "exchangeRateMantissa": "5154651109509209711223889381", - "underlyingPriceMantissa": "151239800000000000", - "totalBorrowsMantissa": "10612941138090987816358017134188878", - "totalSupplyMantissa": "1686568639918209626233292", - "cashMantissa": "0", - "totalReservesMantissa": "1919268227073149767108083637197926", - "reserveFactorMantissa": "200000000000000000", - "collateralFactorMantissa": "600000000000000000", - "borrowApy": "611.069282541134837625", - "supplyApy": "579.266956322473345728", - "borrowXvsApy": "0.000000003633822192", - "supplyXvsApy": "0.000000004436047252", - "borrowXvsApr": "0.0000000000", - "supplyXvsApr": "0.0000000000", - "liquidityCents": "0", - "tokenPriceCents": "15.12398", - "totalDistributedMantissa": "0", - "lastCalculatedXvsAccruedBlockNumber": "42769433", - "supplyCapsMantissa": "115792089237316195423570985008687907853269984665640564039457584007913129639935", - "borrowCapsMantissa": "0", - "borrowerCount": 4, - "supplierCount": 4, - "estimatedPrimeBorrowApyBoost": null, - "estimatedPrimeSupplyApyBoost": null, - "pausedActionsBitmap": 0, - "isListed": true, - "poolComptrollerAddress": "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D", - "rewardsDistributors": [ - { - "marketAddress": "0x369Fea97f6fB7510755DCA389088d9E2e2819278", - "rewardTokenAddress": "0xB9e0E753630434d7863528cc73CB7AC638a7c8ff", - "chainId": "97", - "lastRewardingSupplyBlockOrTimestamp": "0", - "lastRewardingBorrowBlockOrTimestamp": "0", - "supplySpeed": "868055555555556", - "borrowSpeed": "868055555555556", - "priceMantissa": "6409500000000000000", - "rewardsDistributorContractAddress": null, - "createdAt": "2024-06-18T14:48:54.000Z", - "updatedAt": "2024-09-03T14:58:33.000Z" - } - ] - }, - { - "address": "0x3A00d9B02781f47d033BAd62edc55fBF8D083Fb0", - "chainId": "97", - "symbol": "vTUSDOLD", - "name": "Venus TUSDOLD", - "underlyingAddress": "0xFeC3A63401Eb9C1476200d7C32c4009Be0154169", - "underlyingName": "TrueUSD", - "underlyingSymbol": "TUSD", - "underlyingDecimal": 18, - "borrowerDailyXvsMantissa": "0", - "supplierDailyXvsMantissa": "0", - "xvsBorrowIndex": "12589249437975844774090757370352084339106920314", - "xvsSupplyIndex": "2828780501409777475336780747363835676", - "borrowRatePerBlock": "2947815", - "supplyRatePerBlock": "0", - "exchangeRateMantissa": "22000002162622067652", - "underlyingPriceMantissa": "1000000000000000000", - "totalBorrowsMantissa": "62784550287202573863525", - "totalSupplyMantissa": "4604838929893023262857822", - "cashMantissa": "101243681865885596980072254", - "totalReservesMantissa": "0", - "reserveFactorMantissa": "1000000000000000000", - "collateralFactorMantissa": "550000000000000000", - "borrowApy": "0.003090301038442095", - "supplyApy": "0", - "borrowXvsApy": "0", - "supplyXvsApy": "0", - "borrowXvsApr": "0.0000000000", - "supplyXvsApr": "0.0000000000", - "liquidityCents": "10124368186.5885596980072254", - "tokenPriceCents": "100", - "totalDistributedMantissa": "0", - "lastCalculatedXvsAccruedBlockNumber": "38638517", - "supplyCapsMantissa": "115792089237316195423570985008687907853269984665640564039457584007913129639935", - "borrowCapsMantissa": "0", - "borrowerCount": 1, - "supplierCount": 1, - "estimatedPrimeBorrowApyBoost": null, - "estimatedPrimeSupplyApyBoost": null, - "pausedActionsBitmap": 133, - "isListed": true, - "poolComptrollerAddress": "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D", - "rewardsDistributors": [ - { - "marketAddress": "0x3A00d9B02781f47d033BAd62edc55fBF8D083Fb0", - "rewardTokenAddress": "0xB9e0E753630434d7863528cc73CB7AC638a7c8ff", - "chainId": "97", - "lastRewardingSupplyBlockOrTimestamp": "0", - "lastRewardingBorrowBlockOrTimestamp": "0", - "supplySpeed": "0", - "borrowSpeed": "0", - "priceMantissa": "6409500000000000000", - "rewardsDistributorContractAddress": null, - "createdAt": "2024-06-18T14:48:54.000Z", - "updatedAt": "2024-09-03T14:58:33.000Z" - } - ] - }, - { - "address": "0xEFAACF73CE2D38ED40991f29E72B12C74bd4cf23", - "chainId": "97", - "symbol": "vTUSD", - "name": "Venus TUSD", - "underlyingAddress": "0xB32171ecD878607FFc4F8FC0bCcE6852BB3149E0", - "underlyingName": "TrueUSD", - "underlyingSymbol": "TUSD", - "underlyingDecimal": 18, - "borrowerDailyXvsMantissa": "6250000000000003200", - "supplierDailyXvsMantissa": "6250000000000003200", - "xvsBorrowIndex": "1172232299342796453991734978184325204", - "xvsSupplyIndex": "1703785116404226307319288163144672676222846157", - "borrowRatePerBlock": "26854931049", - "supplyRatePerBlock": "24708239800", - "exchangeRateMantissa": "13058860455495617397721393034", - "underlyingPriceMantissa": "1000000000000000000", - "totalBorrowsMantissa": "13416727508636764715024", - "totalSupplyMantissa": "1005000000000", - "cashMantissa": "0", - "totalReservesMantissa": "292572750863669230314", - "reserveFactorMantissa": "100000000000000000", - "collateralFactorMantissa": "0", - "borrowApy": "32.500575155026984524", - "supplyApy": "29.55422115445964043", - "borrowXvsApy": "196.004374796796467855", - "supplyXvsApy": "203.24150262708903721", - "borrowXvsApr": "1.0898091107", - "supplyXvsApr": "1.1141038905", - "liquidityCents": "0", - "tokenPriceCents": "100", - "totalDistributedMantissa": "0", - "lastCalculatedXvsAccruedBlockNumber": "38638517", - "supplyCapsMantissa": "1000000000000000000000000", - "borrowCapsMantissa": "600000000000000000000000", - "borrowerCount": 0, - "supplierCount": 0, - "estimatedPrimeBorrowApyBoost": null, - "estimatedPrimeSupplyApyBoost": null, - "pausedActionsBitmap": 0, - "isListed": true, - "poolComptrollerAddress": "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D", - "rewardsDistributors": [ - { - "marketAddress": "0xEFAACF73CE2D38ED40991f29E72B12C74bd4cf23", - "rewardTokenAddress": "0xB9e0E753630434d7863528cc73CB7AC638a7c8ff", - "chainId": "97", - "lastRewardingSupplyBlockOrTimestamp": "0", - "lastRewardingBorrowBlockOrTimestamp": "0", - "supplySpeed": "217013888888889", - "borrowSpeed": "217013888888889", - "priceMantissa": "6409500000000000000", - "rewardsDistributorContractAddress": null, - "createdAt": "2024-06-18T14:48:54.000Z", - "updatedAt": "2024-09-03T14:58:33.000Z" - } - ] - }, - { - "address": "0x171B468b52d7027F12cEF90cd065d6776a25E24e", - "chainId": "97", - "symbol": "vUNI", - "name": "Venus UNI", - "underlyingAddress": "0x8D2f061C75780d8D91c10A7230B907411aCBC8fC", - "underlyingName": "Uniswap", - "underlyingSymbol": "UNI", - "underlyingDecimal": 18, - "borrowerDailyXvsMantissa": "2340000000000000000", - "supplierDailyXvsMantissa": "2340000000000000000", - "xvsBorrowIndex": "324243050000000000000000000000000000000", - "xvsSupplyIndex": "1316423590403528166734410983148239848843830093", - "borrowRatePerBlock": "7747576", - "supplyRatePerBlock": "2366", - "exchangeRateMantissa": "10000000210411150435540151977", - "underlyingPriceMantissa": "4100000000000000000", - "totalBorrowsMantissa": "1000068884847210887", - "totalSupplyMantissa": "245588863999", - "cashMantissa": "2454888622779788197300", - "totalReservesMantissa": "0", - "reserveFactorMantissa": "250000000000000000", - "collateralFactorMantissa": "550000000000000000", - "borrowApy": "0.008122267804506585", - "supplyApy": "0.000002480325150675", - "borrowXvsApy": "1000000", - "supplyXvsApy": "71.906974153217368033", - "borrowXvsApr": "1335.1163112047", - "supplyXvsApr": "0.5436762199", - "liquidityCents": "1006504.335339713160893", - "tokenPriceCents": "410", - "totalDistributedMantissa": "0", - "lastCalculatedXvsAccruedBlockNumber": "38638517", - "supplyCapsMantissa": "100000000000000000000000", - "borrowCapsMantissa": "50000000000000000000000", - "borrowerCount": 1, - "supplierCount": 2, - "estimatedPrimeBorrowApyBoost": null, - "estimatedPrimeSupplyApyBoost": null, - "pausedActionsBitmap": 0, - "isListed": true, - "poolComptrollerAddress": "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D", - "rewardsDistributors": [ - { - "marketAddress": "0x171B468b52d7027F12cEF90cd065d6776a25E24e", - "rewardTokenAddress": "0xB9e0E753630434d7863528cc73CB7AC638a7c8ff", - "chainId": "97", - "lastRewardingSupplyBlockOrTimestamp": "0", - "lastRewardingBorrowBlockOrTimestamp": "0", - "supplySpeed": "81250000000000", - "borrowSpeed": "81250000000000", - "priceMantissa": "6409500000000000000", - "rewardsDistributorContractAddress": null, - "createdAt": "2024-06-18T14:48:54.000Z", - "updatedAt": "2024-09-03T14:58:33.000Z" - } - ] - }, - { - "address": "0xD5C4C2e2facBEB59D0216D0595d63FcDc6F9A1a7", - "chainId": "97", - "symbol": "vUSDC", - "name": "Venus USDC", - "underlyingAddress": "0x16227D60f7a0e586C66B005219dfc887D13C9531", - "underlyingName": "USDC", - "underlyingSymbol": "USDC", - "underlyingDecimal": 6, - "borrowerDailyXvsMantissa": "499999996800000000000", - "supplierDailyXvsMantissa": "499999996800000000000", - "xvsBorrowIndex": "2513615443067425983890015492722034985810503560752", - "xvsSupplyIndex": "18116117080577329072147625407407020698819079", - "borrowRatePerBlock": "1902587666", - "supplyRatePerBlock": "26", - "exchangeRateMantissa": "212182314281319", - "underlyingPriceMantissa": "1000087800000000000000000000000", - "totalBorrowsMantissa": "15624105827811046883", - "totalSupplyMantissa": "4760890765432828888806260211280", - "cashMantissa": "1010176805025995623519739993", - "totalReservesMantissa": "0", - "reserveFactorMantissa": "100000000000000000", - "collateralFactorMantissa": "810000000000000000", - "borrowApy": "2.01448842548712155", - "supplyApy": "0.000000027256320003", - "borrowXvsApy": "0.000007465557623335", - "supplyXvsApy": "0.000000000000115388", - "borrowXvsApr": "0.0000000749", - "supplyXvsApr": "0.0000000000", - "liquidityCents": "101026549854947690593548.50261713854", - "tokenPriceCents": "100.00878", - "totalDistributedMantissa": "5441010114342408", - "lastCalculatedXvsAccruedBlockNumber": "43154959", - "supplyCapsMantissa": "115792089237316195423570985008687907853269984665640564039457584007913129639935", - "borrowCapsMantissa": "0", - "borrowerCount": 229, - "supplierCount": 534, - "estimatedPrimeBorrowApyBoost": "0", - "estimatedPrimeSupplyApyBoost": "0", - "pausedActionsBitmap": 0, - "isListed": true, - "poolComptrollerAddress": "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D", - "rewardsDistributors": [ - { - "marketAddress": "0xD5C4C2e2facBEB59D0216D0595d63FcDc6F9A1a7", - "rewardTokenAddress": "0xB9e0E753630434d7863528cc73CB7AC638a7c8ff", - "chainId": "97", - "lastRewardingSupplyBlockOrTimestamp": "0", - "lastRewardingBorrowBlockOrTimestamp": "0", - "supplySpeed": "17361111000000000", - "borrowSpeed": "17361111000000000", - "priceMantissa": "6409500000000000000", - "rewardsDistributorContractAddress": null, - "createdAt": "2024-06-18T14:48:54.000Z", - "updatedAt": "2024-09-03T14:58:32.000Z" - } - ] - }, - { - "address": "0xb7526572FFE56AB9D7489838Bf2E18e3323b441A", - "chainId": "97", - "symbol": "vUSDT", - "name": "Venus USDT", - "underlyingAddress": "0xA11c8D9DC9b66E209Ef60F0C8D969D3CD988782c", - "underlyingName": "USDT", - "underlyingSymbol": "USDT", - "underlyingDecimal": 6, - "borrowerDailyXvsMantissa": "499999996800000000000", - "supplierDailyXvsMantissa": "499999996800000000000", - "xvsBorrowIndex": "3159570043183500785798225680693711670622959548527", - "xvsSupplyIndex": "50767324415277671732355063874605899243901012", - "borrowRatePerBlock": "1902587519", - "supplyRatePerBlock": "0", - "exchangeRateMantissa": "200776461931237", - "underlyingPriceMantissa": "999962830000000000000000000000", - "totalBorrowsMantissa": "7437398122554", - "totalSupplyMantissa": "49810304144596634830089279266960347223689796", - "cashMantissa": "10000736633870942814396398228131487657572", - "totalReservesMantissa": "0", - "reserveFactorMantissa": "100000000000000000", - "collateralFactorMantissa": "800000000000000000", - "borrowApy": "2.014488268288307401", - "supplyApy": "0", - "borrowXvsApy": "16.978319455633402879", - "supplyXvsApy": "0", - "borrowXvsApr": "0.1572831256", - "supplyXvsApr": "0.0000000000", - "liquidityCents": "1000036490649026183145198711400934801.017576804876", - "tokenPriceCents": "99.996283", - "totalDistributedMantissa": "10280094790496879416570", - "lastCalculatedXvsAccruedBlockNumber": "42329402", - "supplyCapsMantissa": "115792089237316195423570985008687907853269984665640564039457584007913129639935", - "borrowCapsMantissa": "0", - "borrowerCount": 249, - "supplierCount": 670, - "estimatedPrimeBorrowApyBoost": "301.053134481467201813", - "estimatedPrimeSupplyApyBoost": "301.053134481467201813", - "pausedActionsBitmap": 0, - "isListed": true, - "poolComptrollerAddress": "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D", - "rewardsDistributors": [ - { - "marketAddress": "0xb7526572FFE56AB9D7489838Bf2E18e3323b441A", - "rewardTokenAddress": "0xB9e0E753630434d7863528cc73CB7AC638a7c8ff", - "chainId": "97", - "lastRewardingSupplyBlockOrTimestamp": "0", - "lastRewardingBorrowBlockOrTimestamp": "0", - "supplySpeed": "17361111000000000", - "borrowSpeed": "17361111000000000", - "priceMantissa": "6409500000000000000", - "rewardsDistributorContractAddress": null, - "createdAt": "2024-06-18T14:48:54.000Z", - "updatedAt": "2024-09-03T14:58:33.000Z" - } - ] - }, - { - "address": "0x6d6F697e34145Bb95c54E77482d97cc261Dc237E", - "chainId": "97", - "symbol": "Venus XVS", - "name": "vXVS", - "underlyingAddress": "0xB9e0E753630434d7863528cc73CB7AC638a7c8ff", - "underlyingName": "Venus", - "underlyingSymbol": "XVS", - "underlyingDecimal": 18, - "borrowerDailyXvsMantissa": "0", - "supplierDailyXvsMantissa": "0", - "xvsBorrowIndex": "1306014178018669882667220692703167088", - "xvsSupplyIndex": "12001246649616749573360284547054922972341230", - "borrowRatePerBlock": "14815172690", - "supplyRatePerBlock": "1730453971", - "exchangeRateMantissa": "211104888219909524206925479", - "underlyingPriceMantissa": "6409500000000000000", - "totalBorrowsMantissa": "416830497450657884046579", - "totalSupplyMantissa": "12678536539791436", - "cashMantissa": "2259670541574051694198243", - "totalReservesMantissa": "0", - "reserveFactorMantissa": "250000000000000000", - "collateralFactorMantissa": "600000000000000000", - "borrowApy": "16.798179063657014898", - "supplyApy": "1.830577667825525182", - "borrowXvsApy": "0", - "supplyXvsApy": "0", - "borrowXvsApr": "0.0000000000", - "supplyXvsApr": "0.0000000000", - "liquidityCents": "1448335833.6218884333963638", - "tokenPriceCents": "640.95", - "totalDistributedMantissa": "22572109963147294", - "lastCalculatedXvsAccruedBlockNumber": "40753215", - "supplyCapsMantissa": "3750000000000000000000000", - "borrowCapsMantissa": "270000000000000000000000", - "borrowerCount": 68, - "supplierCount": 274, - "estimatedPrimeBorrowApyBoost": null, - "estimatedPrimeSupplyApyBoost": null, - "pausedActionsBitmap": 0, - "isListed": true, - "poolComptrollerAddress": "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D", - "rewardsDistributors": [ - { - "marketAddress": "0x6d6F697e34145Bb95c54E77482d97cc261Dc237E", - "rewardTokenAddress": "0xB9e0E753630434d7863528cc73CB7AC638a7c8ff", - "chainId": "97", - "lastRewardingSupplyBlockOrTimestamp": "0", - "lastRewardingBorrowBlockOrTimestamp": "0", - "supplySpeed": "0", - "borrowSpeed": "0", - "priceMantissa": "6409500000000000000", - "rewardsDistributorContractAddress": null, - "createdAt": "2024-06-18T14:48:54.000Z", - "updatedAt": "2024-09-03T14:58:33.000Z" - } - ] - }, - { - "address": "0x35566ED3AF9E537Be487C98b1811cDf95ad0C32b", - "chainId": "97", - "symbol": "vWBETH", - "name": "Venus WBETH", - "underlyingAddress": "0x9c37E59Ba22c4320547F00D4f1857AF1abd1Dd6f", - "underlyingName": "Wrapped Binance Beacon ETH", - "underlyingSymbol": "wBETH", - "underlyingDecimal": 18, - "borrowerDailyXvsMantissa": "17177499999999936000", - "supplierDailyXvsMantissa": "17177499999999936000", - "xvsBorrowIndex": "942098443819440938096000000000000000000", - "xvsSupplyIndex": "8566375013252936080909648901753967063960042151767", - "borrowRatePerBlock": "58243460642", - "supplyRatePerBlock": "47462718580", - "exchangeRateMantissa": "14733815782885745170356888932", - "underlyingPriceMantissa": "2569153851730000000000", - "totalBorrowsMantissa": "8254461067763439120", - "totalSupplyMantissa": "549994107", - "cashMantissa": "0", - "totalReservesMantissa": "150949213552687822", - "reserveFactorMantissa": "200000000000000000", - "collateralFactorMantissa": "500000000000000000", - "borrowApy": "84.055346639454554175", - "supplyApy": "64.414651921332198395", - "borrowXvsApy": "558.550780652684606388", - "supplyXvsApy": "582.020616575499545188", - "borrowXvsApr": "1.8949516685", - "supplyXvsApr": "1.9302501255", - "liquidityCents": "0", - "tokenPriceCents": "256915.385173", - "totalDistributedMantissa": "0", - "lastCalculatedXvsAccruedBlockNumber": "38638517", - "supplyCapsMantissa": "300000000000000000000", - "borrowCapsMantissa": "4000000000000000000000", - "borrowerCount": 0, - "supplierCount": 0, - "estimatedPrimeBorrowApyBoost": null, - "estimatedPrimeSupplyApyBoost": null, - "pausedActionsBitmap": 0, - "isListed": true, - "poolComptrollerAddress": "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D", - "rewardsDistributors": [ - { - "marketAddress": "0x35566ED3AF9E537Be487C98b1811cDf95ad0C32b", - "rewardTokenAddress": "0xB9e0E753630434d7863528cc73CB7AC638a7c8ff", - "chainId": "97", - "lastRewardingSupplyBlockOrTimestamp": "0", - "lastRewardingBorrowBlockOrTimestamp": "0", - "supplySpeed": "596440972222220", - "borrowSpeed": "596440972222220", - "priceMantissa": "6409500000000000000", - "rewardsDistributorContractAddress": null, - "createdAt": "2024-06-18T14:48:54.000Z", - "updatedAt": "2024-09-03T14:58:33.000Z" - } - ] - }, - { - "address": "0x488aB2826a154da01CC4CC16A8C83d4720D3cA2C", - "chainId": "97", - "symbol": "vXRP", - "name": "Venus XRP", - "underlyingAddress": "0x3022A32fdAdB4f02281E8Fab33e0A6811237aab0", - "underlyingName": "XRP Token", - "underlyingSymbol": "XRP", - "underlyingDecimal": 18, - "borrowerDailyXvsMantissa": "250000012800000000000", - "supplierDailyXvsMantissa": "250000012800000000000", - "xvsBorrowIndex": "622462880290916457206416721332153725549", - "xvsSupplyIndex": "253238101787594131150524504427280384406491334", - "borrowRatePerBlock": "11630231610", - "supplyRatePerBlock": "10703452788", - "exchangeRateMantissa": "262377228244564270155318552", - "underlyingPriceMantissa": "558999990000000000", - "totalBorrowsMantissa": "25660392114161284185987093", - "totalSupplyMantissa": "95641003416966799", - "cashMantissa": "0", - "totalReservesMantissa": "566370731088635098741108", - "reserveFactorMantissa": "100000000000000000", - "collateralFactorMantissa": "600000000000000000", - "borrowApy": "12.964297292540792608", - "supplyApy": "11.872444229926720427", - "borrowXvsApy": "4.149782364239513093", - "supplyXvsApy": "4.245398150637804954", - "borrowXvsApr": "0.0407738723", - "supplyXvsApr": "0.0416941365", - "liquidityCents": "0", - "tokenPriceCents": "55.899999", - "totalDistributedMantissa": "31967022465174246959103", - "lastCalculatedXvsAccruedBlockNumber": "40813640", - "supplyCapsMantissa": "115792089237316195423570985008687907853269984665640564039457584007913129639935", - "borrowCapsMantissa": "0", - "borrowerCount": 35, - "supplierCount": 53, - "estimatedPrimeBorrowApyBoost": null, - "estimatedPrimeSupplyApyBoost": null, - "pausedActionsBitmap": 0, - "isListed": true, - "poolComptrollerAddress": "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D", - "rewardsDistributors": [ - { - "marketAddress": "0x488aB2826a154da01CC4CC16A8C83d4720D3cA2C", - "rewardTokenAddress": "0xB9e0E753630434d7863528cc73CB7AC638a7c8ff", - "chainId": "97", - "lastRewardingSupplyBlockOrTimestamp": "0", - "lastRewardingBorrowBlockOrTimestamp": "0", - "supplySpeed": "8680556000000000", - "borrowSpeed": "8680556000000000", - "priceMantissa": "6409500000000000000", - "rewardsDistributorContractAddress": null, - "createdAt": "2024-06-18T14:48:54.000Z", - "updatedAt": "2024-09-03T14:58:33.000Z" - } - ] - } - ] -} diff --git a/apps/evm/src/__mocks__/models/chains.ts b/apps/evm/src/__mocks__/models/chains.ts new file mode 100644 index 0000000000..076853aad6 --- /dev/null +++ b/apps/evm/src/__mocks__/models/chains.ts @@ -0,0 +1,5 @@ +export enum ChainId { + BSC_MAINNET = 56, + BSC_TESTNET = 97, + ETHEREUM = 1, +} diff --git a/apps/evm/src/clients/api/queries/getPoolLiquidationIncentive/useGetPoolLiquidationIncentive.ts b/apps/evm/src/clients/api/queries/getPoolLiquidationIncentive/useGetPoolLiquidationIncentive.ts index 302d30b172..2f06e62c35 100644 --- a/apps/evm/src/clients/api/queries/getPoolLiquidationIncentive/useGetPoolLiquidationIncentive.ts +++ b/apps/evm/src/clients/api/queries/getPoolLiquidationIncentive/useGetPoolLiquidationIncentive.ts @@ -6,14 +6,13 @@ import { getPoolLiquidationIncentive, } from 'clients/api/queries/getPoolLiquidationIncentive'; import FunctionKey from 'constants/functionKey'; -import { useGetChainMetadata } from 'hooks/useGetChainMetadata'; import { useGetIsolatedPoolComptrollerContract, useGetLegacyPoolComptrollerContract, } from 'libs/contracts'; import { useChainId } from 'libs/wallet'; -import { ChainId } from 'types'; -import { areAddressesEqual, callOrThrow } from 'utilities'; +import type { ChainId } from 'types'; +import { callOrThrow, isPoolIsolated } from 'utilities'; interface TrimmedGetPoolLiquidationIncentiveInput extends Omit { @@ -40,7 +39,6 @@ export const useGetPoolLiquidationIncentive = ( options?: Partial, ) => { const { chainId } = useChainId(); - const { corePoolComptrollerContractAddress } = useGetChainMetadata(); const legacyPoolComptrollerContract = useGetLegacyPoolComptrollerContract(); const isolatedPoolComptrollerContract = useGetIsolatedPoolComptrollerContract({ @@ -48,11 +46,14 @@ export const useGetPoolLiquidationIncentive = ( passSigner: false, }); - const poolComptrollerContract = - areAddressesEqual(corePoolComptrollerContractAddress, poolComptrollerContractAddress) && - (chainId === ChainId.BSC_MAINNET || chainId === ChainId.BSC_TESTNET) - ? legacyPoolComptrollerContract - : isolatedPoolComptrollerContract; + const isIsolated = isPoolIsolated({ + chainId, + comptrollerAddress: poolComptrollerContractAddress, + }); + + const poolComptrollerContract = isIsolated + ? isolatedPoolComptrollerContract + : legacyPoolComptrollerContract; return useQuery({ queryKey: [ diff --git a/apps/evm/src/clients/api/queries/useGetPools/__testUtils__/fakeData.ts b/apps/evm/src/clients/api/queries/useGetPools/__testUtils__/fakeData.ts index fc89e6b22b..b4b96ee00b 100644 --- a/apps/evm/src/clients/api/queries/useGetPools/__testUtils__/fakeData.ts +++ b/apps/evm/src/clients/api/queries/useGetPools/__testUtils__/fakeData.ts @@ -10,17 +10,75 @@ import type { VenusLens, } from 'libs/contracts'; -export const fakeGetPriceOutput = BN.from('0x30f7dc8a6370b000'); +const userLegacyCollateralizedVTokenAddresses = [ + '0x08e0A5575De71037aE36AbfAfb516595fE68e5e4', + '0x162D005F0Fff510E54958Cfc5CF32A3180A84aab', + '0x171B468b52d7027F12cEF90cd065d6776a25E24e', + '0x2E7222e51c0f6e98610A1543Aa3836E092CDe62c', + '0x35566ED3AF9E537Be487C98b1811cDf95ad0C32b', + '0x3619bdDc61189F33365CC572DF3a68FB3b316516', + '0x3A00d9B02781f47d033BAd62edc55fBF8D083Fb0', + '0x6AF3Fdb3282c5bb6926269Db10837fa8Aec67C04', + '0x6d6F697e34145Bb95c54E77482d97cc261Dc237E', + '0x74469281310195A04840Daf6EdF576F559a3dE80', + '0xb6e9322C49FD75a367Fcb17B0Fcd62C5070EbCBe', + '0xb7526572FFE56AB9D7489838Bf2E18e3323b441A', + '0xD5C4C2e2facBEB59D0216D0595d63FcDc6F9A1a7', + '0xF06e662a00796c122AaAE935EC4F0Be3F74f5636', + '0x4C94e67d239aD585275Fdd3246Ab82c8a2668564', + '0x5e68913fbbfb91af30366ab1B21324410b49a308', + '0x80CC30811e362aC9aB857C3d7875CbcCc0b65750', + '0xa109DE0abaeefC521Ec29D89eA42E64F37A6882E', + '0xe237aA131E7B004aC88CB808Fa56AF3dc4C408f1', + '0xe507B30C41E9e375BCe05197c1e09fc9ee40c0f6', + '0x0bFE4e0B8A2a096A27e5B18b078d25be57C08634', + '0x1958035231E125830bA5d17D168cEa07Bb42184a', +]; + +const userIsolatedCollateralizedVTokenAddresses = [ + '0x4c94e67d239ad585275fdd3246ab82c8a2668564', + '0x5e68913fbbfb91af30366ab1b21324410b49a308', + '0x80cc30811e362ac9ab857c3d7875cbccc0b65750', + '0xa109de0abaeefc521ec29d89ea42e64f37a6882e', + '0xb677e080148368eeee70fa3865d07e92c6500174', + '0xb7cac5ef82cb7f9197ee184779bdc52c5490c02a', + '0x1958035231e125830ba5d17d168cea07bb42184a', + '0xdedf3b2bcf25d0023115fd71a0f8221c91c92b1a', + '0x231ded0dfc99634e52ee1a1329586bc970d773b3', + '0x57a664dd7f1de19545fee9c86c949e3bf43d6d47', + '0x644a149853e5507adf3e682218b8ac86cdd62951', + '0x75aa42c832a8911b77219dbebabbb40040d16987', + '0xd5b20708d8f0fca52cb609938d0594c4e32e5dad', + '0xeffe7874c345ae877c1d893cd5160ddd359b24da', + '0x3af2be7abef0f840b196d99d79f4b803a5db14a1', + '0x170d3b2da05cc2124334240fb34ad1359e34c562', + '0x3338988d0beb4419acb8fe624218754053362d06', + '0x899ddf81dfbbf5889a16d075c352f2b959dd24a4', + '0x410286c43a525e1dcc7468a9b091c111c8324cd1', + '0xd804f74fe21290d213c46610ab171f7c2eeebde7', + '0xee543d5de2dbb5b07675fc72831a2f1812428393', +]; + +const userCollateralizedVTokenAddresses = [ + ...userLegacyCollateralizedVTokenAddresses, + ...userIsolatedCollateralizedVTokenAddresses, +]; const vTokenBalancesAllMock = async (vTokenAddresses: string[]) => - vTokenAddresses.map(vTokenAddress => ({ - vToken: vTokenAddress, - balanceOf: BN.from('4000000000000000000'), - balanceOfUnderlying: BN.from('2000000000000000000'), - borrowBalanceCurrent: BN.from('100000000000000000'), - tokenBalance: BN.from('40000000000000000000'), - tokenAllowance: BN.from('50000000000000000000'), - })); + vTokenAddresses.map(vTokenAddress => { + const isUserCollateral = userCollateralizedVTokenAddresses.some( + a => a.toLowerCase() === vTokenAddress.toLowerCase(), + ); + + return { + vToken: vTokenAddress, + balanceOf: BN.from(isUserCollateral ? '4000000000000000000' : 0), + balanceOfUnderlying: BN.from('2000000000000000000'), + borrowBalanceCurrent: BN.from(isUserCollateral ? '100000000000000000' : 0), + tokenBalance: BN.from('40000000000000000000'), + tokenAllowance: BN.from('50000000000000000000'), + }; + }); export const fakeVenusLensContract = { callStatic: { @@ -42,18 +100,11 @@ export const fakeVaiControllerContract = { } as unknown as VaiController; export const fakeIsolatedPoolComptrollerContract = { - getAssetsIn: async () => [ - '0x501a91b995Bd41177503A1A4144F3D25BFF869e1', - '0x2517A3bEe42EA8f628926849B04870260164b555', - ], + getAssetsIn: async () => userIsolatedCollateralizedVTokenAddresses, } as unknown as IsolatedPoolComptroller; export const fakeLegacyPoolComptrollerContract = { - getAssetsIn: async () => [ - '0x08e0A5575De71037aE36AbfAfb516595fE68e5e4', - '0x162D005F0Fff510E54958Cfc5CF32A3180A84aab', - '0x171B468b52d7027F12cEF90cd065d6776a25E24e', - ], + getAssetsIn: async () => userLegacyCollateralizedVTokenAddresses, } as unknown as LegacyPoolComptroller; export const fakePrimeContract = { diff --git a/apps/evm/src/clients/api/queries/useGetPools/__tests__/__snapshots__/index.prime.spec.ts.snap b/apps/evm/src/clients/api/queries/useGetPools/__tests__/__snapshots__/index.prime.spec.ts.snap index dfb0365c9d..1fa10961a9 100644 --- a/apps/evm/src/clients/api/queries/useGetPools/__tests__/__snapshots__/index.prime.spec.ts.snap +++ b/apps/evm/src/clients/api/queries/useGetPools/__tests__/__snapshots__/index.prime.spec.ts.snap @@ -46,7 +46,7 @@ exports[`useGetPools > does not fetch Prime distributions if user is not Prime 1 "borrow", ], "exchangeRateVTokens": "49.19405324154271215086", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "1.000006200805040439464388948970138750743214608e+23", "reserveFactor": 1, "reserveTokens": "0", @@ -126,7 +126,7 @@ exports[`useGetPools > does not fetch Prime distributions if user is not Prime 1 "collateralFactor": 0.8, "disabledTokenActions": [], "exchangeRateVTokens": "37.63966306652044917955", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "0", "reserveFactor": 0.1, "reserveTokens": "21.269535066688975633", @@ -192,7 +192,7 @@ exports[`useGetPools > does not fetch Prime distributions if user is not Prime 1 "collateralFactor": 0.8, "disabledTokenActions": [], "exchangeRateVTokens": "5.63429988023545433776", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "291731.6894670817923653489952", "reserveFactor": 0.25, "reserveTokens": "187487.447405339178551222", @@ -258,7 +258,7 @@ exports[`useGetPools > does not fetch Prime distributions if user is not Prime 1 "collateralFactor": 0.6, "disabledTokenActions": [], "exchangeRateVTokens": "47.36910235297224095005", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "1444669788.91666196711723462774301", "reserveFactor": 0.25, "reserveTokens": "0", @@ -338,7 +338,7 @@ exports[`useGetPools > does not fetch Prime distributions if user is not Prime 1 "collateralFactor": 0.8, "disabledTokenActions": [], "exchangeRateVTokens": "49.8066352191466231613", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "1.000036490649026183145198711400933542774047455327e+36", "reserveFactor": 0.1, "reserveTokens": "0", @@ -378,7 +378,7 @@ exports[`useGetPools > does not fetch Prime distributions if user is not Prime 1 "tokenPriceCents": "99.996283", "userBorrowBalanceCents": "9999628300000", "userBorrowBalanceTokens": "100000000000", - "userPercentOfLimit": 0, + "userPercentOfLimit": 3.1, "userSupplyBalanceCents": "199992566000000", "userSupplyBalanceTokens": "2000000000000", "userWalletBalanceCents": "999962830000000", @@ -433,7 +433,7 @@ exports[`useGetPools > does not fetch Prime distributions if user is not Prime 1 "collateralFactor": 0.81, "disabledTokenActions": [], "exchangeRateVTokens": "47.12928141003911013496", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "1.01015151019877129824366283301553792e+23", "reserveFactor": 0.1, "reserveTokens": "0", @@ -473,7 +473,7 @@ exports[`useGetPools > does not fetch Prime distributions if user is not Prime 1 "tokenPriceCents": "99.997496", "userBorrowBalanceCents": "9999749600000", "userBorrowBalanceTokens": "100000000000", - "userPercentOfLimit": 0, + "userPercentOfLimit": 3.1, "userSupplyBalanceCents": "199994992000000", "userSupplyBalanceTokens": "2000000000000", "userWalletBalanceCents": "999974960000000", @@ -494,8 +494,8 @@ exports[`useGetPools > does not fetch Prime distributions if user is not Prime 1 "comptrollerAddress": "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D", "isIsolated": false, "name": "Core Pool", - "userBorrowBalanceCents": "19999377929913.362645", - "userBorrowLimitCents": "0", + "userBorrowBalanceCents": "19999377930013.362645", + "userBorrowLimitCents": "321989996798198.068756", "userSupplyBalanceCents": "399987558598267.2529", }, { @@ -523,7 +523,7 @@ exports[`useGetPools > does not fetch Prime distributions if user is not Prime 1 "collateralFactor": 0.8, "disabledTokenActions": [], "exchangeRateVTokens": "0.99999847176819609601", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "264919325.753333245081", "reserveFactor": 0.1, "reserveTokens": "0", @@ -548,7 +548,7 @@ exports[`useGetPools > does not fetch Prime distributions if user is not Prime 1 "tokenPriceCents": "99.996283", "userBorrowBalanceCents": "9999628300000", "userBorrowBalanceTokens": "100000000000", - "userPercentOfLimit": 0, + "userPercentOfLimit": 6.25, "userSupplyBalanceCents": "199992566000000", "userSupplyBalanceTokens": "2000000000000", "userWalletBalanceCents": "999962830000000", @@ -569,8 +569,8 @@ exports[`useGetPools > does not fetch Prime distributions if user is not Prime 1 "comptrollerAddress": "0x23a73971A6B9f6580c048B9CB188869B2A2aA2aD", "isIsolated": true, "name": "DeFi", - "userBorrowBalanceCents": "9999628300100", - "userBorrowLimitCents": "0", + "userBorrowBalanceCents": "9999628300000", + "userBorrowLimitCents": "159994052800000", "userSupplyBalanceCents": "199992566000000", }, { @@ -586,7 +586,7 @@ exports[`useGetPools > does not fetch Prime distributions if user is not Prime 1 "collateralFactor": 0.8, "disabledTokenActions": [], "exchangeRateVTokens": "0.997398625122774492", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "10116226.341989680363", "reserveFactor": 0.1, "reserveTokens": "0.000131", @@ -599,7 +599,7 @@ exports[`useGetPools > does not fetch Prime distributions if user is not Prime 1 "tokenPriceCents": "99.996283", "userBorrowBalanceCents": "9999628300000", "userBorrowBalanceTokens": "100000000000", - "userPercentOfLimit": 0, + "userPercentOfLimit": 6.25, "userSupplyBalanceCents": "199992566000000", "userSupplyBalanceTokens": "2000000000000", "userWalletBalanceCents": "999962830000000", @@ -620,8 +620,8 @@ exports[`useGetPools > does not fetch Prime distributions if user is not Prime 1 "comptrollerAddress": "0x1F4f0989C51f12DAcacD4025018176711f3Bf289", "isIsolated": true, "name": "GameFi", - "userBorrowBalanceCents": "9999628300100", - "userBorrowLimitCents": "0", + "userBorrowBalanceCents": "9999628300000", + "userBorrowLimitCents": "159994052800000", "userSupplyBalanceCents": "199992566000000", }, { @@ -702,8 +702,8 @@ exports[`useGetPools > does not fetch Prime distributions if user is not Prime 1 }, ], "tokenPriceCents": "99.996283", - "userBorrowBalanceCents": "9999628300000", - "userBorrowBalanceTokens": "100000000000", + "userBorrowBalanceCents": "0", + "userBorrowBalanceTokens": "0", "userPercentOfLimit": 0, "userSupplyBalanceCents": "199992566000000", "userSupplyBalanceTokens": "2000000000000", @@ -744,7 +744,7 @@ exports[`useGetPools > does not fetch Prime distributions if user is not Prime 1 "collateralFactor": 0.45, "disabledTokenActions": [], "exchangeRateVTokens": "0.856077892298015039", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "37.0319859601477808269104", "reserveFactor": 0.25, "reserveTokens": "0", @@ -769,7 +769,7 @@ exports[`useGetPools > does not fetch Prime distributions if user is not Prime 1 "tokenPriceCents": "52505.2944", "userBorrowBalanceCents": "5250.52944", "userBorrowBalanceTokens": "0.1", - "userPercentOfLimit": 0, + "userPercentOfLimit": 11.11, "userSupplyBalanceCents": "105010.5888", "userSupplyBalanceTokens": "2", "userWalletBalanceCents": "525052.944", @@ -790,8 +790,8 @@ exports[`useGetPools > does not fetch Prime distributions if user is not Prime 1 "comptrollerAddress": "0x596B11acAACF03217287939f88d63b51d3771704", "isIsolated": true, "name": "Liquid Staked BNB", - "userBorrowBalanceCents": "9999628305350.52944", - "userBorrowLimitCents": "0", + "userBorrowBalanceCents": "5250.52944", + "userBorrowLimitCents": "47254.76496", "userSupplyBalanceCents": "199992566105010.5888", }, { @@ -807,7 +807,7 @@ exports[`useGetPools > does not fetch Prime distributions if user is not Prime 1 "collateralFactor": 0.75, "disabledTokenActions": [], "exchangeRateVTokens": "1", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "600577.675698", "reserveFactor": 0.1, "reserveTokens": "0", @@ -820,7 +820,7 @@ exports[`useGetPools > does not fetch Prime distributions if user is not Prime 1 "tokenPriceCents": "99.996283", "userBorrowBalanceCents": "9999628300000", "userBorrowBalanceTokens": "100000000000", - "userPercentOfLimit": 0, + "userPercentOfLimit": 6.66, "userSupplyBalanceCents": "199992566000000", "userSupplyBalanceTokens": "2000000000000", "userWalletBalanceCents": "999962830000000", @@ -841,8 +841,8 @@ exports[`useGetPools > does not fetch Prime distributions if user is not Prime 1 "comptrollerAddress": "0x92e8E3C202093A495e98C10f9fcaa5Abe288F74A", "isIsolated": true, "name": "Meme", - "userBorrowBalanceCents": "9999628300100", - "userBorrowLimitCents": "0", + "userBorrowBalanceCents": "9999628300000", + "userBorrowLimitCents": "149994424500000", "userSupplyBalanceCents": "199992566000000", }, { @@ -858,7 +858,7 @@ exports[`useGetPools > does not fetch Prime distributions if user is not Prime 1 "collateralFactor": 0.65, "disabledTokenActions": [], "exchangeRateVTokens": "0.9930076443898276885", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "3256964.0339677929523638", "reserveFactor": 0.2, "reserveTokens": "0.000166728600388574", @@ -926,7 +926,7 @@ exports[`useGetPools > does not fetch Prime distributions if user is not Prime 1 "collateralFactor": 0.8, "disabledTokenActions": [], "exchangeRateVTokens": "0.99998934225265418908", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "99813743.30325273594", "reserveFactor": 0.1, "reserveTokens": "0.000002", @@ -966,7 +966,7 @@ exports[`useGetPools > does not fetch Prime distributions if user is not Prime 1 "tokenPriceCents": "99.996283", "userBorrowBalanceCents": "9999628300000", "userBorrowBalanceTokens": "100000000000", - "userPercentOfLimit": 0, + "userPercentOfLimit": 6.24, "userSupplyBalanceCents": "199992566000000", "userSupplyBalanceTokens": "2000000000000", "userWalletBalanceCents": "999962830000000", @@ -987,8 +987,8 @@ exports[`useGetPools > does not fetch Prime distributions if user is not Prime 1 "comptrollerAddress": "0x10b57706AD2345e590c2eA4DC02faef0d9f5b08B", "isIsolated": true, "name": "Stablecoins", - "userBorrowBalanceCents": "9999628300110", - "userBorrowLimitCents": "0", + "userBorrowBalanceCents": "9999628300010", + "userBorrowLimitCents": "159994052800130", "userSupplyBalanceCents": "199992566000200", }, { @@ -1047,8 +1047,8 @@ exports[`useGetPools > does not fetch Prime distributions if user is not Prime 1 }, ], "tokenPriceCents": "99.996283", - "userBorrowBalanceCents": "9999628300000", - "userBorrowBalanceTokens": "100000000000", + "userBorrowBalanceCents": "0", + "userBorrowBalanceTokens": "0", "userPercentOfLimit": 0, "userSupplyBalanceCents": "199992566000000", "userSupplyBalanceTokens": "2000000000000", @@ -1070,7 +1070,7 @@ exports[`useGetPools > does not fetch Prime distributions if user is not Prime 1 "comptrollerAddress": "0x11537D023f489E4EF0C7157cc729C7B69CbE0c97", "isIsolated": true, "name": "Tron", - "userBorrowBalanceCents": "9999628300100", + "userBorrowBalanceCents": "0", "userBorrowLimitCents": "0", "userSupplyBalanceCents": "199992566000000", }, @@ -1143,7 +1143,7 @@ exports[`useGetPools > fetches and formats Prime distributions and Prime distrib "borrow", ], "exchangeRateVTokens": "49.19405324154271215086", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "1.000006200805040439464388948970138750743214608e+23", "reserveFactor": 1, "reserveTokens": "0", @@ -1233,7 +1233,7 @@ exports[`useGetPools > fetches and formats Prime distributions and Prime distrib "collateralFactor": 0.8, "disabledTokenActions": [], "exchangeRateVTokens": "37.63966306652044917955", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "0", "reserveFactor": 0.1, "reserveTokens": "21.269535066688975633", @@ -1299,7 +1299,7 @@ exports[`useGetPools > fetches and formats Prime distributions and Prime distrib "collateralFactor": 0.8, "disabledTokenActions": [], "exchangeRateVTokens": "5.63429988023545433776", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "291731.6894670817923653489952", "reserveFactor": 0.25, "reserveTokens": "187487.447405339178551222", @@ -1365,7 +1365,7 @@ exports[`useGetPools > fetches and formats Prime distributions and Prime distrib "collateralFactor": 0.6, "disabledTokenActions": [], "exchangeRateVTokens": "47.36910235297224095005", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "1444669788.91666196711723462774301", "reserveFactor": 0.25, "reserveTokens": "0", @@ -1455,7 +1455,7 @@ exports[`useGetPools > fetches and formats Prime distributions and Prime distrib "collateralFactor": 0.8, "disabledTokenActions": [], "exchangeRateVTokens": "49.8066352191466231613", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "1.000036490649026183145198711400933542774047455327e+36", "reserveFactor": 0.1, "reserveTokens": "0", @@ -1505,7 +1505,7 @@ exports[`useGetPools > fetches and formats Prime distributions and Prime distrib "tokenPriceCents": "99.996283", "userBorrowBalanceCents": "9999628300000", "userBorrowBalanceTokens": "100000000000", - "userPercentOfLimit": 0, + "userPercentOfLimit": 3.1, "userSupplyBalanceCents": "199992566000000", "userSupplyBalanceTokens": "2000000000000", "userWalletBalanceCents": "999962830000000", @@ -1570,7 +1570,7 @@ exports[`useGetPools > fetches and formats Prime distributions and Prime distrib "collateralFactor": 0.81, "disabledTokenActions": [], "exchangeRateVTokens": "47.12928141003911013496", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "1.01015151019877129824366283301553792e+23", "reserveFactor": 0.1, "reserveTokens": "0", @@ -1620,7 +1620,7 @@ exports[`useGetPools > fetches and formats Prime distributions and Prime distrib "tokenPriceCents": "99.997496", "userBorrowBalanceCents": "9999749600000", "userBorrowBalanceTokens": "100000000000", - "userPercentOfLimit": 0, + "userPercentOfLimit": 3.1, "userSupplyBalanceCents": "199994992000000", "userSupplyBalanceTokens": "2000000000000", "userWalletBalanceCents": "999974960000000", @@ -1641,8 +1641,8 @@ exports[`useGetPools > fetches and formats Prime distributions and Prime distrib "comptrollerAddress": "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D", "isIsolated": false, "name": "Core Pool", - "userBorrowBalanceCents": "19999377929913.362645", - "userBorrowLimitCents": "0", + "userBorrowBalanceCents": "19999377930013.362645", + "userBorrowLimitCents": "321989996798198.068756", "userSupplyBalanceCents": "399987558598267.2529", }, { @@ -1670,7 +1670,7 @@ exports[`useGetPools > fetches and formats Prime distributions and Prime distrib "collateralFactor": 0.8, "disabledTokenActions": [], "exchangeRateVTokens": "0.99999847176819609601", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "264919325.753333245081", "reserveFactor": 0.1, "reserveTokens": "0", @@ -1695,7 +1695,7 @@ exports[`useGetPools > fetches and formats Prime distributions and Prime distrib "tokenPriceCents": "99.996283", "userBorrowBalanceCents": "9999628300000", "userBorrowBalanceTokens": "100000000000", - "userPercentOfLimit": 0, + "userPercentOfLimit": 6.25, "userSupplyBalanceCents": "199992566000000", "userSupplyBalanceTokens": "2000000000000", "userWalletBalanceCents": "999962830000000", @@ -1716,8 +1716,8 @@ exports[`useGetPools > fetches and formats Prime distributions and Prime distrib "comptrollerAddress": "0x23a73971A6B9f6580c048B9CB188869B2A2aA2aD", "isIsolated": true, "name": "DeFi", - "userBorrowBalanceCents": "9999628300100", - "userBorrowLimitCents": "0", + "userBorrowBalanceCents": "9999628300000", + "userBorrowLimitCents": "159994052800000", "userSupplyBalanceCents": "199992566000000", }, { @@ -1733,7 +1733,7 @@ exports[`useGetPools > fetches and formats Prime distributions and Prime distrib "collateralFactor": 0.8, "disabledTokenActions": [], "exchangeRateVTokens": "0.997398625122774492", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "10116226.341989680363", "reserveFactor": 0.1, "reserveTokens": "0.000131", @@ -1746,7 +1746,7 @@ exports[`useGetPools > fetches and formats Prime distributions and Prime distrib "tokenPriceCents": "99.996283", "userBorrowBalanceCents": "9999628300000", "userBorrowBalanceTokens": "100000000000", - "userPercentOfLimit": 0, + "userPercentOfLimit": 6.25, "userSupplyBalanceCents": "199992566000000", "userSupplyBalanceTokens": "2000000000000", "userWalletBalanceCents": "999962830000000", @@ -1767,8 +1767,8 @@ exports[`useGetPools > fetches and formats Prime distributions and Prime distrib "comptrollerAddress": "0x1F4f0989C51f12DAcacD4025018176711f3Bf289", "isIsolated": true, "name": "GameFi", - "userBorrowBalanceCents": "9999628300100", - "userBorrowLimitCents": "0", + "userBorrowBalanceCents": "9999628300000", + "userBorrowLimitCents": "159994052800000", "userSupplyBalanceCents": "199992566000000", }, { @@ -1869,8 +1869,8 @@ exports[`useGetPools > fetches and formats Prime distributions and Prime distrib }, ], "tokenPriceCents": "99.996283", - "userBorrowBalanceCents": "9999628300000", - "userBorrowBalanceTokens": "100000000000", + "userBorrowBalanceCents": "0", + "userBorrowBalanceTokens": "0", "userPercentOfLimit": 0, "userSupplyBalanceCents": "199992566000000", "userSupplyBalanceTokens": "2000000000000", @@ -1911,7 +1911,7 @@ exports[`useGetPools > fetches and formats Prime distributions and Prime distrib "collateralFactor": 0.45, "disabledTokenActions": [], "exchangeRateVTokens": "0.856077892298015039", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "37.0319859601477808269104", "reserveFactor": 0.25, "reserveTokens": "0", @@ -1936,7 +1936,7 @@ exports[`useGetPools > fetches and formats Prime distributions and Prime distrib "tokenPriceCents": "52505.2944", "userBorrowBalanceCents": "5250.52944", "userBorrowBalanceTokens": "0.1", - "userPercentOfLimit": 0, + "userPercentOfLimit": 11.11, "userSupplyBalanceCents": "105010.5888", "userSupplyBalanceTokens": "2", "userWalletBalanceCents": "525052.944", @@ -1957,8 +1957,8 @@ exports[`useGetPools > fetches and formats Prime distributions and Prime distrib "comptrollerAddress": "0x596B11acAACF03217287939f88d63b51d3771704", "isIsolated": true, "name": "Liquid Staked BNB", - "userBorrowBalanceCents": "9999628305350.52944", - "userBorrowLimitCents": "0", + "userBorrowBalanceCents": "5250.52944", + "userBorrowLimitCents": "47254.76496", "userSupplyBalanceCents": "199992566105010.5888", }, { @@ -1974,7 +1974,7 @@ exports[`useGetPools > fetches and formats Prime distributions and Prime distrib "collateralFactor": 0.75, "disabledTokenActions": [], "exchangeRateVTokens": "1", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "600577.675698", "reserveFactor": 0.1, "reserveTokens": "0", @@ -1987,7 +1987,7 @@ exports[`useGetPools > fetches and formats Prime distributions and Prime distrib "tokenPriceCents": "99.996283", "userBorrowBalanceCents": "9999628300000", "userBorrowBalanceTokens": "100000000000", - "userPercentOfLimit": 0, + "userPercentOfLimit": 6.66, "userSupplyBalanceCents": "199992566000000", "userSupplyBalanceTokens": "2000000000000", "userWalletBalanceCents": "999962830000000", @@ -2008,8 +2008,8 @@ exports[`useGetPools > fetches and formats Prime distributions and Prime distrib "comptrollerAddress": "0x92e8E3C202093A495e98C10f9fcaa5Abe288F74A", "isIsolated": true, "name": "Meme", - "userBorrowBalanceCents": "9999628300100", - "userBorrowLimitCents": "0", + "userBorrowBalanceCents": "9999628300000", + "userBorrowLimitCents": "149994424500000", "userSupplyBalanceCents": "199992566000000", }, { @@ -2025,7 +2025,7 @@ exports[`useGetPools > fetches and formats Prime distributions and Prime distrib "collateralFactor": 0.65, "disabledTokenActions": [], "exchangeRateVTokens": "0.9930076443898276885", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "3256964.0339677929523638", "reserveFactor": 0.2, "reserveTokens": "0.000166728600388574", @@ -2103,7 +2103,7 @@ exports[`useGetPools > fetches and formats Prime distributions and Prime distrib "collateralFactor": 0.8, "disabledTokenActions": [], "exchangeRateVTokens": "0.99998934225265418908", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "99813743.30325273594", "reserveFactor": 0.1, "reserveTokens": "0.000002", @@ -2153,7 +2153,7 @@ exports[`useGetPools > fetches and formats Prime distributions and Prime distrib "tokenPriceCents": "99.996283", "userBorrowBalanceCents": "9999628300000", "userBorrowBalanceTokens": "100000000000", - "userPercentOfLimit": 0, + "userPercentOfLimit": 6.24, "userSupplyBalanceCents": "199992566000000", "userSupplyBalanceTokens": "2000000000000", "userWalletBalanceCents": "999962830000000", @@ -2174,8 +2174,8 @@ exports[`useGetPools > fetches and formats Prime distributions and Prime distrib "comptrollerAddress": "0x10b57706AD2345e590c2eA4DC02faef0d9f5b08B", "isIsolated": true, "name": "Stablecoins", - "userBorrowBalanceCents": "9999628300110", - "userBorrowLimitCents": "0", + "userBorrowBalanceCents": "9999628300010", + "userBorrowLimitCents": "159994052800130", "userSupplyBalanceCents": "199992566000200", }, { @@ -2254,8 +2254,8 @@ exports[`useGetPools > fetches and formats Prime distributions and Prime distrib }, ], "tokenPriceCents": "99.996283", - "userBorrowBalanceCents": "9999628300000", - "userBorrowBalanceTokens": "100000000000", + "userBorrowBalanceCents": "0", + "userBorrowBalanceTokens": "0", "userPercentOfLimit": 0, "userSupplyBalanceCents": "199992566000000", "userSupplyBalanceTokens": "2000000000000", @@ -2277,7 +2277,7 @@ exports[`useGetPools > fetches and formats Prime distributions and Prime distrib "comptrollerAddress": "0x11537D023f489E4EF0C7157cc729C7B69CbE0c97", "isIsolated": true, "name": "Tron", - "userBorrowBalanceCents": "9999628300100", + "userBorrowBalanceCents": "0", "userBorrowLimitCents": "0", "userSupplyBalanceCents": "199992566000000", }, @@ -2335,7 +2335,7 @@ exports[`useGetPools > filters out Prime simulations that are 0 1`] = ` "borrow", ], "exchangeRateVTokens": "49.19405324154271215086", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "1.000006200805040439464388948970138750743214608e+23", "reserveFactor": 1, "reserveTokens": "0", @@ -2410,7 +2410,7 @@ exports[`useGetPools > filters out Prime simulations that are 0 1`] = ` "collateralFactor": 0.8, "disabledTokenActions": [], "exchangeRateVTokens": "37.63966306652044917955", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "0", "reserveFactor": 0.1, "reserveTokens": "21.269535066688975633", @@ -2476,7 +2476,7 @@ exports[`useGetPools > filters out Prime simulations that are 0 1`] = ` "collateralFactor": 0.8, "disabledTokenActions": [], "exchangeRateVTokens": "5.63429988023545433776", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "291731.6894670817923653489952", "reserveFactor": 0.25, "reserveTokens": "187487.447405339178551222", @@ -2542,7 +2542,7 @@ exports[`useGetPools > filters out Prime simulations that are 0 1`] = ` "collateralFactor": 0.6, "disabledTokenActions": [], "exchangeRateVTokens": "47.36910235297224095005", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "1444669788.91666196711723462774301", "reserveFactor": 0.25, "reserveTokens": "0", @@ -2617,7 +2617,7 @@ exports[`useGetPools > filters out Prime simulations that are 0 1`] = ` "collateralFactor": 0.8, "disabledTokenActions": [], "exchangeRateVTokens": "49.8066352191466231613", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "1.000036490649026183145198711400933542774047455327e+36", "reserveFactor": 0.1, "reserveTokens": "0", @@ -2652,7 +2652,7 @@ exports[`useGetPools > filters out Prime simulations that are 0 1`] = ` "tokenPriceCents": "99.996283", "userBorrowBalanceCents": "9999628300000", "userBorrowBalanceTokens": "100000000000", - "userPercentOfLimit": 0, + "userPercentOfLimit": 3.1, "userSupplyBalanceCents": "199992566000000", "userSupplyBalanceTokens": "2000000000000", "userWalletBalanceCents": "999962830000000", @@ -2702,7 +2702,7 @@ exports[`useGetPools > filters out Prime simulations that are 0 1`] = ` "collateralFactor": 0.81, "disabledTokenActions": [], "exchangeRateVTokens": "47.12928141003911013496", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "1.01015151019877129824366283301553792e+23", "reserveFactor": 0.1, "reserveTokens": "0", @@ -2737,7 +2737,7 @@ exports[`useGetPools > filters out Prime simulations that are 0 1`] = ` "tokenPriceCents": "99.997496", "userBorrowBalanceCents": "9999749600000", "userBorrowBalanceTokens": "100000000000", - "userPercentOfLimit": 0, + "userPercentOfLimit": 3.1, "userSupplyBalanceCents": "199994992000000", "userSupplyBalanceTokens": "2000000000000", "userWalletBalanceCents": "999974960000000", @@ -2758,8 +2758,8 @@ exports[`useGetPools > filters out Prime simulations that are 0 1`] = ` "comptrollerAddress": "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D", "isIsolated": false, "name": "Core Pool", - "userBorrowBalanceCents": "19999377929913.362645", - "userBorrowLimitCents": "0", + "userBorrowBalanceCents": "19999377930013.362645", + "userBorrowLimitCents": "321989996798198.068756", "userSupplyBalanceCents": "399987558598267.2529", }, { @@ -2787,7 +2787,7 @@ exports[`useGetPools > filters out Prime simulations that are 0 1`] = ` "collateralFactor": 0.8, "disabledTokenActions": [], "exchangeRateVTokens": "0.99999847176819609601", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "264919325.753333245081", "reserveFactor": 0.1, "reserveTokens": "0", @@ -2812,7 +2812,7 @@ exports[`useGetPools > filters out Prime simulations that are 0 1`] = ` "tokenPriceCents": "99.996283", "userBorrowBalanceCents": "9999628300000", "userBorrowBalanceTokens": "100000000000", - "userPercentOfLimit": 0, + "userPercentOfLimit": 6.25, "userSupplyBalanceCents": "199992566000000", "userSupplyBalanceTokens": "2000000000000", "userWalletBalanceCents": "999962830000000", @@ -2833,8 +2833,8 @@ exports[`useGetPools > filters out Prime simulations that are 0 1`] = ` "comptrollerAddress": "0x23a73971A6B9f6580c048B9CB188869B2A2aA2aD", "isIsolated": true, "name": "DeFi", - "userBorrowBalanceCents": "9999628300100", - "userBorrowLimitCents": "0", + "userBorrowBalanceCents": "9999628300000", + "userBorrowLimitCents": "159994052800000", "userSupplyBalanceCents": "199992566000000", }, { @@ -2850,7 +2850,7 @@ exports[`useGetPools > filters out Prime simulations that are 0 1`] = ` "collateralFactor": 0.8, "disabledTokenActions": [], "exchangeRateVTokens": "0.997398625122774492", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "10116226.341989680363", "reserveFactor": 0.1, "reserveTokens": "0.000131", @@ -2863,7 +2863,7 @@ exports[`useGetPools > filters out Prime simulations that are 0 1`] = ` "tokenPriceCents": "99.996283", "userBorrowBalanceCents": "9999628300000", "userBorrowBalanceTokens": "100000000000", - "userPercentOfLimit": 0, + "userPercentOfLimit": 6.25, "userSupplyBalanceCents": "199992566000000", "userSupplyBalanceTokens": "2000000000000", "userWalletBalanceCents": "999962830000000", @@ -2884,8 +2884,8 @@ exports[`useGetPools > filters out Prime simulations that are 0 1`] = ` "comptrollerAddress": "0x1F4f0989C51f12DAcacD4025018176711f3Bf289", "isIsolated": true, "name": "GameFi", - "userBorrowBalanceCents": "9999628300100", - "userBorrowLimitCents": "0", + "userBorrowBalanceCents": "9999628300000", + "userBorrowLimitCents": "159994052800000", "userSupplyBalanceCents": "199992566000000", }, { @@ -2956,8 +2956,8 @@ exports[`useGetPools > filters out Prime simulations that are 0 1`] = ` }, ], "tokenPriceCents": "99.996283", - "userBorrowBalanceCents": "9999628300000", - "userBorrowBalanceTokens": "100000000000", + "userBorrowBalanceCents": "0", + "userBorrowBalanceTokens": "0", "userPercentOfLimit": 0, "userSupplyBalanceCents": "199992566000000", "userSupplyBalanceTokens": "2000000000000", @@ -2998,7 +2998,7 @@ exports[`useGetPools > filters out Prime simulations that are 0 1`] = ` "collateralFactor": 0.45, "disabledTokenActions": [], "exchangeRateVTokens": "0.856077892298015039", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "37.0319859601477808269104", "reserveFactor": 0.25, "reserveTokens": "0", @@ -3023,7 +3023,7 @@ exports[`useGetPools > filters out Prime simulations that are 0 1`] = ` "tokenPriceCents": "52505.2944", "userBorrowBalanceCents": "5250.52944", "userBorrowBalanceTokens": "0.1", - "userPercentOfLimit": 0, + "userPercentOfLimit": 11.11, "userSupplyBalanceCents": "105010.5888", "userSupplyBalanceTokens": "2", "userWalletBalanceCents": "525052.944", @@ -3044,8 +3044,8 @@ exports[`useGetPools > filters out Prime simulations that are 0 1`] = ` "comptrollerAddress": "0x596B11acAACF03217287939f88d63b51d3771704", "isIsolated": true, "name": "Liquid Staked BNB", - "userBorrowBalanceCents": "9999628305350.52944", - "userBorrowLimitCents": "0", + "userBorrowBalanceCents": "5250.52944", + "userBorrowLimitCents": "47254.76496", "userSupplyBalanceCents": "199992566105010.5888", }, { @@ -3061,7 +3061,7 @@ exports[`useGetPools > filters out Prime simulations that are 0 1`] = ` "collateralFactor": 0.75, "disabledTokenActions": [], "exchangeRateVTokens": "1", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "600577.675698", "reserveFactor": 0.1, "reserveTokens": "0", @@ -3074,7 +3074,7 @@ exports[`useGetPools > filters out Prime simulations that are 0 1`] = ` "tokenPriceCents": "99.996283", "userBorrowBalanceCents": "9999628300000", "userBorrowBalanceTokens": "100000000000", - "userPercentOfLimit": 0, + "userPercentOfLimit": 6.66, "userSupplyBalanceCents": "199992566000000", "userSupplyBalanceTokens": "2000000000000", "userWalletBalanceCents": "999962830000000", @@ -3095,8 +3095,8 @@ exports[`useGetPools > filters out Prime simulations that are 0 1`] = ` "comptrollerAddress": "0x92e8E3C202093A495e98C10f9fcaa5Abe288F74A", "isIsolated": true, "name": "Meme", - "userBorrowBalanceCents": "9999628300100", - "userBorrowLimitCents": "0", + "userBorrowBalanceCents": "9999628300000", + "userBorrowLimitCents": "149994424500000", "userSupplyBalanceCents": "199992566000000", }, { @@ -3112,7 +3112,7 @@ exports[`useGetPools > filters out Prime simulations that are 0 1`] = ` "collateralFactor": 0.65, "disabledTokenActions": [], "exchangeRateVTokens": "0.9930076443898276885", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "3256964.0339677929523638", "reserveFactor": 0.2, "reserveTokens": "0.000166728600388574", @@ -3175,7 +3175,7 @@ exports[`useGetPools > filters out Prime simulations that are 0 1`] = ` "collateralFactor": 0.8, "disabledTokenActions": [], "exchangeRateVTokens": "0.99998934225265418908", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "99813743.30325273594", "reserveFactor": 0.1, "reserveTokens": "0.000002", @@ -3210,7 +3210,7 @@ exports[`useGetPools > filters out Prime simulations that are 0 1`] = ` "tokenPriceCents": "99.996283", "userBorrowBalanceCents": "9999628300000", "userBorrowBalanceTokens": "100000000000", - "userPercentOfLimit": 0, + "userPercentOfLimit": 6.24, "userSupplyBalanceCents": "199992566000000", "userSupplyBalanceTokens": "2000000000000", "userWalletBalanceCents": "999962830000000", @@ -3231,8 +3231,8 @@ exports[`useGetPools > filters out Prime simulations that are 0 1`] = ` "comptrollerAddress": "0x10b57706AD2345e590c2eA4DC02faef0d9f5b08B", "isIsolated": true, "name": "Stablecoins", - "userBorrowBalanceCents": "9999628300110", - "userBorrowLimitCents": "0", + "userBorrowBalanceCents": "9999628300010", + "userBorrowLimitCents": "159994052800130", "userSupplyBalanceCents": "199992566000200", }, { @@ -3281,8 +3281,8 @@ exports[`useGetPools > filters out Prime simulations that are 0 1`] = ` }, ], "tokenPriceCents": "99.996283", - "userBorrowBalanceCents": "9999628300000", - "userBorrowBalanceTokens": "100000000000", + "userBorrowBalanceCents": "0", + "userBorrowBalanceTokens": "0", "userPercentOfLimit": 0, "userSupplyBalanceCents": "199992566000000", "userSupplyBalanceTokens": "2000000000000", @@ -3304,7 +3304,7 @@ exports[`useGetPools > filters out Prime simulations that are 0 1`] = ` "comptrollerAddress": "0x11537D023f489E4EF0C7157cc729C7B69CbE0c97", "isIsolated": true, "name": "Tron", - "userBorrowBalanceCents": "9999628300100", + "userBorrowBalanceCents": "0", "userBorrowLimitCents": "0", "userSupplyBalanceCents": "199992566000000", }, diff --git a/apps/evm/src/clients/api/queries/useGetPools/__tests__/__snapshots__/index.spec.ts.snap b/apps/evm/src/clients/api/queries/useGetPools/__tests__/__snapshots__/index.spec.ts.snap index 4b74c9354b..40f07122ff 100644 --- a/apps/evm/src/clients/api/queries/useGetPools/__tests__/__snapshots__/index.spec.ts.snap +++ b/apps/evm/src/clients/api/queries/useGetPools/__tests__/__snapshots__/index.spec.ts.snap @@ -1825,7 +1825,7 @@ exports[`useGetPools > returns pools with user data in the correct format 1`] = "borrow", ], "exchangeRateVTokens": "49.19405324154271215086", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "1.000006200805040439464388948970138750743214608e+23", "reserveFactor": 1, "reserveTokens": "0", @@ -1890,7 +1890,7 @@ exports[`useGetPools > returns pools with user data in the correct format 1`] = "collateralFactor": 0.8, "disabledTokenActions": [], "exchangeRateVTokens": "37.63966306652044917955", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "0", "reserveFactor": 0.1, "reserveTokens": "21.269535066688975633", @@ -1956,7 +1956,7 @@ exports[`useGetPools > returns pools with user data in the correct format 1`] = "collateralFactor": 0.8, "disabledTokenActions": [], "exchangeRateVTokens": "5.63429988023545433776", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "291731.6894670817923653489952", "reserveFactor": 0.25, "reserveTokens": "187487.447405339178551222", @@ -2022,7 +2022,7 @@ exports[`useGetPools > returns pools with user data in the correct format 1`] = "collateralFactor": 0.6, "disabledTokenActions": [], "exchangeRateVTokens": "47.36910235297224095005", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "1444669788.91666196711723462774301", "reserveFactor": 0.25, "reserveTokens": "0", @@ -2087,7 +2087,7 @@ exports[`useGetPools > returns pools with user data in the correct format 1`] = "collateralFactor": 0.8, "disabledTokenActions": [], "exchangeRateVTokens": "49.8066352191466231613", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "1.000036490649026183145198711400933542774047455327e+36", "reserveFactor": 0.1, "reserveTokens": "0", @@ -2112,7 +2112,7 @@ exports[`useGetPools > returns pools with user data in the correct format 1`] = "tokenPriceCents": "99.996283", "userBorrowBalanceCents": "9999628300000", "userBorrowBalanceTokens": "100000000000", - "userPercentOfLimit": 0, + "userPercentOfLimit": 3.1, "userSupplyBalanceCents": "199992566000000", "userSupplyBalanceTokens": "2000000000000", "userWalletBalanceCents": "999962830000000", @@ -2152,7 +2152,7 @@ exports[`useGetPools > returns pools with user data in the correct format 1`] = "collateralFactor": 0.81, "disabledTokenActions": [], "exchangeRateVTokens": "47.12928141003911013496", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "1.01015151019877129824366283301553792e+23", "reserveFactor": 0.1, "reserveTokens": "0", @@ -2177,7 +2177,7 @@ exports[`useGetPools > returns pools with user data in the correct format 1`] = "tokenPriceCents": "99.997496", "userBorrowBalanceCents": "9999749600000", "userBorrowBalanceTokens": "100000000000", - "userPercentOfLimit": 0, + "userPercentOfLimit": 3.1, "userSupplyBalanceCents": "199994992000000", "userSupplyBalanceTokens": "2000000000000", "userWalletBalanceCents": "999974960000000", @@ -2198,8 +2198,8 @@ exports[`useGetPools > returns pools with user data in the correct format 1`] = "comptrollerAddress": "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D", "isIsolated": false, "name": "Core Pool", - "userBorrowBalanceCents": "19999377929913.362645", - "userBorrowLimitCents": "0", + "userBorrowBalanceCents": "19999377930013.362645", + "userBorrowLimitCents": "321989996798198.068756", "userSupplyBalanceCents": "399987558598267.2529", }, { @@ -2227,7 +2227,7 @@ exports[`useGetPools > returns pools with user data in the correct format 1`] = "collateralFactor": 0.8, "disabledTokenActions": [], "exchangeRateVTokens": "0.99999847176819609601", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "264919325.753333245081", "reserveFactor": 0.1, "reserveTokens": "0", @@ -2252,7 +2252,7 @@ exports[`useGetPools > returns pools with user data in the correct format 1`] = "tokenPriceCents": "99.996283", "userBorrowBalanceCents": "9999628300000", "userBorrowBalanceTokens": "100000000000", - "userPercentOfLimit": 0, + "userPercentOfLimit": 6.25, "userSupplyBalanceCents": "199992566000000", "userSupplyBalanceTokens": "2000000000000", "userWalletBalanceCents": "999962830000000", @@ -2273,8 +2273,8 @@ exports[`useGetPools > returns pools with user data in the correct format 1`] = "comptrollerAddress": "0x23a73971A6B9f6580c048B9CB188869B2A2aA2aD", "isIsolated": true, "name": "DeFi", - "userBorrowBalanceCents": "9999628300100", - "userBorrowLimitCents": "0", + "userBorrowBalanceCents": "9999628300000", + "userBorrowLimitCents": "159994052800000", "userSupplyBalanceCents": "199992566000000", }, { @@ -2290,7 +2290,7 @@ exports[`useGetPools > returns pools with user data in the correct format 1`] = "collateralFactor": 0.8, "disabledTokenActions": [], "exchangeRateVTokens": "0.997398625122774492", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "10116226.341989680363", "reserveFactor": 0.1, "reserveTokens": "0.000131", @@ -2303,7 +2303,7 @@ exports[`useGetPools > returns pools with user data in the correct format 1`] = "tokenPriceCents": "99.996283", "userBorrowBalanceCents": "9999628300000", "userBorrowBalanceTokens": "100000000000", - "userPercentOfLimit": 0, + "userPercentOfLimit": 6.25, "userSupplyBalanceCents": "199992566000000", "userSupplyBalanceTokens": "2000000000000", "userWalletBalanceCents": "999962830000000", @@ -2324,8 +2324,8 @@ exports[`useGetPools > returns pools with user data in the correct format 1`] = "comptrollerAddress": "0x1F4f0989C51f12DAcacD4025018176711f3Bf289", "isIsolated": true, "name": "GameFi", - "userBorrowBalanceCents": "9999628300100", - "userBorrowLimitCents": "0", + "userBorrowBalanceCents": "9999628300000", + "userBorrowLimitCents": "159994052800000", "userSupplyBalanceCents": "199992566000000", }, { @@ -2376,8 +2376,8 @@ exports[`useGetPools > returns pools with user data in the correct format 1`] = }, ], "tokenPriceCents": "99.996283", - "userBorrowBalanceCents": "9999628300000", - "userBorrowBalanceTokens": "100000000000", + "userBorrowBalanceCents": "0", + "userBorrowBalanceTokens": "0", "userPercentOfLimit": 0, "userSupplyBalanceCents": "199992566000000", "userSupplyBalanceTokens": "2000000000000", @@ -2418,7 +2418,7 @@ exports[`useGetPools > returns pools with user data in the correct format 1`] = "collateralFactor": 0.45, "disabledTokenActions": [], "exchangeRateVTokens": "0.856077892298015039", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "37.0319859601477808269104", "reserveFactor": 0.25, "reserveTokens": "0", @@ -2443,7 +2443,7 @@ exports[`useGetPools > returns pools with user data in the correct format 1`] = "tokenPriceCents": "52505.2944", "userBorrowBalanceCents": "5250.52944", "userBorrowBalanceTokens": "0.1", - "userPercentOfLimit": 0, + "userPercentOfLimit": 11.11, "userSupplyBalanceCents": "105010.5888", "userSupplyBalanceTokens": "2", "userWalletBalanceCents": "525052.944", @@ -2464,8 +2464,8 @@ exports[`useGetPools > returns pools with user data in the correct format 1`] = "comptrollerAddress": "0x596B11acAACF03217287939f88d63b51d3771704", "isIsolated": true, "name": "Liquid Staked BNB", - "userBorrowBalanceCents": "9999628305350.52944", - "userBorrowLimitCents": "0", + "userBorrowBalanceCents": "5250.52944", + "userBorrowLimitCents": "47254.76496", "userSupplyBalanceCents": "199992566105010.5888", }, { @@ -2481,7 +2481,7 @@ exports[`useGetPools > returns pools with user data in the correct format 1`] = "collateralFactor": 0.75, "disabledTokenActions": [], "exchangeRateVTokens": "1", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "600577.675698", "reserveFactor": 0.1, "reserveTokens": "0", @@ -2494,7 +2494,7 @@ exports[`useGetPools > returns pools with user data in the correct format 1`] = "tokenPriceCents": "99.996283", "userBorrowBalanceCents": "9999628300000", "userBorrowBalanceTokens": "100000000000", - "userPercentOfLimit": 0, + "userPercentOfLimit": 6.66, "userSupplyBalanceCents": "199992566000000", "userSupplyBalanceTokens": "2000000000000", "userWalletBalanceCents": "999962830000000", @@ -2515,8 +2515,8 @@ exports[`useGetPools > returns pools with user data in the correct format 1`] = "comptrollerAddress": "0x92e8E3C202093A495e98C10f9fcaa5Abe288F74A", "isIsolated": true, "name": "Meme", - "userBorrowBalanceCents": "9999628300100", - "userBorrowLimitCents": "0", + "userBorrowBalanceCents": "9999628300000", + "userBorrowLimitCents": "149994424500000", "userSupplyBalanceCents": "199992566000000", }, { @@ -2532,7 +2532,7 @@ exports[`useGetPools > returns pools with user data in the correct format 1`] = "collateralFactor": 0.65, "disabledTokenActions": [], "exchangeRateVTokens": "0.9930076443898276885", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "3256964.0339677929523638", "reserveFactor": 0.2, "reserveTokens": "0.000166728600388574", @@ -2585,7 +2585,7 @@ exports[`useGetPools > returns pools with user data in the correct format 1`] = "collateralFactor": 0.8, "disabledTokenActions": [], "exchangeRateVTokens": "0.99998934225265418908", - "isCollateralOfUser": false, + "isCollateralOfUser": true, "liquidityCents": "99813743.30325273594", "reserveFactor": 0.1, "reserveTokens": "0.000002", @@ -2610,7 +2610,7 @@ exports[`useGetPools > returns pools with user data in the correct format 1`] = "tokenPriceCents": "99.996283", "userBorrowBalanceCents": "9999628300000", "userBorrowBalanceTokens": "100000000000", - "userPercentOfLimit": 0, + "userPercentOfLimit": 6.24, "userSupplyBalanceCents": "199992566000000", "userSupplyBalanceTokens": "2000000000000", "userWalletBalanceCents": "999962830000000", @@ -2631,8 +2631,8 @@ exports[`useGetPools > returns pools with user data in the correct format 1`] = "comptrollerAddress": "0x10b57706AD2345e590c2eA4DC02faef0d9f5b08B", "isIsolated": true, "name": "Stablecoins", - "userBorrowBalanceCents": "9999628300110", - "userBorrowLimitCents": "0", + "userBorrowBalanceCents": "9999628300010", + "userBorrowLimitCents": "159994052800130", "userSupplyBalanceCents": "199992566000200", }, { @@ -2659,8 +2659,8 @@ exports[`useGetPools > returns pools with user data in the correct format 1`] = "supplyCapTokens": "18600000", "supplyDistributions": [], "tokenPriceCents": "99.996283", - "userBorrowBalanceCents": "9999628300000", - "userBorrowBalanceTokens": "100000000000", + "userBorrowBalanceCents": "0", + "userBorrowBalanceTokens": "0", "userPercentOfLimit": 0, "userSupplyBalanceCents": "199992566000000", "userSupplyBalanceTokens": "2000000000000", @@ -2682,7 +2682,7 @@ exports[`useGetPools > returns pools with user data in the correct format 1`] = "comptrollerAddress": "0x11537D023f489E4EF0C7157cc729C7B69CbE0c97", "isIsolated": true, "name": "Tron", - "userBorrowBalanceCents": "9999628300100", + "userBorrowBalanceCents": "0", "userBorrowLimitCents": "0", "userSupplyBalanceCents": "199992566000000", }, diff --git a/apps/evm/src/clients/api/queries/useGetPools/getPools/formatOutput/index.ts b/apps/evm/src/clients/api/queries/useGetPools/getPools/formatOutput/index.ts index e7c0b34453..1774c91976 100644 --- a/apps/evm/src/clients/api/queries/useGetPools/getPools/formatOutput/index.ts +++ b/apps/evm/src/clients/api/queries/useGetPools/getPools/formatOutput/index.ts @@ -4,15 +4,7 @@ import BigNumber from 'bignumber.js'; import { NATIVE_TOKEN_ADDRESS } from 'constants/address'; import { COMPOUND_DECIMALS } from 'constants/compoundMantissa'; import type { PoolLens } from 'libs/contracts'; -import { - type Asset, - ChainId, - type Pool, - type PrimeApy, - type Token, - type TokenBalance, - type VToken, -} from 'types'; +import type { Asset, ChainId, Pool, PrimeApy, Token, TokenBalance, VToken } from 'types'; import { areAddressesEqual, areTokensEqual, @@ -22,8 +14,8 @@ import { convertPriceMantissaToDollars, findTokenByAddress, getDisabledTokenActions, + isPoolIsolated, } from 'utilities'; - import type { MarketParticipantsCounts } from '../../types'; import type { ApiPool } from '../getApiPools'; import { formatDistributions } from './formatDistributions'; @@ -52,12 +44,12 @@ export const formatOutput = ({ userVaiBorrowBalanceMantissa?: BigNumber; }) => { const pools: Pool[] = apiPools.map(apiPool => { - const { corePoolComptrollerContractAddress, blocksPerDay } = chainMetadata[chainId]; + const { blocksPerDay } = chainMetadata[chainId]; - const isIsolated = - chainId === ChainId.BSC_MAINNET || chainId === ChainId.BSC_TESTNET - ? !areAddressesEqual(corePoolComptrollerContractAddress, apiPool.address) - : true; + const isIsolated = isPoolIsolated({ + chainId, + comptrollerAddress: apiPool.address, + }); let poolUserBorrowBalanceCents = new BigNumber(0); let poolUserSupplyBalanceCents = new BigNumber(0); @@ -254,7 +246,7 @@ export const formatOutput = ({ // Add user VAI loan to user borrow balance (only applies to legacy pool) const vai = tokens.find(token => token.symbol === 'VAI'); - if (isIsolated && vai && userVaiBorrowBalanceMantissa) { + if (!isIsolated && vai && userVaiBorrowBalanceMantissa) { const userVaiBorrowBalanceCents = convertMantissaToTokens({ value: userVaiBorrowBalanceMantissa, token: vai, diff --git a/apps/evm/src/clients/api/queries/useGetPools/getPools/index.ts b/apps/evm/src/clients/api/queries/useGetPools/getPools/index.ts index ee65508c07..ff5565ffb4 100644 --- a/apps/evm/src/clients/api/queries/useGetPools/getPools/index.ts +++ b/apps/evm/src/clients/api/queries/useGetPools/getPools/index.ts @@ -4,16 +4,15 @@ import { getBlockNumber, getTokenBalances } from 'clients/api'; import { getIsolatedPoolParticipantsCount } from 'clients/subgraph'; import { NATIVE_TOKEN_ADDRESS } from 'constants/address'; import { type IsolatedPoolComptroller, getIsolatedPoolComptrollerContract } from 'libs/contracts'; -import { type Asset, ChainId, type PrimeApy, type Token } from 'types'; +import type { Asset, PrimeApy, Token } from 'types'; import { - areAddressesEqual, convertAprBipsToApy, extractSettledPromiseValue, findTokenByAddress, + isPoolIsolated, } from 'utilities'; import removeDuplicates from 'utilities/removeDuplicates'; -import { chainMetadata } from '@venusprotocol/chains'; import { logError } from 'libs/errors'; import type { GetPoolsInput, GetPoolsOutput, MarketParticipantsCounts } from '../types'; import { appendPrimeSimulationDistributions } from './appendPrimeSimulationDistributions'; @@ -78,13 +77,12 @@ export const getPools = async ({ const newIsolatedPoolsVTokenAddresses: string[] = []; const newUnderlyingTokens: Token[] = []; const newUnderlyingTokenAddresses: string[] = []; - const { corePoolComptrollerContractAddress } = chainMetadata[chainId]; pool.markets.forEach(market => { - const isIsolated = - chainId === ChainId.BSC_MAINNET || chainId === ChainId.BSC_TESTNET - ? !areAddressesEqual(corePoolComptrollerContractAddress, pool.address) - : true; + const isIsolated = isPoolIsolated({ + chainId, + comptrollerAddress: pool.address, + }); // VToken addresses are unique if (isIsolated) { @@ -119,6 +117,15 @@ export const getPools = async ({ // Fetch addresses of user collaterals const getAssetsInPromises: ReturnType[] = []; apiPools.forEach(pool => { + const isIsolated = isPoolIsolated({ + chainId, + comptrollerAddress: pool.address, + }); + + if (!isIsolated) { + return; + } + const comptrollerContract = getIsolatedPoolComptrollerContract({ signerOrProvider: provider, address: pool.address, @@ -128,12 +135,13 @@ export const getPools = async ({ getAssetsInPromises.push(comptrollerContract.getAssetsIn(accountAddress)); } }); - const settledGetAssetsInPromises = Promise.allSettled(getAssetsInPromises); if (accountAddress && legacyPoolComptrollerContract) { getAssetsInPromises.push(legacyPoolComptrollerContract.getAssetsIn(accountAddress)); } + const settledGetAssetsInPromises = Promise.allSettled(getAssetsInPromises); + // Fetch user token balances const tokenBalancesPromises = Promise.allSettled([ accountAddress diff --git a/apps/evm/src/pages/Market/Page/MarketHistory/Card/useGetLiquidationThresholdPercentage.tsx b/apps/evm/src/pages/Market/Page/MarketHistory/Card/useGetLiquidationThresholdPercentage.tsx index 52ce03acc2..8f264ca13b 100644 --- a/apps/evm/src/pages/Market/Page/MarketHistory/Card/useGetLiquidationThresholdPercentage.tsx +++ b/apps/evm/src/pages/Market/Page/MarketHistory/Card/useGetLiquidationThresholdPercentage.tsx @@ -1,8 +1,7 @@ import { useGetIsolatedPoolVTokenLiquidationThreshold } from 'clients/api'; -import { useGetChainMetadata } from 'hooks/useGetChainMetadata'; import { useChainId } from 'libs/wallet'; -import { type Asset, ChainId } from 'types'; -import { areAddressesEqual } from 'utilities'; +import type { Asset } from 'types'; +import { isPoolIsolated } from 'utilities'; export const useGetLiquidationThresholdPercentage = ( { @@ -12,11 +11,11 @@ export const useGetLiquidationThresholdPercentage = ( { enabled }: { enabled: boolean }, ) => { const { chainId } = useChainId(); - const { corePoolComptrollerContractAddress } = useGetChainMetadata(); - const isLegacyCorePoolVToken = - areAddressesEqual(corePoolComptrollerContractAddress, poolComptrollerContractAddress) && - (chainId === ChainId.BSC_MAINNET || chainId === ChainId.BSC_TESTNET); + const isIsolated = isPoolIsolated({ + chainId, + comptrollerAddress: poolComptrollerContractAddress, + }); const { data: getIsolatedPoolVTokenLiquidationThresholdData } = useGetIsolatedPoolVTokenLiquidationThreshold( @@ -25,11 +24,11 @@ export const useGetLiquidationThresholdPercentage = ( vTokenAddress: asset.vToken.address, }, { - enabled: enabled && !isLegacyCorePoolVToken, + enabled: enabled && isIsolated, }, ); - return isLegacyCorePoolVToken - ? asset.collateralFactor * 100 - : getIsolatedPoolVTokenLiquidationThresholdData?.liquidationThresholdPercentage; + return isIsolated + ? getIsolatedPoolVTokenLiquidationThresholdData?.liquidationThresholdPercentage + : asset.collateralFactor * 100; }; diff --git a/apps/evm/src/setupTests.tsx b/apps/evm/src/setupTests.tsx index 42b6daaa9a..abd08ec219 100644 --- a/apps/evm/src/setupTests.tsx +++ b/apps/evm/src/setupTests.tsx @@ -24,6 +24,9 @@ vi.mock('hooks/useDebounceValue', () => ({ // Mock zustand library (optimized state manager) vi.mock('zustand'); +// Mock Venus chains library +vi.mock('@venusprotocol/chains'); + // Mock React Markdown library vi.mock('@uiw/react-md-editor', () => ({ default: ({ diff --git a/apps/evm/src/utilities/index.ts b/apps/evm/src/utilities/index.ts index 2f41eabe9f..61c698ec0a 100755 --- a/apps/evm/src/utilities/index.ts +++ b/apps/evm/src/utilities/index.ts @@ -53,3 +53,4 @@ export * from './getProposalState'; export * from './getUserVoteSupport'; export * from './getProposalStateLabel'; export * from './isProposalExecutable'; +export * from './isPoolIsolated'; diff --git a/apps/evm/src/utilities/isPoolIsolated/__tests__/index.spec.tsx b/apps/evm/src/utilities/isPoolIsolated/__tests__/index.spec.tsx new file mode 100644 index 0000000000..d8c601efd3 --- /dev/null +++ b/apps/evm/src/utilities/isPoolIsolated/__tests__/index.spec.tsx @@ -0,0 +1,56 @@ +import { ChainId } from '@venusprotocol/chains'; +import type Vi from 'vitest'; + +import areAddressesEqual from 'utilities/areAddressesEqual'; +import { isPoolIsolated } from '..'; + +vi.mock('utilities/areAddressesEqual', () => ({ + default: vi.fn(), +})); + +describe('isPoolIsolated', () => { + it('returns true for chainId not BSC_MAINNET or BSC_TESTNET regardless of address', () => { + (areAddressesEqual as Vi.Mock).mockReturnValueOnce(true); + const result = isPoolIsolated({ + chainId: ChainId.ARBITRUM_ONE, + comptrollerAddress: '0xAnyAddress', + }); + expect(result).toBe(true); + }); + + it('returns false for BSC_MAINNET with matching address', () => { + (areAddressesEqual as Vi.Mock).mockReturnValueOnce(true); + const result = isPoolIsolated({ + chainId: ChainId.BSC_MAINNET, + comptrollerAddress: '0xCoreComptrollerMainnet', + }); + expect(result).toBe(false); + }); + + it('returns false for BSC_TESTNET with matching address', () => { + (areAddressesEqual as Vi.Mock).mockReturnValueOnce(true); + const result = isPoolIsolated({ + chainId: ChainId.BSC_TESTNET, + comptrollerAddress: '0xCoreComptrollerMainnet', + }); + expect(result).toBe(false); + }); + + it('returns true for BSC_MAINNET with non-matching address', () => { + (areAddressesEqual as Vi.Mock).mockReturnValueOnce(false); + const result = isPoolIsolated({ + chainId: ChainId.BSC_MAINNET, + comptrollerAddress: '0xDifferentAddress', + }); + expect(result).toBe(true); + }); + + it('returns true for BSC_TESTNET with non-matching address', () => { + (areAddressesEqual as Vi.Mock).mockReturnValueOnce(false); + const result = isPoolIsolated({ + chainId: ChainId.BSC_TESTNET, + comptrollerAddress: '0xDifferentAddress', + }); + expect(result).toBe(true); + }); +}); diff --git a/apps/evm/src/utilities/isPoolIsolated/index.tsx b/apps/evm/src/utilities/isPoolIsolated/index.tsx new file mode 100644 index 0000000000..a786986bbe --- /dev/null +++ b/apps/evm/src/utilities/isPoolIsolated/index.tsx @@ -0,0 +1,14 @@ +import { ChainId, chainMetadata } from '@venusprotocol/chains'; +import areAddressesEqual from 'utilities/areAddressesEqual'; + +export const isPoolIsolated = ({ + chainId, + comptrollerAddress, +}: { chainId: ChainId; comptrollerAddress: string }) => { + const { corePoolComptrollerContractAddress } = chainMetadata[chainId]; + + return ( + (chainId !== ChainId.BSC_MAINNET && chainId !== ChainId.BSC_TESTNET) || + !areAddressesEqual(corePoolComptrollerContractAddress, comptrollerAddress) + ); +};