From 295b385a6a11de05d1ccd2776721909c54e65c68 Mon Sep 17 00:00:00 2001 From: 0xgnek <0xgnek@gmail.com> Date: Tue, 17 Sep 2024 05:56:42 +0000 Subject: [PATCH] fix version of univ2DimensionAdapter --- fees/babydogeswap.ts | 1 + fees/biswap.ts | 3 ++- fees/elk.ts | 1 + fees/ferro.ts | 1 + fees/honeyswap.ts | 1 + fees/mimo.ts | 2 ++ fees/mojitoswap.ts | 1 + fees/pangolin.ts | 3 ++- fees/vvs-finance.ts | 1 + fees/wigoswap.ts | 1 + helpers/getUniSubgraph/index.ts | 12 ++++++------ protocols/alita-finance/index.ts | 1 + 12 files changed, 20 insertions(+), 8 deletions(-) diff --git a/fees/babydogeswap.ts b/fees/babydogeswap.ts index 0ead71e4c5..6dbb935de0 100644 --- a/fees/babydogeswap.ts +++ b/fees/babydogeswap.ts @@ -34,5 +34,6 @@ const adapters = univ2DimensionAdapter({ } }); + adapters.adapter.bsc.start = 1661780137; export default adapters; diff --git a/fees/biswap.ts b/fees/biswap.ts index 9203e1f8bf..39a85e9f6b 100644 --- a/fees/biswap.ts +++ b/fees/biswap.ts @@ -31,4 +31,5 @@ const adapters = univ2DimensionAdapter({ } }); -export default adapters; \ No newline at end of file + +export default adapters; diff --git a/fees/elk.ts b/fees/elk.ts index 124022095b..9c04ac9722 100644 --- a/fees/elk.ts +++ b/fees/elk.ts @@ -63,4 +63,5 @@ adapter.adapter.optimism.start = 1651542817; // adapter.adapter.iotex.start = 1639792417; // adapter.adapter.telos.start = 1648684800; + export default adapter; diff --git a/fees/ferro.ts b/fees/ferro.ts index 0b8557095e..7c0e16e84c 100644 --- a/fees/ferro.ts +++ b/fees/ferro.ts @@ -25,5 +25,6 @@ const adapters = univ2DimensionAdapter({ } }, { }); + adapters.adapter.cronos.start = 1661731973; export default adapters; diff --git a/fees/honeyswap.ts b/fees/honeyswap.ts index b2fd033ef1..5a3a9f0f41 100644 --- a/fees/honeyswap.ts +++ b/fees/honeyswap.ts @@ -34,4 +34,5 @@ const adapters = univ2DimensionAdapter({ adapters.adapter.polygon.start = 1622173831; adapters.adapter.xdai.start = 1599191431; + export default adapters; diff --git a/fees/mimo.ts b/fees/mimo.ts index dc090d8edd..fd2f3f7eda 100644 --- a/fees/mimo.ts +++ b/fees/mimo.ts @@ -35,4 +35,6 @@ const adapter = univ2DimensionAdapter({ }); + + export default adapter; diff --git a/fees/mojitoswap.ts b/fees/mojitoswap.ts index c1327f1a06..ba557f54b2 100644 --- a/fees/mojitoswap.ts +++ b/fees/mojitoswap.ts @@ -29,4 +29,5 @@ const adapter = univ2DimensionAdapter({ adapter.adapter.kcc.start = 1634200191; + export default adapter diff --git a/fees/pangolin.ts b/fees/pangolin.ts index 769333f713..f433eef1f9 100644 --- a/fees/pangolin.ts +++ b/fees/pangolin.ts @@ -32,4 +32,5 @@ const adapter = univ2DimensionAdapter({ } }); -export default adapter; \ No newline at end of file + +export default adapter; diff --git a/fees/vvs-finance.ts b/fees/vvs-finance.ts index 76ea751a13..96409080ab 100644 --- a/fees/vvs-finance.ts +++ b/fees/vvs-finance.ts @@ -23,4 +23,5 @@ const adapters = univ2DimensionAdapter({ }, { }); adapters.adapter.cronos.start = 1632035122; + export default adapters; diff --git a/fees/wigoswap.ts b/fees/wigoswap.ts index 557a55c46b..8a28536226 100644 --- a/fees/wigoswap.ts +++ b/fees/wigoswap.ts @@ -24,4 +24,5 @@ const adapters = univ2DimensionAdapter({ }, { }); adapters.adapter.fantom.start = 1642982400; + export default adapters; diff --git a/helpers/getUniSubgraph/index.ts b/helpers/getUniSubgraph/index.ts index ad943c289e..19cbfa1086 100644 --- a/helpers/getUniSubgraph/index.ts +++ b/helpers/getUniSubgraph/index.ts @@ -33,7 +33,7 @@ interface IGetChainVolumeParams { factory?: string, field?: string, blockGraphType?: string - filterParams?: IGetChainVolumeFilterParams[], + filterParams?: IGetChainVolumeFilterParams[], }, dailyVolume?: { factory?: string, @@ -137,7 +137,7 @@ function getGraphDimensions({ } // Queries const totalVolumeQuery = graphFieldsTotalVolume.filterParams - ? gql`query get_total_volume(${graphFieldsTotalVolume.filterParams.map(item => `$${item.name}: ${item.type}`).join(', ')}) { + ? gql`query get_total_volume(${graphFieldsTotalVolume.filterParams.map(item => `$${item.name}: ${item.type}`).join(', ')}) { ${graphFieldsTotalVolume.factory}( where: {${graphFieldsTotalVolume.filterParams.map(item => `${item.name}: $${item.name}`).join(', ')}} ) { @@ -385,17 +385,17 @@ function getGraphDimensions2({ if (totalVolume === undefined || feesPercent?.Fees === undefined) console.error(`Unable to get total fees on ${chain} from graph.`) }); - const totalFees = graphResTotalFees?.[graphFieldsTotalFees.factory]?.reduce((total: number, factory: any) => total + Number(factory[graphFieldsTotalFees.field]), 0) + const totalFees = graphResTotalFees?.[graphFieldsTotalFees.factory]?.reduce((total: number, factory: any) => total + Number(factory[graphFieldsTotalFees.field]), 0) // PREV TOTAL FEES const graphResPrevTotalFees = await request(graphUrls[chain], totalFeesQuery, { block: startBlock }, graphRequestHeaders?.[chain]).catch(_e => { if (totalVolume === undefined || feesPercent?.Fees === undefined) console.error(`Unable to get total fees on ${chain} from graph.`) }); - const prevTotalFees = graphResPrevTotalFees?.[graphFieldsTotalFees.factory]?.reduce((total: number, factory: any) => total + Number(factory[graphFieldsTotalFees.field]), 0) + const prevTotalFees = graphResPrevTotalFees?.[graphFieldsTotalFees.factory]?.reduce((total: number, factory: any) => total + Number(factory[graphFieldsTotalFees.field]), 0) const dailyFees = (totalFees == undefined && prevTotalFees == undefined) ? undefined : totalFees - prevTotalFees - + // ts-node --transpile-only cli/testAdapter.ts protocols uniswap let response: FetchResultGeneric = { timestamp: endTimestamp, @@ -443,7 +443,7 @@ function univ2DimensionAdapter(params: IGetChainVolumeParams, meta: BaseAdapter[ }, }; }, {} as BaseAdapter), - version: 2 + version: 1 }; return adapter; diff --git a/protocols/alita-finance/index.ts b/protocols/alita-finance/index.ts index f9711cf497..16b2ff8cfa 100644 --- a/protocols/alita-finance/index.ts +++ b/protocols/alita-finance/index.ts @@ -25,5 +25,6 @@ const adapter = univ2DimensionAdapter({ } }); + adapter.adapter.bsc.start = 1629947542; export default adapter;