From b73da63ccb582564b83123dd581f47ef2e297417 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Wed, 21 Feb 2024 20:50:44 +0400 Subject: [PATCH 1/9] Add upstream errors to log messages --- .../operations/atBlock/internal/protocolMetrics.ts | 4 ++-- apps/server/.wundergraph/operations/atBlock/tokenRecords.ts | 2 +- .../server/.wundergraph/operations/atBlock/tokenSupplies.ts | 2 +- .../operations/earliest/internal/protocolMetrics.ts | 4 ++-- .../server/.wundergraph/operations/earliest/tokenRecords.ts | 2 +- .../.wundergraph/operations/earliest/tokenSupplies.ts | 2 +- .../.wundergraph/operations/latest/protocolMetrics.ts | 6 +++--- apps/server/.wundergraph/operations/latest/tokenRecords.ts | 2 +- apps/server/.wundergraph/operations/latest/tokenSupplies.ts | 2 +- .../.wundergraph/operations/paginated/protocolMetrics.ts | 6 +++--- .../.wundergraph/operations/paginated/tokenRecords.ts | 4 ++-- .../.wundergraph/operations/paginated/tokenSupplies.ts | 6 +++--- .../.wundergraph/operations/tokenRecordsEarliest.graphql | 2 +- .../.wundergraph/operations/tokenRecordsLatest.graphql | 2 +- apps/server/.wundergraph/wundergraph.config.ts | 4 ++-- 15 files changed, 25 insertions(+), 25 deletions(-) diff --git a/apps/server/.wundergraph/operations/atBlock/internal/protocolMetrics.ts b/apps/server/.wundergraph/operations/atBlock/internal/protocolMetrics.ts index cb032a5..54cd1f7 100644 --- a/apps/server/.wundergraph/operations/atBlock/internal/protocolMetrics.ts +++ b/apps/server/.wundergraph/operations/atBlock/internal/protocolMetrics.ts @@ -5,7 +5,7 @@ import { flattenRecords } from '../../../protocolMetricHelper'; /** * This custom query will return a flat array containing the ProtocolMetric objects for * a specific block. - * + * * NOTE: this is not available for public use, and is superseded by the Metric queries. */ export default createOperation.query({ @@ -32,7 +32,7 @@ export default createOperation.query({ }); if (!queryResult.data) { - throw new UpstreamSubgraphError({ message: `${FUNC}: No data returned.` }); + throw new UpstreamSubgraphError({ message: `${FUNC}: No data returned. Error: ${queryResult.error}` }); } // Combine across pages and endpoints diff --git a/apps/server/.wundergraph/operations/atBlock/tokenRecords.ts b/apps/server/.wundergraph/operations/atBlock/tokenRecords.ts index b58caa6..f05f4b2 100644 --- a/apps/server/.wundergraph/operations/atBlock/tokenRecords.ts +++ b/apps/server/.wundergraph/operations/atBlock/tokenRecords.ts @@ -30,7 +30,7 @@ export default createOperation.query({ }); if (!queryResult.data) { - throw new UpstreamSubgraphError({ message: `${FUNC}: No data returned.` }); + throw new UpstreamSubgraphError({ message: `${FUNC}: No data returned. Error: ${queryResult.error}` }); } // Combine across pages and endpoints diff --git a/apps/server/.wundergraph/operations/atBlock/tokenSupplies.ts b/apps/server/.wundergraph/operations/atBlock/tokenSupplies.ts index 86a9130..1c1538e 100644 --- a/apps/server/.wundergraph/operations/atBlock/tokenSupplies.ts +++ b/apps/server/.wundergraph/operations/atBlock/tokenSupplies.ts @@ -30,7 +30,7 @@ export default createOperation.query({ }); if (!queryResult.data) { - throw new UpstreamSubgraphError({ message: `${FUNC}: No data returned` }); + throw new UpstreamSubgraphError({ message: `${FUNC}: No data returned. Error: ${queryResult.error}` }); } return flattenRecords(queryResult.data, true, false, log); diff --git a/apps/server/.wundergraph/operations/earliest/internal/protocolMetrics.ts b/apps/server/.wundergraph/operations/earliest/internal/protocolMetrics.ts index d178f70..358babf 100644 --- a/apps/server/.wundergraph/operations/earliest/internal/protocolMetrics.ts +++ b/apps/server/.wundergraph/operations/earliest/internal/protocolMetrics.ts @@ -5,7 +5,7 @@ import { flattenRecords } from '../../../protocolMetricHelper'; /** * This custom query will return a flat array containing the earliest ProtocolMetric object for * each blockchain. - * + * * NOTE: this is not available for public use, and is superseded by the Metric queries. */ export default createOperation.query({ @@ -20,7 +20,7 @@ export default createOperation.query({ }); if (!queryResult.data) { - throw new UpstreamSubgraphError({ message: `${FUNC}: No data returned.` }); + throw new UpstreamSubgraphError({ message: `${FUNC}: No data returned. Error: ${queryResult.error}` }); } // Combine across pages and endpoints diff --git a/apps/server/.wundergraph/operations/earliest/tokenRecords.ts b/apps/server/.wundergraph/operations/earliest/tokenRecords.ts index bf15a05..d6f7aa5 100644 --- a/apps/server/.wundergraph/operations/earliest/tokenRecords.ts +++ b/apps/server/.wundergraph/operations/earliest/tokenRecords.ts @@ -32,7 +32,7 @@ export default createOperation.query({ }); if (!queryResult.data) { - throw new UpstreamSubgraphError({ message: `${FUNC}: No data returned.` }); + throw new UpstreamSubgraphError({ message: `${FUNC}: No data returned. Error: ${queryResult.error}` }); } // Combine across pages and endpoints diff --git a/apps/server/.wundergraph/operations/earliest/tokenSupplies.ts b/apps/server/.wundergraph/operations/earliest/tokenSupplies.ts index bd97028..7d3097d 100644 --- a/apps/server/.wundergraph/operations/earliest/tokenSupplies.ts +++ b/apps/server/.wundergraph/operations/earliest/tokenSupplies.ts @@ -32,7 +32,7 @@ export default createOperation.query({ }); if (!queryResult.data) { - throw new UpstreamSubgraphError({ message: `${FUNC}: No data returned.` }); + throw new UpstreamSubgraphError({ message: `${FUNC}: No data returned. Error: ${queryResult.error}` }); } // Combine across pages and endpoints diff --git a/apps/server/.wundergraph/operations/latest/protocolMetrics.ts b/apps/server/.wundergraph/operations/latest/protocolMetrics.ts index cb75e09..860e629 100644 --- a/apps/server/.wundergraph/operations/latest/protocolMetrics.ts +++ b/apps/server/.wundergraph/operations/latest/protocolMetrics.ts @@ -6,9 +6,9 @@ import { ProtocolMetric, flattenRecords } from '../../protocolMetricHelper'; /** * This custom query will return a flat array containing the latest ProtocolMetric object for * each blockchain. - * + * * NOTE: this is not available for public use, and is superseded by the Metric queries. - * + * * TODO: remove this query once the Metric queries are in use in the frontend */ export default createOperation.query({ @@ -36,7 +36,7 @@ export default createOperation.query({ }); if (!queryResult.data) { - throw new UpstreamSubgraphError({ message: `${FUNC}: No data returned.` }); + throw new UpstreamSubgraphError({ message: `${FUNC}: No data returned. Error: ${queryResult.error}` }); } // Combine across pages and endpoints diff --git a/apps/server/.wundergraph/operations/latest/tokenRecords.ts b/apps/server/.wundergraph/operations/latest/tokenRecords.ts index 5cdd57b..50342d9 100644 --- a/apps/server/.wundergraph/operations/latest/tokenRecords.ts +++ b/apps/server/.wundergraph/operations/latest/tokenRecords.ts @@ -31,7 +31,7 @@ export default createOperation.query({ }); if (!queryResult.data) { - throw new UpstreamSubgraphError({ message: `${FUNC}: No data returned.` }); + throw new UpstreamSubgraphError({ message: `${FUNC}: No data returned. Error: ${queryResult.error}` }); } // Combine across pages and endpoints diff --git a/apps/server/.wundergraph/operations/latest/tokenSupplies.ts b/apps/server/.wundergraph/operations/latest/tokenSupplies.ts index 99be3ff..2457fa3 100644 --- a/apps/server/.wundergraph/operations/latest/tokenSupplies.ts +++ b/apps/server/.wundergraph/operations/latest/tokenSupplies.ts @@ -32,7 +32,7 @@ export default createOperation.query({ }); if (!queryResult.data) { - throw new UpstreamSubgraphError({ message: `${FUNC}: No data returned.` }); + throw new UpstreamSubgraphError({ message: `${FUNC}: No data returned. Error: ${queryResult.error}` }); } // Combine across pages and endpoints diff --git a/apps/server/.wundergraph/operations/paginated/protocolMetrics.ts b/apps/server/.wundergraph/operations/paginated/protocolMetrics.ts index e404028..5245501 100644 --- a/apps/server/.wundergraph/operations/paginated/protocolMetrics.ts +++ b/apps/server/.wundergraph/operations/paginated/protocolMetrics.ts @@ -9,9 +9,9 @@ import { BadRequestError } from '../../badRequestError'; /** * This custom query will return a flat array containing ProtocolMetric objects from * across all endpoints. - * + * * It also handles pagination to work around the Graph Protocol's 1000 record limit. - * + * * NOTE: this is not recommended for public use, and is superseded by the Metric queries. */ export default createOperation.query({ @@ -65,7 +65,7 @@ export default createOperation.query({ }); if (!queryResult.data) { - throw new UpstreamSubgraphError({ message: `${FUNC}: No data returned for date range ${getISO8601DateString(currentStartDate)} to ${getISO8601DateString(currentEndDate)}` }); + throw new UpstreamSubgraphError({ message: `${FUNC}: No data returned for date range ${getISO8601DateString(currentStartDate)} to ${getISO8601DateString(currentEndDate)}. Error: ${queryResult.error}` }); } // Collapse the data into a single array, and add a missing property diff --git a/apps/server/.wundergraph/operations/paginated/tokenRecords.ts b/apps/server/.wundergraph/operations/paginated/tokenRecords.ts index 1b5a9eb..07e1a41 100644 --- a/apps/server/.wundergraph/operations/paginated/tokenRecords.ts +++ b/apps/server/.wundergraph/operations/paginated/tokenRecords.ts @@ -9,7 +9,7 @@ import { UpstreamSubgraphError } from '../../upstreamSubgraphError'; /** * This custom query will return a flat array containing TokenRecord objects from * across all endpoints. - * + * * It also handles pagination to work around the Graph Protocol's 1000 record limit. */ export default createOperation.query({ @@ -64,7 +64,7 @@ export default createOperation.query({ }); if (!queryResult.data) { - throw new UpstreamSubgraphError({ message: `${FUNC}: No data returned for date range ${getISO8601DateString(currentStartDate)} to ${getISO8601DateString(currentEndDate)}` }); + throw new UpstreamSubgraphError({ message: `${FUNC}: No data returned for date range ${getISO8601DateString(currentStartDate)} to ${getISO8601DateString(currentEndDate)}. Error: ${queryResult.error}` }); } let data: TokenRecordsResponseData = queryResult.data; diff --git a/apps/server/.wundergraph/operations/paginated/tokenSupplies.ts b/apps/server/.wundergraph/operations/paginated/tokenSupplies.ts index bbcbb1a..399090e 100644 --- a/apps/server/.wundergraph/operations/paginated/tokenSupplies.ts +++ b/apps/server/.wundergraph/operations/paginated/tokenSupplies.ts @@ -9,10 +9,10 @@ import { BadRequestError } from '../../badRequestError'; /** * This custom query will return a flat array containing TokenSupply objects from * across all endpoints. - * + * * As TokenSupply snapshots can be created at different blocks, this operation * returns the latest snapshot for each day. - * + * * It also handles pagination to work around the Graph Protocol's 1000 record limit. */ export default createOperation.query({ @@ -68,7 +68,7 @@ export default createOperation.query({ }); if (!queryResult.data) { - throw new UpstreamSubgraphError({ message: `${FUNC}: No data returned for date range ${getISO8601DateString(currentStartDate)} to ${getISO8601DateString(currentEndDate)}` }); + throw new UpstreamSubgraphError({ message: `${FUNC}: No data returned for date range ${getISO8601DateString(currentStartDate)} to ${getISO8601DateString(currentEndDate)}. Error: ${queryResult.error}` }); } let data: TokenSuppliesResponseData = queryResult.data; diff --git a/apps/server/.wundergraph/operations/tokenRecordsEarliest.graphql b/apps/server/.wundergraph/operations/tokenRecordsEarliest.graphql index 3d4ec1d..4e4d95a 100644 --- a/apps/server/.wundergraph/operations/tokenRecordsEarliest.graphql +++ b/apps/server/.wundergraph/operations/tokenRecordsEarliest.graphql @@ -4,7 +4,7 @@ query TokenRecordsEarliest { } treasuryEthereum_tokenRecords(orderBy: block, orderDirection: asc, first: 1) { ...Fragment_TokenRecordEthereum -} + } treasuryFantom_tokenRecords(orderBy: block, orderDirection: asc, first: 1) { ...Fragment_TokenRecordFantom } diff --git a/apps/server/.wundergraph/operations/tokenRecordsLatest.graphql b/apps/server/.wundergraph/operations/tokenRecordsLatest.graphql index 15b02e4..35bf374 100644 --- a/apps/server/.wundergraph/operations/tokenRecordsLatest.graphql +++ b/apps/server/.wundergraph/operations/tokenRecordsLatest.graphql @@ -4,7 +4,7 @@ query TokenRecordsLatest { } treasuryEthereum_tokenRecords(orderBy: block, orderDirection: desc, first: 1) { ...Fragment_TokenRecordEthereum -} + } treasuryFantom_tokenRecords(orderBy: block, orderDirection: desc, first: 1) { ...Fragment_TokenRecordFantom } diff --git a/apps/server/.wundergraph/wundergraph.config.ts b/apps/server/.wundergraph/wundergraph.config.ts index c5886ac..02e6fa8 100644 --- a/apps/server/.wundergraph/wundergraph.config.ts +++ b/apps/server/.wundergraph/wundergraph.config.ts @@ -4,10 +4,10 @@ import operations from './wundergraph.operations'; /** * The TokenSupply type on non-Ethereum chains has not historically had a blockchain property. - * + * * Re-indexing the historical data is very time-consuming, so we modify the schema to add this field, * and add it to each record in the operations. - * + * * NOTE: this is currently ignored by Wundergraph */ const schemaExtension: string = From 08e72d124e2dea6a624ab1d10407282445eadab1 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Wed, 21 Feb 2024 20:51:07 +0400 Subject: [PATCH 2/9] Shift Polygon subgraph to DN version --- apps/server/.wundergraph/wundergraph.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/server/.wundergraph/wundergraph.config.ts b/apps/server/.wundergraph/wundergraph.config.ts index 02e6fa8..4bcf064 100644 --- a/apps/server/.wundergraph/wundergraph.config.ts +++ b/apps/server/.wundergraph/wundergraph.config.ts @@ -46,7 +46,7 @@ const treasuryFantom = introspect.graphql({ const treasuryPolygon = introspect.graphql({ apiNamespace: "treasuryPolygon", - url: "https://api.thegraph.com/subgraphs/name/olympusdao/protocol-metrics-polygon", + url: resolveSubgraphUrl("https://gateway-arbitrum.network.thegraph.com/api/[api-key]/deployments/id/QmdDUpqEzfKug1ER6HWM8c7U6wf3wtEtRBvXV7LkVoBi9f"), // 1.1.1 schemaExtension: schemaExtension, }); From 43f9aa7e2a410ad246e401a912119be258b40b4a Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Wed, 5 Jun 2024 20:26:33 +0400 Subject: [PATCH 3/9] Shift Fantom to DN --- apps/server/.wundergraph/wundergraph.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/server/.wundergraph/wundergraph.config.ts b/apps/server/.wundergraph/wundergraph.config.ts index 4bcf064..b7e003d 100644 --- a/apps/server/.wundergraph/wundergraph.config.ts +++ b/apps/server/.wundergraph/wundergraph.config.ts @@ -40,7 +40,7 @@ const treasuryArbitrum = introspect.graphql({ const treasuryFantom = introspect.graphql({ apiNamespace: "treasuryFantom", - url: "https://api.thegraph.com/subgraphs/name/olympusdao/protocol-metrics-fantom", + url: "https://gateway-arbitrum.network.thegraph.com/api/[api-key]/subgraphs/id/3qSJTWdWJETFzht814HVV9rVafwRLQp3k9mZhCF39bYd", // 0.0.6 schemaExtension: schemaExtension, }); From 9f6b2284e691af0ee4e6c4c421df341772fbf4b5 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Wed, 5 Jun 2024 20:52:46 +0400 Subject: [PATCH 4/9] Use Fantom on DN. Adds Base subgraph. --- apps/server/.wundergraph/constants.ts | 2 ++ .../fragments/protocolMetric.graphql | 19 ++++++++++++- .../fragments/tokenRecord.graphql | 22 ++++++++++++++- .../fragments/tokenSupply.graphql | 19 ++++++++++++- .../atBlock/internal/protocolMetrics.ts | 2 ++ .../operations/atBlock/metrics.ts | 2 ++ .../operations/atBlock/tokenRecords.ts | 2 ++ .../operations/atBlock/tokenSupplies.ts | 2 ++ .../operations/earliest/metrics.ts | 8 +++--- .../.wundergraph/operations/latest/metrics.ts | 8 +++--- .../raw/internal/protocolMetrics.graphql | 3 +++ .../internal/protocolMetricsAtBlock.graphql | 5 +++- .../internal/protocolMetricsEarliest.graphql | 3 +++ .../internal/protocolMetricsLatest.graphql | 3 +++ .../operations/tokenRecords.graphql | 3 +++ .../operations/tokenRecordsAtBlock.graphql | 5 +++- .../operations/tokenRecordsEarliest.graphql | 3 +++ .../operations/tokenRecordsLatest.graphql | 3 +++ .../operations/tokenSupplies.graphql | 4 +++ .../operations/tokenSuppliesAtBlock.graphql | 5 +++- .../operations/tokenSuppliesEarliest.graphql | 3 +++ .../operations/tokenSuppliesLatest.graphql | 3 +++ .../.wundergraph/protocolMetricHelper.ts | 3 ++- apps/server/.wundergraph/tokenRecordHelper.ts | 27 ++++++++++--------- apps/server/.wundergraph/tokenSupplyHelper.ts | 9 ++++--- .../server/.wundergraph/wundergraph.config.ts | 11 ++++++-- 26 files changed, 149 insertions(+), 30 deletions(-) diff --git a/apps/server/.wundergraph/constants.ts b/apps/server/.wundergraph/constants.ts index 7c63712..deec096 100644 --- a/apps/server/.wundergraph/constants.ts +++ b/apps/server/.wundergraph/constants.ts @@ -2,12 +2,14 @@ export const CHAIN_ARBITRUM = "Arbitrum"; export const CHAIN_ETHEREUM = "Ethereum"; export const CHAIN_FANTOM = "Fantom"; export const CHAIN_POLYGON = "Polygon"; +export const CHAIN_BASE = "Base"; export enum Chains { ARBITRUM = CHAIN_ARBITRUM, ETHEREUM = CHAIN_ETHEREUM, FANTOM = CHAIN_FANTOM, POLYGON = CHAIN_POLYGON, + BASE = CHAIN_BASE, }; export const TOKEN_SUPPLY_TYPE_BONDS_DEPOSITS = "OHM Bonds (Burnable Deposits)"; diff --git a/apps/server/.wundergraph/fragments/protocolMetric.graphql b/apps/server/.wundergraph/fragments/protocolMetric.graphql index 5ec1980..72cfa3c 100644 --- a/apps/server/.wundergraph/fragments/protocolMetric.graphql +++ b/apps/server/.wundergraph/fragments/protocolMetric.graphql @@ -1,4 +1,4 @@ -# One fragment per type +# One fragment per type fragment Fragment_ProtocolMetricArbitrum on treasuryArbitrum_ProtocolMetric { id @@ -67,3 +67,20 @@ fragment Fragment_ProtocolMetricPolygon on treasuryPolygon_ProtocolMetric { timestamp totalValueLocked } + +fragment Fragment_ProtocolMetricBase on treasuryBase_ProtocolMetric { + id + block + currentAPY + currentIndex + date + gOhmPrice + gOhmTotalSupply + nextDistributedOhm + nextEpochRebase + ohmPrice + ohmTotalSupply + sOhmCirculatingSupply + timestamp + totalValueLocked +} diff --git a/apps/server/.wundergraph/fragments/tokenRecord.graphql b/apps/server/.wundergraph/fragments/tokenRecord.graphql index 04682d6..04d213c 100644 --- a/apps/server/.wundergraph/fragments/tokenRecord.graphql +++ b/apps/server/.wundergraph/fragments/tokenRecord.graphql @@ -1,4 +1,4 @@ -# One fragment per type +# One fragment per type fragment Fragment_TokenRecordArbitrum on treasuryArbitrum_TokenRecord { id @@ -79,3 +79,23 @@ fragment Fragment_TokenRecordPolygon on treasuryPolygon_TokenRecord { value valueExcludingOhm } + +fragment Fragment_TokenRecordBase on treasuryBase_TokenRecord { + id + balance + block + blockchain + category + date + isBluechip + isLiquid + multiplier + rate + source + sourceAddress + timestamp + token + tokenAddress + value + valueExcludingOhm +} diff --git a/apps/server/.wundergraph/fragments/tokenSupply.graphql b/apps/server/.wundergraph/fragments/tokenSupply.graphql index 22ba133..80ad027 100644 --- a/apps/server/.wundergraph/fragments/tokenSupply.graphql +++ b/apps/server/.wundergraph/fragments/tokenSupply.graphql @@ -1,4 +1,4 @@ -# One fragment per type +# One fragment per type fragment Fragment_TokenSupplyArbitrum on treasuryArbitrum_TokenSupply { id @@ -67,3 +67,20 @@ fragment Fragment_TokenSupplyPolygon on treasuryPolygon_TokenSupply { tokenAddress type } + +fragment Fragment_TokenSupplyBase on treasuryBase_TokenSupply { + id + balance + block + blockchain + date + pool + poolAddress + source + sourceAddress + supplyBalance + timestamp + token + tokenAddress + type +} diff --git a/apps/server/.wundergraph/operations/atBlock/internal/protocolMetrics.ts b/apps/server/.wundergraph/operations/atBlock/internal/protocolMetrics.ts index 54cd1f7..30b636b 100644 --- a/apps/server/.wundergraph/operations/atBlock/internal/protocolMetrics.ts +++ b/apps/server/.wundergraph/operations/atBlock/internal/protocolMetrics.ts @@ -15,6 +15,7 @@ export default createOperation.query({ ethereumBlock: z.number({ description: "Ethereum block number" }), fantomBlock: z.number({ description: "Fantom block number" }), polygonBlock: z.number({ description: "Polygon block number" }), + baseBlock: z.number({ description: "Base block number" }), }), handler: async (ctx) => { const FUNC = `atBlock/internal/protocolMetrics`; @@ -28,6 +29,7 @@ export default createOperation.query({ ethereumBlock: ctx.input.ethereumBlock.toString(), fantomBlock: ctx.input.fantomBlock.toString(), polygonBlock: ctx.input.polygonBlock.toString(), + baseBlock: ctx.input.baseBlock.toString(), }, }); diff --git a/apps/server/.wundergraph/operations/atBlock/metrics.ts b/apps/server/.wundergraph/operations/atBlock/metrics.ts index 8629847..ef94968 100644 --- a/apps/server/.wundergraph/operations/atBlock/metrics.ts +++ b/apps/server/.wundergraph/operations/atBlock/metrics.ts @@ -10,6 +10,7 @@ export default createOperation.query({ ethereumBlock: z.number({ description: "Ethereum block number" }), fantomBlock: z.number({ description: "Fantom block number" }), polygonBlock: z.number({ description: "Polygon block number" }), + baseBlock: z.number({ description: "Base block number" }), }), handler: async (ctx) => { const FUNC = `atBlock/metrics`; @@ -21,6 +22,7 @@ export default createOperation.query({ ethereumBlock: ctx.input.ethereumBlock, fantomBlock: ctx.input.fantomBlock, polygonBlock: ctx.input.polygonBlock, + baseBlock: ctx.input.baseBlock, }; const protocolMetricsQueryResult = await ctx.operations.query({ diff --git a/apps/server/.wundergraph/operations/atBlock/tokenRecords.ts b/apps/server/.wundergraph/operations/atBlock/tokenRecords.ts index f05f4b2..0b0e030 100644 --- a/apps/server/.wundergraph/operations/atBlock/tokenRecords.ts +++ b/apps/server/.wundergraph/operations/atBlock/tokenRecords.ts @@ -13,6 +13,7 @@ export default createOperation.query({ ethereumBlock: z.number({ description: "Ethereum block number" }), fantomBlock: z.number({ description: "Fantom block number" }), polygonBlock: z.number({ description: "Polygon block number" }), + baseBlock: z.number({ description: "Base block number" }), }), handler: async (ctx) => { const FUNC = "atBlock/tokenRecords"; @@ -26,6 +27,7 @@ export default createOperation.query({ ethereumBlock: ctx.input.ethereumBlock.toString(), fantomBlock: ctx.input.fantomBlock.toString(), polygonBlock: ctx.input.polygonBlock.toString(), + baseBlock: ctx.input.baseBlock.toString(), }, }); diff --git a/apps/server/.wundergraph/operations/atBlock/tokenSupplies.ts b/apps/server/.wundergraph/operations/atBlock/tokenSupplies.ts index 1c1538e..af3e747 100644 --- a/apps/server/.wundergraph/operations/atBlock/tokenSupplies.ts +++ b/apps/server/.wundergraph/operations/atBlock/tokenSupplies.ts @@ -13,6 +13,7 @@ export default createOperation.query({ ethereumBlock: z.number({ description: "Ethereum block number" }), fantomBlock: z.number({ description: "Fantom block number" }), polygonBlock: z.number({ description: "Polygon block number" }), + baseBlock: z.number({ description: "Base block number" }), }), handler: async (ctx) => { const FUNC = "atBlock/tokenSupplies"; @@ -26,6 +27,7 @@ export default createOperation.query({ ethereumBlock: ctx.input.ethereumBlock.toString(), fantomBlock: ctx.input.fantomBlock.toString(), polygonBlock: ctx.input.polygonBlock.toString(), + baseBlock: ctx.input.baseBlock.toString(), }, }); diff --git a/apps/server/.wundergraph/operations/earliest/metrics.ts b/apps/server/.wundergraph/operations/earliest/metrics.ts index ef4b410..9238462 100644 --- a/apps/server/.wundergraph/operations/earliest/metrics.ts +++ b/apps/server/.wundergraph/operations/earliest/metrics.ts @@ -1,7 +1,7 @@ import { createOperation, z } from '../../generated/wundergraph.factory'; import { Metric, getMetricObject } from '../../metricHelper'; import { getBlockByChain } from '../../tokenRecordHelper'; -import { CHAIN_ARBITRUM, CHAIN_ETHEREUM, CHAIN_FANTOM, CHAIN_POLYGON } from '../../constants'; +import { CHAIN_ARBITRUM, CHAIN_BASE, CHAIN_ETHEREUM, CHAIN_FANTOM, CHAIN_POLYGON } from '../../constants'; import { getCacheKey, getCachedRecord, setCachedRecord } from '../../cacheHelper'; import { UpstreamSubgraphError } from '../../upstreamSubgraphError'; @@ -38,9 +38,10 @@ export default createOperation.query({ const ethereumBlock = getBlockByChain(latestQueryResult.data || [], CHAIN_ETHEREUM); const fantomBlock = getBlockByChain(latestQueryResult.data || [], CHAIN_FANTOM); const polygonBlock = getBlockByChain(latestQueryResult.data || [], CHAIN_POLYGON); + const baseBlock = getBlockByChain(latestQueryResult.data || [], CHAIN_BASE); - if (!arbitrumBlock || !ethereumBlock || !fantomBlock || !polygonBlock) { - throw new UpstreamSubgraphError({ message: `${FUNC}: Could not find earliest tokenRecord block for each chain. Arbitrum: ${arbitrumBlock}, Ethereum: ${ethereumBlock}, Fantom: ${fantomBlock}, Polygon: ${polygonBlock}` }); + if (!arbitrumBlock || !ethereumBlock || !fantomBlock || !polygonBlock || !baseBlock) { + throw new UpstreamSubgraphError({ message: `${FUNC}: Could not find earliest tokenRecord block for each chain. Arbitrum: ${arbitrumBlock}, Ethereum: ${ethereumBlock}, Fantom: ${fantomBlock}, Polygon: ${polygonBlock}, Base: ${baseBlock}` }); } const input = { @@ -48,6 +49,7 @@ export default createOperation.query({ ethereumBlock, fantomBlock, polygonBlock, + baseBlock, }; const protocolMetricsQueryResult = await ctx.operations.query({ diff --git a/apps/server/.wundergraph/operations/latest/metrics.ts b/apps/server/.wundergraph/operations/latest/metrics.ts index f497823..68e7bc7 100644 --- a/apps/server/.wundergraph/operations/latest/metrics.ts +++ b/apps/server/.wundergraph/operations/latest/metrics.ts @@ -1,7 +1,7 @@ import { createOperation, z } from '../../generated/wundergraph.factory'; import { Metric, getMetricObject } from '../../metricHelper'; import { getBlockByChain } from '../../tokenRecordHelper'; -import { CHAIN_ARBITRUM, CHAIN_ETHEREUM, CHAIN_FANTOM, CHAIN_POLYGON } from '../../constants'; +import { CHAIN_ARBITRUM, CHAIN_BASE, CHAIN_ETHEREUM, CHAIN_FANTOM, CHAIN_POLYGON } from '../../constants'; import { getCacheKey, getCachedRecord, setCachedRecord } from '../../cacheHelper'; import { UpstreamSubgraphError } from '../../upstreamSubgraphError'; @@ -38,9 +38,10 @@ export default createOperation.query({ const ethereumBlock = getBlockByChain(latestQueryResult.data || [], CHAIN_ETHEREUM); const fantomBlock = getBlockByChain(latestQueryResult.data || [], CHAIN_FANTOM); const polygonBlock = getBlockByChain(latestQueryResult.data || [], CHAIN_POLYGON); + const baseBlock = getBlockByChain(latestQueryResult.data || [], CHAIN_BASE); - if (!arbitrumBlock || !ethereumBlock || !fantomBlock || !polygonBlock) { - throw new UpstreamSubgraphError({ message: `${FUNC}: Could not find latest tokenRecord block for each chain. Arbitrum: ${arbitrumBlock}, Ethereum: ${ethereumBlock}, Fantom: ${fantomBlock}, Polygon: ${polygonBlock}` }); + if (!arbitrumBlock || !ethereumBlock || !fantomBlock || !polygonBlock || !baseBlock) { + throw new UpstreamSubgraphError({ message: `${FUNC}: Could not find latest tokenRecord block for each chain. Arbitrum: ${arbitrumBlock}, Ethereum: ${ethereumBlock}, Fantom: ${fantomBlock}, Polygon: ${polygonBlock}, Base: ${baseBlock}` }); } const input = { @@ -48,6 +49,7 @@ export default createOperation.query({ ethereumBlock, fantomBlock, polygonBlock, + baseBlock, }; const protocolMetricsQueryResult = await ctx.operations.query({ diff --git a/apps/server/.wundergraph/operations/raw/internal/protocolMetrics.graphql b/apps/server/.wundergraph/operations/raw/internal/protocolMetrics.graphql index db3002e..a826e58 100644 --- a/apps/server/.wundergraph/operations/raw/internal/protocolMetrics.graphql +++ b/apps/server/.wundergraph/operations/raw/internal/protocolMetrics.graphql @@ -11,4 +11,7 @@ query ProtocolMetrics($pageSize: Int! = 1000, $startDate: String!, $endDate: Str treasuryPolygon_protocolMetrics(first: $pageSize, orderBy: date, orderDirection: desc, where: { date_gte: $startDate, date_lt: $endDate }) { ...Fragment_ProtocolMetricPolygon } + treasuryBase_protocolMetrics(first: $pageSize, orderBy: date, orderDirection: desc, where: { date_gte: $startDate, date_lt: $endDate }) { + ...Fragment_ProtocolMetricBase + } } \ No newline at end of file diff --git a/apps/server/.wundergraph/operations/raw/internal/protocolMetricsAtBlock.graphql b/apps/server/.wundergraph/operations/raw/internal/protocolMetricsAtBlock.graphql index 802143d..d7e0f59 100644 --- a/apps/server/.wundergraph/operations/raw/internal/protocolMetricsAtBlock.graphql +++ b/apps/server/.wundergraph/operations/raw/internal/protocolMetricsAtBlock.graphql @@ -1,4 +1,4 @@ -query ProtocolMetrics($pageSize: Int! = 1000, $arbitrumBlock: BigInt!, $ethereumBlock: BigInt!, $fantomBlock: BigInt!, $polygonBlock: BigInt!) { +query ProtocolMetrics($pageSize: Int! = 1000, $arbitrumBlock: BigInt!, $ethereumBlock: BigInt!, $fantomBlock: BigInt!, $polygonBlock: BigInt!, $baseBlock: BigInt!) { treasuryArbitrum_protocolMetrics(first: $pageSize, orderBy: date, orderDirection: desc, where: { block: $arbitrumBlock }) { ...Fragment_ProtocolMetricArbitrum } @@ -11,4 +11,7 @@ query ProtocolMetrics($pageSize: Int! = 1000, $arbitrumBlock: BigInt!, $ethereum treasuryPolygon_protocolMetrics(first: $pageSize, orderBy: date, orderDirection: desc, where: { block: $polygonBlock }) { ...Fragment_ProtocolMetricPolygon } + treasuryBase_protocolMetrics(first: $pageSize, orderBy: date, orderDirection: desc, where: { block: $baseBlock }) { + ...Fragment_ProtocolMetricBase + } } \ No newline at end of file diff --git a/apps/server/.wundergraph/operations/raw/internal/protocolMetricsEarliest.graphql b/apps/server/.wundergraph/operations/raw/internal/protocolMetricsEarliest.graphql index a340ce5..e4333e6 100644 --- a/apps/server/.wundergraph/operations/raw/internal/protocolMetricsEarliest.graphql +++ b/apps/server/.wundergraph/operations/raw/internal/protocolMetricsEarliest.graphql @@ -11,4 +11,7 @@ query ProtocolMetricsEarliest { treasuryPolygon_protocolMetrics(orderBy: block, orderDirection: asc, first: 1) { ...Fragment_ProtocolMetricPolygon } + treasuryBase_protocolMetrics(orderBy: block, orderDirection: asc, first: 1) { + ...Fragment_ProtocolMetricBase + } } \ No newline at end of file diff --git a/apps/server/.wundergraph/operations/raw/internal/protocolMetricsLatest.graphql b/apps/server/.wundergraph/operations/raw/internal/protocolMetricsLatest.graphql index 703a18b..50f1b90 100644 --- a/apps/server/.wundergraph/operations/raw/internal/protocolMetricsLatest.graphql +++ b/apps/server/.wundergraph/operations/raw/internal/protocolMetricsLatest.graphql @@ -11,4 +11,7 @@ query ProtocolMetricsLatest { treasuryPolygon_protocolMetrics(orderBy: block, orderDirection: desc, first: 1) { ...Fragment_ProtocolMetricPolygon } + treasuryBase_protocolMetrics(orderBy: block, orderDirection: desc, first: 1) { + ...Fragment_ProtocolMetricBase + } } \ No newline at end of file diff --git a/apps/server/.wundergraph/operations/tokenRecords.graphql b/apps/server/.wundergraph/operations/tokenRecords.graphql index 61e1a47..c260068 100644 --- a/apps/server/.wundergraph/operations/tokenRecords.graphql +++ b/apps/server/.wundergraph/operations/tokenRecords.graphql @@ -11,4 +11,7 @@ query TokenRecords($pageSize: Int! = 1000, $startDate: String!, $endDate: String treasuryPolygon_tokenRecords(first: $pageSize, orderBy: date, orderDirection: desc, where: { date_gte: $startDate, date_lt: $endDate }) { ...Fragment_TokenRecordPolygon } + treasuryBase_tokenRecords(first: $pageSize, orderBy: date, orderDirection: desc, where: { date_gte: $startDate, date_lt: $endDate }) { + ...Fragment_TokenRecordBase + } } diff --git a/apps/server/.wundergraph/operations/tokenRecordsAtBlock.graphql b/apps/server/.wundergraph/operations/tokenRecordsAtBlock.graphql index 784996d..7401a6d 100644 --- a/apps/server/.wundergraph/operations/tokenRecordsAtBlock.graphql +++ b/apps/server/.wundergraph/operations/tokenRecordsAtBlock.graphql @@ -1,4 +1,4 @@ -query TokenRecords($pageSize: Int! = 1000, $arbitrumBlock: BigInt!, $ethereumBlock: BigInt!, $fantomBlock: BigInt!, $polygonBlock: BigInt!) { +query TokenRecords($pageSize: Int! = 1000, $arbitrumBlock: BigInt!, $ethereumBlock: BigInt!, $fantomBlock: BigInt!, $polygonBlock: BigInt!, $baseBlock: BigInt!) { treasuryArbitrum_tokenRecords(first: $pageSize, orderBy: date, orderDirection: desc, where: { block: $arbitrumBlock }) { ...Fragment_TokenRecordArbitrum } @@ -11,4 +11,7 @@ query TokenRecords($pageSize: Int! = 1000, $arbitrumBlock: BigInt!, $ethereumBlo treasuryPolygon_tokenRecords(first: $pageSize, orderBy: date, orderDirection: desc, where: { block: $polygonBlock }) { ...Fragment_TokenRecordPolygon } + treasuryBase_tokenRecords(first: $pageSize, orderBy: date, orderDirection: desc, where: { block: $baseBlock }) { + ...Fragment_TokenRecordBase + } } diff --git a/apps/server/.wundergraph/operations/tokenRecordsEarliest.graphql b/apps/server/.wundergraph/operations/tokenRecordsEarliest.graphql index 4e4d95a..c9acd3e 100644 --- a/apps/server/.wundergraph/operations/tokenRecordsEarliest.graphql +++ b/apps/server/.wundergraph/operations/tokenRecordsEarliest.graphql @@ -11,4 +11,7 @@ query TokenRecordsEarliest { treasuryPolygon_tokenRecords(orderBy: block, orderDirection: asc, first: 1) { ...Fragment_TokenRecordPolygon } + treasuryBase_tokenRecords(orderBy: block, orderDirection: asc, first: 1) { + ...Fragment_TokenRecordBase + } } diff --git a/apps/server/.wundergraph/operations/tokenRecordsLatest.graphql b/apps/server/.wundergraph/operations/tokenRecordsLatest.graphql index 35bf374..ee30d9b 100644 --- a/apps/server/.wundergraph/operations/tokenRecordsLatest.graphql +++ b/apps/server/.wundergraph/operations/tokenRecordsLatest.graphql @@ -11,4 +11,7 @@ query TokenRecordsLatest { treasuryPolygon_tokenRecords(orderBy: block, orderDirection: desc, first: 1) { ...Fragment_TokenRecordPolygon } + treasuryBase_tokenRecords(orderBy: block, orderDirection: desc, first: 1) { + ...Fragment_TokenRecordBase + } } diff --git a/apps/server/.wundergraph/operations/tokenSupplies.graphql b/apps/server/.wundergraph/operations/tokenSupplies.graphql index fd76abf..901164d 100644 --- a/apps/server/.wundergraph/operations/tokenSupplies.graphql +++ b/apps/server/.wundergraph/operations/tokenSupplies.graphql @@ -11,4 +11,8 @@ query TokenSupplies($pageSize: Int! = 1000, $startDate: String!, $endDate: Strin treasuryPolygon_tokenSupplies(first: $pageSize, orderBy: date, orderDirection: desc, where: { date_gte: $startDate, date_lt: $endDate }) { ...Fragment_TokenSupplyPolygon } + treasuryBase_tokenSupplies(first: $pageSize, orderBy: date, orderDirection: desc, where: { date_gte: $startDate, date_lt: $endDate }) + { + ...Fragment_TokenSupplyBase + } } diff --git a/apps/server/.wundergraph/operations/tokenSuppliesAtBlock.graphql b/apps/server/.wundergraph/operations/tokenSuppliesAtBlock.graphql index 39be43c..2ef0187 100644 --- a/apps/server/.wundergraph/operations/tokenSuppliesAtBlock.graphql +++ b/apps/server/.wundergraph/operations/tokenSuppliesAtBlock.graphql @@ -1,4 +1,4 @@ -query TokenSupplies($pageSize: Int! = 1000, $arbitrumBlock: BigInt!, $ethereumBlock: BigInt!, $fantomBlock: BigInt!, $polygonBlock: BigInt!) { +query TokenSupplies($pageSize: Int! = 1000, $arbitrumBlock: BigInt!, $ethereumBlock: BigInt!, $fantomBlock: BigInt!, $polygonBlock: BigInt!, $baseBlock: BigInt!) { treasuryArbitrum_tokenSupplies(first: $pageSize, orderBy: date, orderDirection: desc, where: { block: $arbitrumBlock }) { ...Fragment_TokenSupplyArbitrum } @@ -11,4 +11,7 @@ query TokenSupplies($pageSize: Int! = 1000, $arbitrumBlock: BigInt!, $ethereumBl treasuryPolygon_tokenSupplies(first: $pageSize, orderBy: date, orderDirection: desc, where: { block: $polygonBlock }) { ...Fragment_TokenSupplyPolygon } + treasuryBase_tokenSupplies(first: $pageSize, orderBy: date, orderDirection: desc, where: { block: $baseBlock }) { + ...Fragment_TokenSupplyBase + } } diff --git a/apps/server/.wundergraph/operations/tokenSuppliesEarliest.graphql b/apps/server/.wundergraph/operations/tokenSuppliesEarliest.graphql index 94ef723..86d2cd5 100644 --- a/apps/server/.wundergraph/operations/tokenSuppliesEarliest.graphql +++ b/apps/server/.wundergraph/operations/tokenSuppliesEarliest.graphql @@ -11,4 +11,7 @@ query TokenSuppliesEarliest { treasuryPolygon_tokenSupplies(orderBy: block, orderDirection: asc, first: 1) { ...Fragment_TokenSupplyPolygon } + treasuryBase_tokenSupplies(orderBy: block, orderDirection: asc, first: 1) { + ...Fragment_TokenSupplyBase + } } diff --git a/apps/server/.wundergraph/operations/tokenSuppliesLatest.graphql b/apps/server/.wundergraph/operations/tokenSuppliesLatest.graphql index e9c7d6a..cbc3438 100644 --- a/apps/server/.wundergraph/operations/tokenSuppliesLatest.graphql +++ b/apps/server/.wundergraph/operations/tokenSuppliesLatest.graphql @@ -11,4 +11,7 @@ query TokenSuppliesLatest { treasuryPolygon_tokenSupplies(orderBy: block, orderDirection: desc, first: 1) { ...Fragment_TokenSupplyPolygon } + treasuryBase_tokenSupplies(orderBy: block, orderDirection: desc, first: 1) { + ...Fragment_TokenSupplyBase + } } diff --git a/apps/server/.wundergraph/protocolMetricHelper.ts b/apps/server/.wundergraph/protocolMetricHelper.ts index de2bfc8..28087d0 100644 --- a/apps/server/.wundergraph/protocolMetricHelper.ts +++ b/apps/server/.wundergraph/protocolMetricHelper.ts @@ -1,5 +1,5 @@ import { RequestLogger } from "@wundergraph/sdk/server"; -import { CHAIN_ARBITRUM, CHAIN_ETHEREUM, CHAIN_FANTOM, CHAIN_POLYGON } from "./constants"; +import { CHAIN_ARBITRUM, CHAIN_BASE, CHAIN_ETHEREUM, CHAIN_FANTOM, CHAIN_POLYGON } from "./constants"; import { RawInternalProtocolMetricsResponseData } from "./generated/models"; import { parseNumber } from "./numberHelper"; @@ -63,6 +63,7 @@ export const flattenRecords = (records: RawInternalProtocolMetricsResponseData, [CHAIN_ETHEREUM]: records.treasuryEthereum_protocolMetrics, [CHAIN_FANTOM]: records.treasuryFantom_protocolMetrics, [CHAIN_POLYGON]: records.treasuryPolygon_protocolMetrics, + [CHAIN_BASE]: records.treasuryBase_protocolMetrics, }; for (const [key, value] of Object.entries(mapping)) { diff --git a/apps/server/.wundergraph/tokenRecordHelper.ts b/apps/server/.wundergraph/tokenRecordHelper.ts index 47f4a90..02cdaad 100644 --- a/apps/server/.wundergraph/tokenRecordHelper.ts +++ b/apps/server/.wundergraph/tokenRecordHelper.ts @@ -1,5 +1,5 @@ import { RequestLogger } from "@wundergraph/sdk/server"; -import { CHAIN_ARBITRUM, CHAIN_ETHEREUM, CHAIN_FANTOM, CHAIN_POLYGON } from "./constants"; +import { CHAIN_ARBITRUM, CHAIN_BASE, CHAIN_ETHEREUM, CHAIN_FANTOM, CHAIN_POLYGON } from "./constants"; import { TokenRecordsLatestResponseData } from "./generated/models"; import { parseNumber } from "./numberHelper"; @@ -13,9 +13,9 @@ type TokenRecordByDate = { /** * This function determines the latest block for each day and returns only the records with that block. - * - * @param records - * @returns + * + * @param records + * @returns */ export const filterLatestBlockByDay = (records: TokenRecord[]): TokenRecord[] => { const FUNC = `tokenRecord/filterLatestBlockByDay`; @@ -63,8 +63,8 @@ export const sortRecordsDescending = (records: TokenRecord[]): TokenRecord[] => /** * Filters `records` to only include records with a complete set of cross-chain data. - * - * @param records + * + * @param records */ export const filterCompleteRecords = (records: TokenRecordsLatestResponseData, log: RequestLogger): TokenRecordsLatestResponseData => { const FUNC = `tokenRecord/filterCompleteRecords`; @@ -77,6 +77,7 @@ export const filterCompleteRecords = (records: TokenRecordsLatestResponseData, l treasuryEthereum_tokenRecords: [], treasuryFantom_tokenRecords: [], treasuryPolygon_tokenRecords: [], + treasuryBase_tokenRecords: [], }; } @@ -91,6 +92,7 @@ export const filterCompleteRecords = (records: TokenRecordsLatestResponseData, l treasuryEthereum_tokenRecords: records.treasuryEthereum_tokenRecords.filter((record) => new Date(record.date) <= earliestDate), treasuryFantom_tokenRecords: records.treasuryFantom_tokenRecords.filter((record) => new Date(record.date) <= earliestDate), treasuryPolygon_tokenRecords: records.treasuryPolygon_tokenRecords.filter((record) => new Date(record.date) <= earliestDate), + treasuryBase_tokenRecords: records.treasuryBase_tokenRecords.filter((record) => new Date(record.date) <= earliestDate), }; log.info(`${FUNC}: Filtered records up to latest consistent date: ${earliestDate.toISOString()}`); @@ -106,6 +108,7 @@ export const flattenRecords = (records: TokenRecordsLatestResponseData, latestBl [CHAIN_ETHEREUM]: records.treasuryEthereum_tokenRecords, [CHAIN_FANTOM]: records.treasuryFantom_tokenRecords, [CHAIN_POLYGON]: records.treasuryPolygon_tokenRecords, + [CHAIN_BASE]: records.treasuryBase_tokenRecords, }; for (const [key, value] of Object.entries(mapping)) { @@ -132,16 +135,16 @@ export const getBlockByChain = (records: TokenRecord[], chain: string): number | /** * Determines whether the data across chains is complete. - * + * * It determines this by checking if the date of the records across chains is the same. - * + * * Assumptions: * - The data is sorted in descending order and for the same day * - Ethereum and Arbitrum have the bulk of assets, so we only check those two chains - * - * @param arbitrumRecords - * @param ethereumRecords - * @returns + * + * @param arbitrumRecords + * @param ethereumRecords + * @returns */ export const isCrossChainRecordDataComplete = (arbitrumRecords: TokenRecord[], ethereumRecords: TokenRecord[]): boolean => { if (!arbitrumRecords.length || !ethereumRecords.length) { diff --git a/apps/server/.wundergraph/tokenSupplyHelper.ts b/apps/server/.wundergraph/tokenSupplyHelper.ts index a7e876b..b57e88f 100644 --- a/apps/server/.wundergraph/tokenSupplyHelper.ts +++ b/apps/server/.wundergraph/tokenSupplyHelper.ts @@ -1,5 +1,5 @@ import { RequestLogger } from "@wundergraph/sdk/server"; -import { CHAIN_ARBITRUM, CHAIN_ETHEREUM, CHAIN_FANTOM, CHAIN_POLYGON } from "./constants"; +import { CHAIN_ARBITRUM, CHAIN_BASE, CHAIN_ETHEREUM, CHAIN_FANTOM, CHAIN_POLYGON } from "./constants"; import { TokenSuppliesLatestResponseData } from "./generated/models"; import { parseNumber } from "./numberHelper"; @@ -62,8 +62,8 @@ export const setBlockchainProperty = (records: TokenSupply[], blockchain: string /** * Filters `records` to only include records with a complete set of cross-chain data. - * - * @param records + * + * @param records */ export const filterCompleteRecords = (records: TokenSuppliesLatestResponseData, log: RequestLogger): TokenSuppliesLatestResponseData => { const FUNC = `tokenSupply/filterCompleteRecords`; @@ -76,6 +76,7 @@ export const filterCompleteRecords = (records: TokenSuppliesLatestResponseData, treasuryEthereum_tokenSupplies: [], treasuryFantom_tokenSupplies: [], treasuryPolygon_tokenSupplies: [], + treasuryBase_tokenSupplies: [], }; } @@ -90,6 +91,7 @@ export const filterCompleteRecords = (records: TokenSuppliesLatestResponseData, treasuryEthereum_tokenSupplies: records.treasuryEthereum_tokenSupplies.filter((record) => new Date(record.date) <= earliestDate), treasuryFantom_tokenSupplies: records.treasuryFantom_tokenSupplies.filter((record) => new Date(record.date) <= earliestDate), treasuryPolygon_tokenSupplies: records.treasuryPolygon_tokenSupplies.filter((record) => new Date(record.date) <= earliestDate), + treasuryBase_tokenSupplies: records.treasuryBase_tokenSupplies.filter((record) => new Date(record.date) <= earliestDate), }; log.info(`${FUNC}: Filtered records up to latest consistent date: ${earliestDate.toISOString()}`); @@ -105,6 +107,7 @@ export const flattenRecords = (records: TokenSuppliesLatestResponseData, blockch [CHAIN_ETHEREUM]: records.treasuryEthereum_tokenSupplies, [CHAIN_FANTOM]: records.treasuryFantom_tokenSupplies, [CHAIN_POLYGON]: records.treasuryPolygon_tokenSupplies, + [CHAIN_BASE]: records.treasuryBase_tokenSupplies, }; for (const [key, value] of Object.entries(mapping)) { diff --git a/apps/server/.wundergraph/wundergraph.config.ts b/apps/server/.wundergraph/wundergraph.config.ts index b7e003d..556961c 100644 --- a/apps/server/.wundergraph/wundergraph.config.ts +++ b/apps/server/.wundergraph/wundergraph.config.ts @@ -40,7 +40,7 @@ const treasuryArbitrum = introspect.graphql({ const treasuryFantom = introspect.graphql({ apiNamespace: "treasuryFantom", - url: "https://gateway-arbitrum.network.thegraph.com/api/[api-key]/subgraphs/id/3qSJTWdWJETFzht814HVV9rVafwRLQp3k9mZhCF39bYd", // 0.0.6 + url: resolveSubgraphUrl("https://gateway-arbitrum.network.thegraph.com/api/[api-key]/deployments/id/QmSBMNhnzbe4c4cwznLUsFkE4H5XZfiVqLHnNZYA48EPwy"), // 0.0.6 schemaExtension: schemaExtension, }); @@ -50,9 +50,16 @@ const treasuryPolygon = introspect.graphql({ schemaExtension: schemaExtension, }); +// TODO shift to production URL +const treasuryBase = introspect.graphql({ + apiNamespace: "treasuryBase", + url: resolveSubgraphUrl("https://api.studio.thegraph.com/query/46563/protocol-metrics-base/version/latest"), // 0.0.2 + schemaExtension: schemaExtension, +}); + // configureWunderGraph emits the configuration configureWunderGraphApplication({ - apis: [treasuryArbitrum, treasuryEthereum, treasuryFantom, treasuryPolygon], + apis: [treasuryArbitrum, treasuryEthereum, treasuryFantom, treasuryPolygon, treasuryBase], server, operations, codeGenerators: [ From 7eb5e9b3c67ae556923fc8b8a88457e2eb0cbce6 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Thu, 6 Jun 2024 20:16:01 +0400 Subject: [PATCH 5/9] Bump Fantom version --- apps/server/.wundergraph/wundergraph.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/server/.wundergraph/wundergraph.config.ts b/apps/server/.wundergraph/wundergraph.config.ts index 556961c..2ba02d0 100644 --- a/apps/server/.wundergraph/wundergraph.config.ts +++ b/apps/server/.wundergraph/wundergraph.config.ts @@ -40,7 +40,7 @@ const treasuryArbitrum = introspect.graphql({ const treasuryFantom = introspect.graphql({ apiNamespace: "treasuryFantom", - url: resolveSubgraphUrl("https://gateway-arbitrum.network.thegraph.com/api/[api-key]/deployments/id/QmSBMNhnzbe4c4cwznLUsFkE4H5XZfiVqLHnNZYA48EPwy"), // 0.0.6 + url: resolveSubgraphUrl("https://gateway-arbitrum.network.thegraph.com/api/[api-key]/deployments/id/QmNUJtrE5Hiwj5eBeF5gSubY2vhuMdjaZnZsaq6vVY2aba"), // 1.0.4 schemaExtension: schemaExtension, }); From 4e919406622134ba1a84433b5f0eedd44da9249a Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Thu, 6 Jun 2024 20:17:57 +0400 Subject: [PATCH 6/9] Revert "Bump Fantom version" This reverts commit 7eb5e9b3c67ae556923fc8b8a88457e2eb0cbce6. --- apps/server/.wundergraph/wundergraph.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/server/.wundergraph/wundergraph.config.ts b/apps/server/.wundergraph/wundergraph.config.ts index 2ba02d0..556961c 100644 --- a/apps/server/.wundergraph/wundergraph.config.ts +++ b/apps/server/.wundergraph/wundergraph.config.ts @@ -40,7 +40,7 @@ const treasuryArbitrum = introspect.graphql({ const treasuryFantom = introspect.graphql({ apiNamespace: "treasuryFantom", - url: resolveSubgraphUrl("https://gateway-arbitrum.network.thegraph.com/api/[api-key]/deployments/id/QmNUJtrE5Hiwj5eBeF5gSubY2vhuMdjaZnZsaq6vVY2aba"), // 1.0.4 + url: resolveSubgraphUrl("https://gateway-arbitrum.network.thegraph.com/api/[api-key]/deployments/id/QmSBMNhnzbe4c4cwznLUsFkE4H5XZfiVqLHnNZYA48EPwy"), // 0.0.6 schemaExtension: schemaExtension, }); From 6fc90468f06391cbe037237f27a527f58bb3cbf4 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 7 Jun 2024 17:51:21 +0400 Subject: [PATCH 7/9] Update Base and Fantom subgraph URLs --- apps/server/.wundergraph/wundergraph.config.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/server/.wundergraph/wundergraph.config.ts b/apps/server/.wundergraph/wundergraph.config.ts index 556961c..9f6841d 100644 --- a/apps/server/.wundergraph/wundergraph.config.ts +++ b/apps/server/.wundergraph/wundergraph.config.ts @@ -40,7 +40,7 @@ const treasuryArbitrum = introspect.graphql({ const treasuryFantom = introspect.graphql({ apiNamespace: "treasuryFantom", - url: resolveSubgraphUrl("https://gateway-arbitrum.network.thegraph.com/api/[api-key]/deployments/id/QmSBMNhnzbe4c4cwznLUsFkE4H5XZfiVqLHnNZYA48EPwy"), // 0.0.6 + url: resolveSubgraphUrl("https://gateway-arbitrum.network.thegraph.com/api/[api-key]/deployments/id/QmNUJtrE5Hiwj5eBeF5gSubY2vhuMdjaZnZsaq6vVY2aba"), // 1.0.4 schemaExtension: schemaExtension, }); @@ -50,10 +50,9 @@ const treasuryPolygon = introspect.graphql({ schemaExtension: schemaExtension, }); -// TODO shift to production URL const treasuryBase = introspect.graphql({ apiNamespace: "treasuryBase", - url: resolveSubgraphUrl("https://api.studio.thegraph.com/query/46563/protocol-metrics-base/version/latest"), // 0.0.2 + url: resolveSubgraphUrl("https://gateway-arbitrum.network.thegraph.com/api/[api-key]/deployments/id/QmdqJ1zoExrs8u2T93wXSRWSx5VSKqKWTV4gCE2vszGwgt"), // 0.0.2 schemaExtension: schemaExtension, }); From 27da8754405e46720b76daaf8d98857266a210e3 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 7 Jun 2024 18:09:46 +0400 Subject: [PATCH 8/9] Add Base to metrics --- apps/server/.wundergraph/metricHelper.ts | 68 +++++++++++++++++------- 1 file changed, 49 insertions(+), 19 deletions(-) diff --git a/apps/server/.wundergraph/metricHelper.ts b/apps/server/.wundergraph/metricHelper.ts index a1645ae..14cfd61 100644 --- a/apps/server/.wundergraph/metricHelper.ts +++ b/apps/server/.wundergraph/metricHelper.ts @@ -1,5 +1,5 @@ import { RequestLogger } from "@wundergraph/sdk/server"; -import { CATEGORY_POL, CATEGORY_STABLE, CATEGORY_VOLATILE, CHAIN_ARBITRUM, CHAIN_ETHEREUM, CHAIN_FANTOM, CHAIN_POLYGON, Chains, TOKEN_SUPPLY_TYPE_BONDS_DEPOSITS, TOKEN_SUPPLY_TYPE_BONDS_PREMINTED, TOKEN_SUPPLY_TYPE_BONDS_VESTING_DEPOSITS, TOKEN_SUPPLY_TYPE_BONDS_VESTING_TOKENS, TOKEN_SUPPLY_TYPE_BOOSTED_LIQUIDITY_VAULT, TOKEN_SUPPLY_TYPE_LENDING, TOKEN_SUPPLY_TYPE_LIQUIDITY, TOKEN_SUPPLY_TYPE_OFFSET, TOKEN_SUPPLY_TYPE_TOTAL_SUPPLY, TOKEN_SUPPLY_TYPE_TREASURY, TokenSupplyCategories } from "./constants"; +import { CATEGORY_POL, CATEGORY_STABLE, CATEGORY_VOLATILE, CHAIN_ARBITRUM, CHAIN_BASE, CHAIN_ETHEREUM, CHAIN_FANTOM, CHAIN_POLYGON, Chains, TOKEN_SUPPLY_TYPE_BONDS_DEPOSITS, TOKEN_SUPPLY_TYPE_BONDS_PREMINTED, TOKEN_SUPPLY_TYPE_BONDS_VESTING_DEPOSITS, TOKEN_SUPPLY_TYPE_BONDS_VESTING_TOKENS, TOKEN_SUPPLY_TYPE_BOOSTED_LIQUIDITY_VAULT, TOKEN_SUPPLY_TYPE_LENDING, TOKEN_SUPPLY_TYPE_LIQUIDITY, TOKEN_SUPPLY_TYPE_OFFSET, TOKEN_SUPPLY_TYPE_TOTAL_SUPPLY, TOKEN_SUPPLY_TYPE_TREASURY, TokenSupplyCategories } from "./constants"; import { ProtocolMetric } from "./protocolMetricHelper"; import { TokenRecord } from "./tokenRecordHelper"; import { TokenSupply } from "./tokenSupplyHelper"; @@ -12,6 +12,7 @@ import { parseNumber } from "./numberHelper"; const OHM_ADDRESSES: string[] = [ "0x64aa3364f17a4d01c6f1751fd97c2bd3d7e7f1d5".toLowerCase(), // Mainnet "0xf0cb2dc0db5e6c66B9a70Ac27B06b878da017028".toLowerCase(), // Arbitrum + "0x060cb087a9730E13aa191f31A6d86bFF8DfcdCC0".toLowerCase(), // Base ]; const GOHM_ADDRESSES: string[] = [ @@ -168,13 +169,13 @@ const getBalancesForTypes = ( /** * Returns the sums and records for different supply types. - * + * * This will be commonly used to bootstrap the SupplyCategoryRecords object. - * - * @param records - * @param includedTypes - * @param ohmIndex - * @returns + * + * @param records + * @param includedTypes + * @param ohmIndex + * @returns */ const getTokenSupplyRecordsForTypes = ( records: TokenSupply[], @@ -221,6 +222,7 @@ const getRecordsForTypes = ( [Chains.ETHEREUM]: [...previousChainRecords[Chains.ETHEREUM], ...currentTypeRecords.filter(record => record.blockchain === CHAIN_ETHEREUM)], [Chains.FANTOM]: [...previousChainRecords[Chains.FANTOM], ...currentTypeRecords.filter(record => record.blockchain === CHAIN_FANTOM)], [Chains.POLYGON]: [...previousChainRecords[Chains.POLYGON], ...currentTypeRecords.filter(record => record.blockchain === CHAIN_POLYGON)], + [Chains.BASE]: [...previousChainRecords[Chains.BASE], ...currentTypeRecords.filter(record => record.blockchain === CHAIN_BASE)], }; return [newRecords, newChainRecords]; @@ -229,6 +231,7 @@ const getRecordsForTypes = ( [Chains.ETHEREUM]: [] as TokenSupply[], [Chains.FANTOM]: [] as TokenSupply[], [Chains.POLYGON]: [] as TokenSupply[], + [Chains.BASE]: [] as TokenSupply[], } as ChainSupplies]); // Sum to get the balance and supply balance @@ -240,6 +243,7 @@ const getRecordsForTypes = ( [Chains.ETHEREUM]: getBalancesForTypes(chainSupplies[Chains.ETHEREUM], ohmIndex)[1], [Chains.FANTOM]: getBalancesForTypes(chainSupplies[Chains.FANTOM], ohmIndex)[1], [Chains.POLYGON]: getBalancesForTypes(chainSupplies[Chains.POLYGON], ohmIndex)[1], + [Chains.BASE]: getBalancesForTypes(chainSupplies[Chains.BASE], ohmIndex)[1], } return { @@ -388,10 +392,10 @@ export const getGOhmBackedSupply = (backedSupply: number, ohmIndex: number): num /** * This function splits the TokenSupply records into categories, which makes calculating metrics * more efficient. - * - * @param records - * @param ohmIndex - * @returns + * + * @param records + * @param ohmIndex + * @returns */ const getSupplyCategories = (records: TokenSupply[], ohmIndex: number): [SupplyCategoryValues, SupplyCategoryRecords] => { const bondDeposits = getTokenSupplyRecordsForTypes(records, [TOKEN_SUPPLY_TYPE_BONDS_DEPOSITS], ohmIndex); @@ -440,11 +444,11 @@ const getSupplyCategories = (records: TokenSupply[], ohmIndex: number): [SupplyC /** * Calculates the market value or liquid backing for the given records. - * - * @param records - * @param liquidBacking - * @param categories - * @returns + * + * @param records + * @param liquidBacking + * @param categories + * @returns */ const getTreasuryAssetValue = ( records: TokenRecord[], @@ -471,12 +475,14 @@ const getTreasuryAssetValue = ( [Chains.ETHEREUM]: previousChainValues[Chains.ETHEREUM] + (currentRecord.blockchain === CHAIN_ETHEREUM ? currentValue : 0), [Chains.FANTOM]: previousChainValues[Chains.FANTOM] + (currentRecord.blockchain === CHAIN_FANTOM ? currentValue : 0), [Chains.POLYGON]: previousChainValues[Chains.POLYGON] + (currentRecord.blockchain === CHAIN_POLYGON ? currentValue : 0), + [Chains.BASE]: previousChainValues[Chains.BASE] + (currentRecord.blockchain === CHAIN_BASE ? currentValue : 0), }; const newChainRecords: ChainRecords = { [Chains.ARBITRUM]: [...previousChainRecords[Chains.ARBITRUM], ...(currentRecord.blockchain === CHAIN_ARBITRUM ? [currentRecord] : [])], [Chains.ETHEREUM]: [...previousChainRecords[Chains.ETHEREUM], ...(currentRecord.blockchain === CHAIN_ETHEREUM ? [currentRecord] : [])], [Chains.FANTOM]: [...previousChainRecords[Chains.FANTOM], ...(currentRecord.blockchain === CHAIN_FANTOM ? [currentRecord] : [])], [Chains.POLYGON]: [...previousChainRecords[Chains.POLYGON], ...(currentRecord.blockchain === CHAIN_POLYGON ? [currentRecord] : [])], + [Chains.BASE]: [...previousChainRecords[Chains.BASE], ...(currentRecord.blockchain === CHAIN_BASE ? [currentRecord] : [])], }; return [newTotalValue, newRecords, newChainValues, newChainRecords]; @@ -488,12 +494,14 @@ const getTreasuryAssetValue = ( [Chains.ETHEREUM]: 0, [Chains.FANTOM]: 0, [Chains.POLYGON]: 0, + [Chains.BASE]: 0, } as ChainValues, { [Chains.ARBITRUM]: [] as TokenRecord[], [Chains.ETHEREUM]: [] as TokenRecord[], [Chains.FANTOM]: [] as TokenRecord[], [Chains.POLYGON]: [] as TokenRecord[], + [Chains.BASE]: [] as TokenRecord[], } as ChainRecords]); return [totalValue, allRecords, chainValues, chainRecords]; @@ -501,9 +509,9 @@ const getTreasuryAssetValue = ( /** * Used to efficiently calculate the market value and liquid backing. - * - * @param records - * @returns + * + * @param records + * @returns */ const getAssetValues = ( records: TokenRecord[], @@ -570,12 +578,14 @@ export const getMetricObject = (log: RequestLogger, tokenRecords: TokenRecord[], [Chains.ETHEREUM]: 0, [Chains.FANTOM]: 0, [Chains.POLYGON]: 0, + [Chains.BASE]: 0, }, timestamps: { [Chains.ARBITRUM]: 0, [Chains.ETHEREUM]: timestamp, [Chains.FANTOM]: 0, [Chains.POLYGON]: 0, + [Chains.BASE]: 0, }, ohmIndex: 0, ohmApy: 0, @@ -585,6 +595,7 @@ export const getMetricObject = (log: RequestLogger, tokenRecords: TokenRecord[], [Chains.ETHEREUM]: 0, [Chains.FANTOM]: 0, [Chains.POLYGON]: 0, + [Chains.BASE]: 0, }, ohmCirculatingSupply: 0, ohmCirculatingSupplyComponents: { @@ -592,6 +603,7 @@ export const getMetricObject = (log: RequestLogger, tokenRecords: TokenRecord[], [Chains.ETHEREUM]: 0, [Chains.FANTOM]: 0, [Chains.POLYGON]: 0, + [Chains.BASE]: 0, }, ohmFloatingSupply: 0, ohmFloatingSupplyComponents: { @@ -599,6 +611,7 @@ export const getMetricObject = (log: RequestLogger, tokenRecords: TokenRecord[], [Chains.ETHEREUM]: 0, [Chains.FANTOM]: 0, [Chains.POLYGON]: 0, + [Chains.BASE]: 0, }, ohmBackedSupply: 0, gOhmBackedSupply: 0, @@ -607,6 +620,7 @@ export const getMetricObject = (log: RequestLogger, tokenRecords: TokenRecord[], [Chains.ETHEREUM]: 0, [Chains.FANTOM]: 0, [Chains.POLYGON]: 0, + [Chains.BASE]: 0, }, ohmSupplyCategories: { [TokenSupplyCategories.BONDS_DEPOSITS]: 0, @@ -631,6 +645,7 @@ export const getMetricObject = (log: RequestLogger, tokenRecords: TokenRecord[], [Chains.ETHEREUM]: 0, [Chains.FANTOM]: 0, [Chains.POLYGON]: 0, + [Chains.BASE]: 0, }, treasuryLiquidBacking: 0, treasuryLiquidBackingComponents: { @@ -638,6 +653,7 @@ export const getMetricObject = (log: RequestLogger, tokenRecords: TokenRecord[], [Chains.ETHEREUM]: 0, [Chains.FANTOM]: 0, [Chains.POLYGON]: 0, + [Chains.BASE]: 0, }, treasuryLiquidBackingPerOhmFloating: 0, treasuryLiquidBackingPerOhmBacked: 0, @@ -672,12 +688,14 @@ export const getMetricObject = (log: RequestLogger, tokenRecords: TokenRecord[], [Chains.ETHEREUM]: getBlock(assetValues.marketValueChainRecords.Ethereum), [Chains.FANTOM]: getBlock(assetValues.marketValueChainRecords.Fantom), [Chains.POLYGON]: getBlock(assetValues.marketValueChainRecords.Polygon), + [Chains.BASE]: getBlock(assetValues.marketValueChainRecords.Base), }, timestamps: { [Chains.ARBITRUM]: getTimestamp(assetValues.marketValueChainRecords.Arbitrum), [Chains.ETHEREUM]: getTimestamp(assetValues.marketValueChainRecords.Ethereum), [Chains.FANTOM]: getTimestamp(assetValues.marketValueChainRecords.Fantom), [Chains.POLYGON]: getTimestamp(assetValues.marketValueChainRecords.Polygon), + [Chains.BASE]: getTimestamp(assetValues.marketValueChainRecords.Base), }, ohmIndex: ohmIndex, ohmApy: ohmApy, @@ -687,6 +705,7 @@ export const getMetricObject = (log: RequestLogger, tokenRecords: TokenRecord[], [Chains.ETHEREUM]: ohmTotalSupply.chainSupplyBalances.Ethereum, [Chains.FANTOM]: ohmTotalSupply.chainSupplyBalances.Fantom, [Chains.POLYGON]: ohmTotalSupply.chainSupplyBalances.Polygon, + [Chains.BASE]: ohmTotalSupply.chainSupplyBalances.Base, }, ohmCirculatingSupply: ohmCirculatingSupply.supplyBalance, ohmCirculatingSupplyComponents: { @@ -694,6 +713,7 @@ export const getMetricObject = (log: RequestLogger, tokenRecords: TokenRecord[], [Chains.ETHEREUM]: ohmCirculatingSupply.chainSupplyBalances.Ethereum, [Chains.FANTOM]: ohmCirculatingSupply.chainSupplyBalances.Fantom, [Chains.POLYGON]: ohmCirculatingSupply.chainSupplyBalances.Polygon, + [Chains.BASE]: ohmCirculatingSupply.chainSupplyBalances.Base, }, ohmFloatingSupply: ohmFloatingSupply.supplyBalance, ohmFloatingSupplyComponents: { @@ -701,6 +721,7 @@ export const getMetricObject = (log: RequestLogger, tokenRecords: TokenRecord[], [Chains.ETHEREUM]: ohmFloatingSupply.chainSupplyBalances.Ethereum, [Chains.FANTOM]: ohmFloatingSupply.chainSupplyBalances.Fantom, [Chains.POLYGON]: ohmFloatingSupply.chainSupplyBalances.Polygon, + [Chains.BASE]: ohmFloatingSupply.chainSupplyBalances.Base, }, ohmBackedSupply: ohmBackedSupply.supplyBalance, gOhmBackedSupply: getGOhmBackedSupply(ohmBackedSupply.supplyBalance, ohmIndex), @@ -709,6 +730,7 @@ export const getMetricObject = (log: RequestLogger, tokenRecords: TokenRecord[], [Chains.ETHEREUM]: ohmBackedSupply.chainSupplyBalances.Ethereum, [Chains.FANTOM]: ohmBackedSupply.chainSupplyBalances.Fantom, [Chains.POLYGON]: ohmBackedSupply.chainSupplyBalances.Polygon, + [Chains.BASE]: ohmBackedSupply.chainSupplyBalances.Base, }, ohmSupplyCategories: supplyCategories[0], ohmPrice: ohmPrice, @@ -722,6 +744,7 @@ export const getMetricObject = (log: RequestLogger, tokenRecords: TokenRecord[], [Chains.ETHEREUM]: assetValues.marketValueChainValues.Ethereum, [Chains.FANTOM]: assetValues.marketValueChainValues.Fantom, [Chains.POLYGON]: assetValues.marketValueChainValues.Polygon, + [Chains.BASE]: assetValues.marketValueChainValues.Base, }, treasuryLiquidBacking: assetValues.liquidBacking, treasuryLiquidBackingComponents: { @@ -729,6 +752,7 @@ export const getMetricObject = (log: RequestLogger, tokenRecords: TokenRecord[], [Chains.ETHEREUM]: assetValues.liquidBackingChainValues.Ethereum, [Chains.FANTOM]: assetValues.liquidBackingChainValues.Fantom, [Chains.POLYGON]: assetValues.liquidBackingChainValues.Polygon, + [Chains.BASE]: assetValues.liquidBackingChainValues.Base, }, treasuryLiquidBackingPerOhmFloating: getLiquidBackingPerOhmFloating(assetValues.liquidBacking, ohmFloatingSupply.supplyBalance), treasuryLiquidBackingPerOhmBacked: getLiquidBackingPerOhmBacked(assetValues.liquidBacking, ohmBackedSupply.supplyBalance), @@ -740,36 +764,42 @@ export const getMetricObject = (log: RequestLogger, tokenRecords: TokenRecord[], [Chains.ETHEREUM]: ohmTotalSupply.chainRecords.Ethereum, [Chains.FANTOM]: ohmTotalSupply.chainRecords.Fantom, [Chains.POLYGON]: ohmTotalSupply.chainRecords.Polygon, + [Chains.BASE]: ohmTotalSupply.chainRecords.Base, }, ohmCirculatingSupplyRecords: { [Chains.ARBITRUM]: ohmCirculatingSupply.chainRecords.Arbitrum, [Chains.ETHEREUM]: ohmCirculatingSupply.chainRecords.Ethereum, [Chains.FANTOM]: ohmCirculatingSupply.chainRecords.Fantom, [Chains.POLYGON]: ohmCirculatingSupply.chainRecords.Polygon, + [Chains.BASE]: ohmCirculatingSupply.chainRecords.Base, }, ohmFloatingSupplyRecords: { [Chains.ARBITRUM]: ohmFloatingSupply.chainRecords.Arbitrum, [Chains.ETHEREUM]: ohmFloatingSupply.chainRecords.Ethereum, [Chains.FANTOM]: ohmFloatingSupply.chainRecords.Fantom, [Chains.POLYGON]: ohmFloatingSupply.chainRecords.Polygon, + [Chains.BASE]: ohmFloatingSupply.chainRecords.Base, }, ohmBackedSupplyRecords: { [Chains.ARBITRUM]: ohmBackedSupply.chainRecords.Arbitrum, [Chains.ETHEREUM]: ohmBackedSupply.chainRecords.Ethereum, [Chains.FANTOM]: ohmBackedSupply.chainRecords.Fantom, [Chains.POLYGON]: ohmBackedSupply.chainRecords.Polygon, + [Chains.BASE]: ohmBackedSupply.chainRecords.Base, }, treasuryMarketValueRecords: { [Chains.ARBITRUM]: assetValues.marketValueChainRecords.Arbitrum, [Chains.ETHEREUM]: assetValues.marketValueChainRecords.Ethereum, [Chains.FANTOM]: assetValues.marketValueChainRecords.Fantom, [Chains.POLYGON]: assetValues.marketValueChainRecords.Polygon, + [Chains.BASE]: assetValues.marketValueChainRecords.Base, }, treasuryLiquidBackingRecords: { [Chains.ARBITRUM]: assetValues.liquidBackingChainRecords.Arbitrum, [Chains.ETHEREUM]: assetValues.liquidBackingChainRecords.Ethereum, [Chains.FANTOM]: assetValues.liquidBackingChainRecords.Fantom, [Chains.POLYGON]: assetValues.liquidBackingChainRecords.Polygon, + [Chains.BASE]: assetValues.liquidBackingChainRecords.Base, }, } : {}, } From 70c08919077511619e462036d823fd61b96ea6f7 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Thu, 25 Jul 2024 21:26:22 +0400 Subject: [PATCH 9/9] Bump Arbitrum deployment --- apps/server/.wundergraph/wundergraph.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/server/.wundergraph/wundergraph.config.ts b/apps/server/.wundergraph/wundergraph.config.ts index 9f6841d..75f8466 100644 --- a/apps/server/.wundergraph/wundergraph.config.ts +++ b/apps/server/.wundergraph/wundergraph.config.ts @@ -34,7 +34,7 @@ const treasuryEthereum = introspect.graphql({ const treasuryArbitrum = introspect.graphql({ apiNamespace: "treasuryArbitrum", - url: resolveSubgraphUrl("https://gateway-arbitrum.network.thegraph.com/api/[api-key]/deployments/id/QmRf3fo7tVsXsj9cQZSgT3Y2R67Hv41T1Ph559oQAmTLe1"), // 1.6.4 + url: resolveSubgraphUrl("https://gateway-arbitrum.network.thegraph.com/api/[api-key]/deployments/id/QmNQfMN2GjnGYx2mGo92gAc7z47fMbTMRR9M1gGEUjLZHX"), // 1.7.9 schemaExtension: schemaExtension, });