-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fees adapter for Zeebu #2308
base: master
Are you sure you want to change the base?
Fees adapter for Zeebu #2308
Conversation
Added adapter for ZEEBU to show fees & revenue
update methodology and remove unwanted functions
remove syntax error
The zeebu adapter exports:
|
// Fetch total fees | ||
const totalFeesResponse = await request(graphUrls[chain], totalFeesQuery, { }); | ||
const totalFees = totalFeesResponse.overallVolumeFeesAggregates.reduce( | ||
(sum, item) => sum + parseFloat(((item.totalFees * 2)/1e18) || 0), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why value is 2x ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We charge 1% fees from both parties (i.e customer & merchant), we charge 1% from customer at invoice smart contract while payment being processed, 1% will charges from merchant when they will claim their invoice settlement amount at PSP portal .
For your information, you can refer this : https://zeebu.gitbook.io/zeebu-whitepaper-2.0/Eo5Icop4mRkIyIwSDGM8/zeebu-settlement/platform-overview
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why it not include at your totalFees ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its there, look at this code snipest:
const totalFees = totalFeesResponse.overallVolumeFeesAggregates.reduce(
(sum, item) => sum + parseFloat(((item.totalFees * 2)/1e18) || 0),
0
);
we multiply it by 2 also.
we charge 1% on both the side, we can get 1% fees values for customer from smart contract using subgraph, while for merchant we can not calculate it on blockchain. Its stored centralise. Should we used rest API to fetch those fees data here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it incorrect ? because it not real number you can collect
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well collectively we received 2% fees of invoice amount, 1% charge on smart contract from customer side and 1% charge on centralise when merchant claimed invoice settlement. ex. customer A pay $1000 worth of zeebu to merchant B, customer actually pay $1010 (where $10 is 1% fees) which will collect on invoice contract side.
Invoice contract will deduct 1% fees and send rest of $1000 to merchant, merchant will claim this settlement at PSP portal where he/she have to pay 1% fees, so here merchant will receive $990, ($10 will goes to portal fees account)
Kindly guide us what to do next?
fees/zeebu/index.ts
Outdated
const totalSupplySideRevenue = totalFees * 0.6 / 100; | ||
|
||
return {dailyFees, totalFees, dailyUserFees, totalUserFees, dailyRevenue, totalRevenue, dailyHoldersRevenue, totalHoldersRevenue }; | ||
} catch (error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we prefer adapter failing over returning empty result
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kindly help or suggest to overcome the same!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should I remove exception handling?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes should remove try catch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @dtmkeng , I removed the same and commited the code
remove exception handling as per suggestion by defillama team
The zeebu adapter exports:
|
remove syntax error
The zeebu adapter exports:
|
Adding fees dimensional adapters for Zeebu (revenue and fees)