-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add Frankencoin protocol revenue adapter #3880
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
base: master
Are you sure you want to change the base?
Conversation
The frankencoin adapter exports:
|
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.
.
const dailyFees = options.createBalances(); | ||
const dailyRevenue = options.createBalances(); | ||
|
||
try { |
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.
please remove try-catch as we have to let the adapter fail in case any errors, so we can fix the issue
limit: 1, | ||
) { | ||
items { | ||
profits |
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 need more information regarding the how profit/loss are calculated? as daily ~1M revenue for 30m TVL looks very high, so please provide more information, thanks
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.
Hoi
the graph table is just an entry of all profits and losses. And therefore its the accumulated profits/losses of all times. I thought the defillama api is regularly fetching the numbers and calculate the difference between the fetches and therefore knows how much the daily values would be.
{
"amount": "167395000000000000000", **<-- individual change per this entry**
"chainId": 1,
"count": "353",
"created": "1754328179",
"kind": "Profit", **<-- this entry reflects a profit change**
"losses": "20513419393164404266345", **<-- all time losses (accum.)**
"minter": "0x5ed0d010e20c262cc264aaf060fb9e3037cd383e",
"perFPS": "90297226610802112896",
"profits": "802597897386182421051766" **<-- all time profits (accum.)**
},
maybe i have to refactor this.
So you need explicitly the daily p/l?
How does the fetcher function know which date it is?
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.
@samclassix you can read more about how dimension adapter works here(https://docs.llama.fi/list-your-project/other-dashboards)
but i will give you tldr
we run it each day at UTC 00:00 if it's version 1 adapter(default)
so we have options in fetch function, which has options.starttimestamp and options.endtimestamp
which will be previous day start and end timestamp.
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.
i don't understand how all profit goes to protocol, isn't there any yield for token holders?
Test Output
❯ npm test fees frankencoin 2025-07-30
🦙 Running FRANKENCOIN adapter 🦙
Start Date: Tue, 29 Jul 2025 00:00:00 GMT
End Date: Wed, 30 Jul 2025 00:00:00 GMT
ETHEREUM 👇
Backfill start time: 28/10/2023
Daily fees: 994.10 k
Daily revenue: 968.76 k
Daily protocol revenue: 968.76 k
End timestamp: 1753833599 (2025-07-29T23:59:59.000Z)