From 1e6a4473351fbfc186893c46ae31ca66e2806018 Mon Sep 17 00:00:00 2001 From: Andrew Schmidt Date: Wed, 5 Oct 2022 22:20:05 -0500 Subject: [PATCH 1/5] feat: enable rate history endpoint on v3 markets --- src/ui-config/networksConfig.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/ui-config/networksConfig.ts b/src/ui-config/networksConfig.ts index 486c98df12..61faa970d7 100644 --- a/src/ui-config/networksConfig.ts +++ b/src/ui-config/networksConfig.ts @@ -81,7 +81,7 @@ export const networkConfigs: Record = { baseAssetDecimals: 18, explorerLink: 'https://etherscan.io', // rpcOnly: false, - ratesHistoryApiUrl: 'https://aave-api-v2.aave.com/data/rates-history', + ratesHistoryApiUrl: 'https://api-v2-feat-v3-rate-history.aaw.fi/data/rates-history', networkLogoPath: '/icons/networks/ethereum.svg', }, [ChainId.polygon]: { @@ -102,7 +102,7 @@ export const networkConfigs: Record = { name: 'Polygon PoS Bridge', url: 'https://wallet.matic.network/bridge/', }, - ratesHistoryApiUrl: 'https://aave-api-v2.aave.com/data/rates-history', + ratesHistoryApiUrl: 'https://api-v2-feat-v3-rate-history.aaw.fi/data/rates-history', }, [ChainId.mumbai]: { name: 'Mumbai', @@ -159,7 +159,7 @@ export const networkConfigs: Record = { name: 'Avalanche Bridge', url: 'https://bridge.avax.network/', }, - ratesHistoryApiUrl: 'https://aave-api-v2.aave.com/data/rates-history', + ratesHistoryApiUrl: 'https://api-v2-feat-v3-rate-history.aaw.fi/data/rates-history', }, [ChainId.arbitrum_goerli]: { name: 'Arbitrum Görli', @@ -198,6 +198,7 @@ export const networkConfigs: Record = { name: 'Arbitrum Bridge', url: 'https://bridge.arbitrum.io', }, + ratesHistoryApiUrl: 'https://api-v2-feat-v3-rate-history.aaw.fi/data/rates-history', }, [ChainId.harmony]: { name: 'Harmony', @@ -218,6 +219,7 @@ export const networkConfigs: Record = { name: 'Harmony Bridge', url: 'https://bridge.harmony.one', }, + ratesHistoryApiUrl: 'https://api-v2-feat-v3-rate-history.aaw.fi/data/rates-history', }, [ChainId.optimism]: { name: 'Optimism', @@ -239,6 +241,7 @@ export const networkConfigs: Record = { name: 'Optimism Bridge', url: 'https://app.optimism.io/bridge', }, + ratesHistoryApiUrl: 'https://api-v2-feat-v3-rate-history.aaw.fi/data/rates-history', }, [ChainId.optimism_goerli]: { name: 'Optimism Görli', @@ -279,6 +282,7 @@ export const networkConfigs: Record = { name: 'Fantom Bridge', url: 'https://app.multichain.org/#/router', }, + ratesHistoryApiUrl: 'https://api-v2-feat-v3-rate-history.aaw.fi/data/rates-history', }, [ChainId.fantom_testnet]: { name: 'Fantom Testnet', From 936cbdc0abe31ad09fd0612413798439a5b48e2a Mon Sep 17 00:00:00 2001 From: Andrew Schmidt Date: Wed, 5 Oct 2022 22:21:59 -0500 Subject: [PATCH 2/5] feat: modify rate history queries for v3 endpoint schema --- .../reserve-overview/ReserveConfiguration.tsx | 11 +++-------- .../reserve-overview/graphs/ApyGraphContainer.tsx | 14 +++++++++++--- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/modules/reserve-overview/ReserveConfiguration.tsx b/src/modules/reserve-overview/ReserveConfiguration.tsx index 486eb9268d..f02c74a9fc 100644 --- a/src/modules/reserve-overview/ReserveConfiguration.tsx +++ b/src/modules/reserve-overview/ReserveConfiguration.tsx @@ -37,10 +37,7 @@ type ReserveConfigurationProps = { export const ReserveConfiguration: React.FC = ({ reserve }) => { const { currentNetworkConfig, currentMarketData, currentMarket } = useProtocolDataContext(); - const { v3 } = marketsData[currentMarket as CustomMarket]; - // V3 and V2 Polygon will be enabled once support is added to API - const renderCharts = - !v3 && !!currentNetworkConfig.ratesHistoryApiUrl && currentMarket !== 'proto_polygon'; + const renderCharts = !!currentNetworkConfig.ratesHistoryApiUrl; const { supplyCap, borrowCap, debtCeiling } = useAssetCaps(); const showSupplyCapStatus = reserve.supplyCap && reserve.supplyCap !== '0'; const showBorrowCapStatus = reserve.borrowCap && reserve.borrowCap !== '0'; @@ -196,7 +193,7 @@ export const ReserveConfiguration: React.FC = ({ rese )}
@@ -456,9 +453,7 @@ export const ReserveConfiguration: React.FC = ({ rese )} { const [selectedTimeRange, setSelectedTimeRange] = useState('1m'); const CHART_HEIGHT = 155; const CHART_HEIGHT_LOADING_FIX = 3.5; - const reserveAddress = reserve ? `${reserve.underlyingAsset}${lendingPoolAddressProvider}` : ''; + let reserveAddress = ''; + if (reserve) { + if (currentMarketData.v3) { + reserveAddress = `${reserve.underlyingAsset}${currentMarketData.addresses.LENDING_POOL_ADDRESS_PROVIDER}${currentMarketData.chainId}`; + } else { + reserveAddress = `${reserve.underlyingAsset}${currentMarketData.addresses.LENDING_POOL_ADDRESS_PROVIDER}`; + } + } const { data, loading, error, refetch } = useReserveRatesHistory( reserveAddress, selectedTimeRange From 899d3e95524f75669d629aab8ec93b6c73b326a4 Mon Sep 17 00:00:00 2001 From: Andrew Schmidt Date: Wed, 5 Oct 2022 22:43:36 -0500 Subject: [PATCH 3/5] fix: unused import --- src/modules/reserve-overview/ReserveConfiguration.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/modules/reserve-overview/ReserveConfiguration.tsx b/src/modules/reserve-overview/ReserveConfiguration.tsx index f02c74a9fc..6256453d7f 100644 --- a/src/modules/reserve-overview/ReserveConfiguration.tsx +++ b/src/modules/reserve-overview/ReserveConfiguration.tsx @@ -26,7 +26,6 @@ import { ReserveFactorOverview } from 'src/modules/reserve-overview/ReserveFacto import LightningBoltGradient from '/public/lightningBoltGradient.svg'; -import { CustomMarket, marketsData } from '../../utils/marketsAndNetworksConfig'; import { ApyGraphContainer } from './graphs/ApyGraphContainer'; import { InterestRateModelGraphContainer } from './graphs/InterestRateModelGraphContainer'; import { PanelItem, PanelRow, PanelTitle } from './ReservePanels'; From 6b9df43a02a5bfc36452f1b3be506b6f19f503e7 Mon Sep 17 00:00:00 2001 From: Andrew Schmidt Date: Tue, 11 Oct 2022 21:42:32 -0500 Subject: [PATCH 4/5] feat: testing new deployment with indexing fixes --- src/ui-config/networksConfig.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ui-config/networksConfig.ts b/src/ui-config/networksConfig.ts index 61faa970d7..826e9a1df3 100644 --- a/src/ui-config/networksConfig.ts +++ b/src/ui-config/networksConfig.ts @@ -81,7 +81,7 @@ export const networkConfigs: Record = { baseAssetDecimals: 18, explorerLink: 'https://etherscan.io', // rpcOnly: false, - ratesHistoryApiUrl: 'https://api-v2-feat-v3-rate-history.aaw.fi/data/rates-history', + ratesHistoryApiUrl: 'https://api-v2-feat-v3-rate-history-clean.aaw.fi/data/rates-history', networkLogoPath: '/icons/networks/ethereum.svg', }, [ChainId.polygon]: { @@ -102,7 +102,7 @@ export const networkConfigs: Record = { name: 'Polygon PoS Bridge', url: 'https://wallet.matic.network/bridge/', }, - ratesHistoryApiUrl: 'https://api-v2-feat-v3-rate-history.aaw.fi/data/rates-history', + ratesHistoryApiUrl: 'https://api-v2-feat-v3-rate-history-clean.aaw.fi/data/rates-history', }, [ChainId.mumbai]: { name: 'Mumbai', @@ -159,7 +159,7 @@ export const networkConfigs: Record = { name: 'Avalanche Bridge', url: 'https://bridge.avax.network/', }, - ratesHistoryApiUrl: 'https://api-v2-feat-v3-rate-history.aaw.fi/data/rates-history', + ratesHistoryApiUrl: 'https://api-v2-feat-v3-rate-history-clean.aaw.fi/data/rates-history', }, [ChainId.arbitrum_goerli]: { name: 'Arbitrum Görli', @@ -198,7 +198,7 @@ export const networkConfigs: Record = { name: 'Arbitrum Bridge', url: 'https://bridge.arbitrum.io', }, - ratesHistoryApiUrl: 'https://api-v2-feat-v3-rate-history.aaw.fi/data/rates-history', + ratesHistoryApiUrl: 'https://api-v2-feat-v3-rate-history-clean.aaw.fi/data/rates-history', }, [ChainId.harmony]: { name: 'Harmony', @@ -219,7 +219,7 @@ export const networkConfigs: Record = { name: 'Harmony Bridge', url: 'https://bridge.harmony.one', }, - ratesHistoryApiUrl: 'https://api-v2-feat-v3-rate-history.aaw.fi/data/rates-history', + ratesHistoryApiUrl: 'https://api-v2-feat-v3-rate-history-clean.aaw.fi/data/rates-history', }, [ChainId.optimism]: { name: 'Optimism', @@ -241,7 +241,7 @@ export const networkConfigs: Record = { name: 'Optimism Bridge', url: 'https://app.optimism.io/bridge', }, - ratesHistoryApiUrl: 'https://api-v2-feat-v3-rate-history.aaw.fi/data/rates-history', + ratesHistoryApiUrl: 'https://api-v2-feat-v3-rate-history-clean.aaw.fi/data/rates-history', }, [ChainId.optimism_goerli]: { name: 'Optimism Görli', @@ -282,7 +282,7 @@ export const networkConfigs: Record = { name: 'Fantom Bridge', url: 'https://app.multichain.org/#/router', }, - ratesHistoryApiUrl: 'https://api-v2-feat-v3-rate-history.aaw.fi/data/rates-history', + ratesHistoryApiUrl: 'https://api-v2-feat-v3-rate-history-clean.aaw.fi/data/rates-history', }, [ChainId.fantom_testnet]: { name: 'Fantom Testnet', From 6e517e767c2199eb26eda308eede591db2c79548 Mon Sep 17 00:00:00 2001 From: Andrew Schmidt Date: Wed, 12 Oct 2022 17:07:01 -0500 Subject: [PATCH 5/5] feat: update to production endpoint --- src/ui-config/networksConfig.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ui-config/networksConfig.ts b/src/ui-config/networksConfig.ts index 826e9a1df3..c4100ec369 100644 --- a/src/ui-config/networksConfig.ts +++ b/src/ui-config/networksConfig.ts @@ -81,7 +81,7 @@ export const networkConfigs: Record = { baseAssetDecimals: 18, explorerLink: 'https://etherscan.io', // rpcOnly: false, - ratesHistoryApiUrl: 'https://api-v2-feat-v3-rate-history-clean.aaw.fi/data/rates-history', + ratesHistoryApiUrl: 'https://aave-api-v2.aave.com/data/rates-history', networkLogoPath: '/icons/networks/ethereum.svg', }, [ChainId.polygon]: { @@ -102,7 +102,7 @@ export const networkConfigs: Record = { name: 'Polygon PoS Bridge', url: 'https://wallet.matic.network/bridge/', }, - ratesHistoryApiUrl: 'https://api-v2-feat-v3-rate-history-clean.aaw.fi/data/rates-history', + ratesHistoryApiUrl: 'https://aave-api-v2.aave.com/data/rates-history', }, [ChainId.mumbai]: { name: 'Mumbai', @@ -159,7 +159,7 @@ export const networkConfigs: Record = { name: 'Avalanche Bridge', url: 'https://bridge.avax.network/', }, - ratesHistoryApiUrl: 'https://api-v2-feat-v3-rate-history-clean.aaw.fi/data/rates-history', + ratesHistoryApiUrl: 'https://aave-api-v2.aave.com/data/rates-history', }, [ChainId.arbitrum_goerli]: { name: 'Arbitrum Görli', @@ -198,7 +198,7 @@ export const networkConfigs: Record = { name: 'Arbitrum Bridge', url: 'https://bridge.arbitrum.io', }, - ratesHistoryApiUrl: 'https://api-v2-feat-v3-rate-history-clean.aaw.fi/data/rates-history', + ratesHistoryApiUrl: 'https://aave-api-v2.aave.com/data/rates-history', }, [ChainId.harmony]: { name: 'Harmony', @@ -219,7 +219,7 @@ export const networkConfigs: Record = { name: 'Harmony Bridge', url: 'https://bridge.harmony.one', }, - ratesHistoryApiUrl: 'https://api-v2-feat-v3-rate-history-clean.aaw.fi/data/rates-history', + ratesHistoryApiUrl: 'https://aave-api-v2.aave.com/data/rates-history', }, [ChainId.optimism]: { name: 'Optimism', @@ -241,7 +241,7 @@ export const networkConfigs: Record = { name: 'Optimism Bridge', url: 'https://app.optimism.io/bridge', }, - ratesHistoryApiUrl: 'https://api-v2-feat-v3-rate-history-clean.aaw.fi/data/rates-history', + ratesHistoryApiUrl: 'https://aave-api-v2.aave.com/data/rates-history', }, [ChainId.optimism_goerli]: { name: 'Optimism Görli', @@ -282,7 +282,7 @@ export const networkConfigs: Record = { name: 'Fantom Bridge', url: 'https://app.multichain.org/#/router', }, - ratesHistoryApiUrl: 'https://api-v2-feat-v3-rate-history-clean.aaw.fi/data/rates-history', + ratesHistoryApiUrl: 'https://aave-api-v2.aave.com/data/rates-history', }, [ChainId.fantom_testnet]: { name: 'Fantom Testnet',