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

feat(dopex): holder and supply side revenue #1277

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
12 changes: 9 additions & 3 deletions options/dopex/clamm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ async function getChainStats({ graphUrl, timestamp }: IGetChainStatsParams) {
first: 1000
orderDirection: asc
orderBy: startTimestamp
where: { startTimestamp_gte: $fromTimestamp, startTimestamp_lte: $toTimestamp, volume_gt: 0 }
where: {
startTimestamp_gte: $fromTimestamp
startTimestamp_lte: $toTimestamp
volume_gt: 0
}
) {
volume
fees
Expand Down Expand Up @@ -88,9 +92,11 @@ async function getChainStats({ graphUrl, timestamp }: IGetChainStatsParams) {
return {
timestamp,
...cumulative,
totalFees: cumulative.totalRevenue,
...daily,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fees is require dailyFees we can't list without dailyFees

Copy link
Author

@Aercwarden Aercwarden Jun 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In our context, this will be protocol fees + premium?

dailyFees = daily protocol fees + daily premium?

when a user purchases options on stryke they pay premium + protocol fees

image

dailyFees: daily.dailyRevenue,
dailySupplySideRevenue: daily.dailyPremiumVolume,
totalSupplySideRevenue: cumulative.totalPremiumVolume,
dailyHoldersRevenue: daily.dailyRevenue,
totalDailyHoldersRevenue: cumulative.totalRevenue,
};
}

Expand Down
Loading