Skip to content

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

samclassix
Copy link

@samclassix samclassix commented Jul 30, 2025

Test Output

❯ npm test fees frankencoin 2025-07-30

[email protected] test
ts-node --transpile-only cli/testAdapter.ts 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)

@llamabutler
Copy link

The frankencoin adapter exports:

> [email protected] test
> ts-node --transpile-only cli/testAdapter.ts fees frankencoin

🦙 Running FRANKENCOIN adapter 🦙
---------------------------------------------------
Start Date:	Tue, 29 Jul 2025 06:22:40 GMT
End Date:	Wed, 30 Jul 2025 06:22:40 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: 1753856559 (2025-07-30T06:22:39.000Z)

Copy link
Member

@treeoflife2 treeoflife2 left a 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 {
Copy link
Member

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
Copy link
Member

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

Copy link
Author

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?

Copy link
Member

@treeoflife2 treeoflife2 Aug 7, 2025

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.

Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants