Skip to content

Commit 8ef5dab

Browse files
authored
AWS API gateway for coingecko data (ribbon-finance#674)
* use aws for coingecko queries * remove redundant lend changes * remove unused constant * ken comments * leon comment: move variable to env
1 parent 3af3cea commit 8ef5dab

File tree

8 files changed

+91
-410
lines changed

8 files changed

+91
-410
lines changed

lend/src/App.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { Web3ContextProvider } from "./hooks/web3Context";
88
import { getLibrary } from "shared/lib/utils/getLibrary";
99
import { SubgraphDataContextProvider } from "./hooks/subgraphDataContext";
1010
import { PendingTransactionsContextProvider } from "./hooks/pendingTransactionsContext";
11-
import { ExternalAPIDataContextProvider } from "./hooks/externalAPIDataContext";
11+
import { ExternalAPIDataContextProvider } from "shared/lib/hooks/externalAPIDataContext";
1212
import { ChainContextProvider } from "./hooks/chainContext";
1313
import { GeofenceCountry, useGeofence } from "shared/lib/hooks/useGeofence";
1414
import TextPreview from "shared/lib/components/TextPreview/TextPreview";

lend/src/constants/constants.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ const WEBAPP_SUBGRAPHS: [PoolVersion, Chains][] = [["lend", Chains.Ethereum]];
159159

160160
export const SUBGRAPHS_TO_QUERY: [PoolVersion, Chains][] = WEBAPP_SUBGRAPHS;
161161

162-
export const COINGECKO_BASE_URL = "https://api.coingecko.com/api/v3";
163162
export const COINGECKO_CURRENCIES: { [key in Assets]: string | undefined } = {
164163
WETH: "ethereum",
165164
USDC: "usd-coin",

lend/src/hooks/externalAPIDataContext.tsx

-52
This file was deleted.

lend/src/hooks/useAssetPrice.ts

-285
This file was deleted.

lend/src/hooks/usePoolsApr.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useEffect, useMemo, useState } from "react";
22
import { secondsPerYear } from "../constants/constants";
33
import { PoolOptions, PoolList } from "shared/lib/constants/lendConstants";
4-
import useAssetPrice from "./useAssetPrice";
4+
import useAssetPrice from "shared/lib/hooks/useAssetPrice";
55
import { usePoolsData } from "./web3DataContext";
66
import { formatUnits } from "ethers/lib/utils";
77

shared/src/constants/constants.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1366,7 +1366,9 @@ export const SUBGRAPHS_TO_QUERY: [VaultVersion, Chains][] = isTreasury()
13661366
? TREASURY_SUBGRAPHS
13671367
: WEBAPP_SUBGRAPHS;
13681368

1369-
export const COINGECKO_BASE_URL = "https://api.coingecko.com/api/v3";
1369+
export const COINGECKO_AWS_BASE_URL =
1370+
process.env.REACT_APP_COINGECKO_AWS_BASE_URL;
1371+
13701372
export const COINGECKO_CURRENCIES: { [key in Assets]: string | undefined } = {
13711373
WETH: "ethereum",
13721374
WBTC: "wrapped-bitcoin",

0 commit comments

Comments
 (0)