Skip to content

Commit

Permalink
Merge pull request #613 from Buffer-Finance/master
Browse files Browse the repository at this point in the history
Changed subgraph referrence table
  • Loading branch information
dtmkeng committed Jul 12, 2023
2 parents d89d800 + da6a451 commit f42eb9e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions fees/buffer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,22 @@ export function _getDayId(timestamp: number): string {
const graphs = (graphUrls: ChainEndpoints) => {
return (chain: Chain) => {
return async (timestamp: number) => {
const dayTimestamp = timestamp - 86400;
const dateId = _getDayId(dayTimestamp);
const dateId = _getDayId(timestamp);

const graphQuery = gql
`{
feeStat(id: ${dateId}) {
defillamaFeeStat(id: ${dateId}) {
fee
}
}`;

const graphRes = await request(graphUrls[chain], graphQuery);

const dailyFee = new BigNumber(graphRes.feeStat.fee).div(1000000);
const dailyFee = new BigNumber(graphRes.defillamaFeeStat.fee).div(1000000);
// const protocolRev = new BigNumber(graphRes.dailyRevenueAndFee.settlementFee).div(1000000).times(0.05);
// const userHolderRev = new BigNumber(graphRes.dailyRevenueAndFee.settlementFee).div(1000000).times(0.4);
// const supplySideRev = new BigNumber(graphRes.dailyRevenueAndFee.settlementFee).div(1000000).times(0.55);
const dailyRev = new BigNumber(graphRes.feeStat.fee).div(1000000);
const dailyRev = new BigNumber(graphRes.defillamaFeeStat.fee).div(1000000);

return {
timestamp,
Expand Down

0 comments on commit f42eb9e

Please sign in to comment.