Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix version of univ2DimensionAdapter #1917

Merged
merged 1 commit into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions fees/babydogeswap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ const adapters = univ2DimensionAdapter({
}
});


adapters.adapter.bsc.start = 1661780137;
export default adapters;
3 changes: 2 additions & 1 deletion fees/biswap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ const adapters = univ2DimensionAdapter({
}
});

export default adapters;

export default adapters;
1 change: 1 addition & 0 deletions fees/elk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,5 @@ adapter.adapter.optimism.start = 1651542817;
// adapter.adapter.iotex.start = 1639792417;
// adapter.adapter.telos.start = 1648684800;


export default adapter;
1 change: 1 addition & 0 deletions fees/ferro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ const adapters = univ2DimensionAdapter({
}
}, {
});

adapters.adapter.cronos.start = 1661731973;
export default adapters;
1 change: 1 addition & 0 deletions fees/honeyswap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ const adapters = univ2DimensionAdapter({
adapters.adapter.polygon.start = 1622173831;
adapters.adapter.xdai.start = 1599191431;


export default adapters;
2 changes: 2 additions & 0 deletions fees/mimo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@ const adapter = univ2DimensionAdapter({
});




export default adapter;
1 change: 1 addition & 0 deletions fees/mojitoswap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ const adapter = univ2DimensionAdapter({

adapter.adapter.kcc.start = 1634200191;


export default adapter
3 changes: 2 additions & 1 deletion fees/pangolin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ const adapter = univ2DimensionAdapter({
}
});

export default adapter;

export default adapter;
1 change: 1 addition & 0 deletions fees/vvs-finance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ const adapters = univ2DimensionAdapter({
}, {
});
adapters.adapter.cronos.start = 1632035122;

export default adapters;
1 change: 1 addition & 0 deletions fees/wigoswap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ const adapters = univ2DimensionAdapter({
}, {
});
adapters.adapter.fantom.start = 1642982400;

export default adapters;
12 changes: 6 additions & 6 deletions helpers/getUniSubgraph/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ interface IGetChainVolumeParams {
factory?: string,
field?: string,
blockGraphType?: string
filterParams?: IGetChainVolumeFilterParams[],
filterParams?: IGetChainVolumeFilterParams[],
},
dailyVolume?: {
factory?: string,
Expand Down Expand Up @@ -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(', ')}}
) {
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -443,7 +443,7 @@ function univ2DimensionAdapter(params: IGetChainVolumeParams, meta: BaseAdapter[
},
};
}, {} as BaseAdapter),
version: 2
version: 1
};

return adapter;
Expand Down
1 change: 1 addition & 0 deletions protocols/alita-finance/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ const adapter = univ2DimensionAdapter({
}
});


adapter.adapter.bsc.start = 1629947542;
export default adapter;
Loading