-
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
feat(dopex): holder and supply side revenue #1277
Open
Aercwarden
wants to merge
4
commits into
DefiLlama:master
Choose a base branch
from
Aercwarden:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -58,14 +62,13 @@ async function getChainStats({ graphUrl, timestamp }: IGetChainStatsParams) { | |
return { | ||
totalNotionalVolume: | ||
acc.totalNotionalVolume + Number(market.totalVolume), | ||
totalPremiumVolume: | ||
acc.totalPremiumVolume + Number(market.totalPremium), | ||
totalFees: acc.totalFees + Number(market.totalPremium), | ||
totalRevenue: acc.totalRevenue + Number(market.totalFees), | ||
}; | ||
}, | ||
{ | ||
totalNotionalVolume: 0, | ||
totalPremiumVolume: 0, | ||
totalFees: 0, | ||
totalRevenue: 0, | ||
} | ||
); | ||
|
@@ -74,23 +77,23 @@ async function getChainStats({ graphUrl, timestamp }: IGetChainStatsParams) { | |
(acc, market) => { | ||
return { | ||
dailyNotionalVolume: acc.dailyNotionalVolume + Number(market.volume), | ||
dailyPremiumVolume: acc.dailyPremiumVolume + Number(market.premium), | ||
dailyFees: acc.dailyFees + Number(market.premium), | ||
dailyRevenue: acc.dailyRevenue + Number(market.fees), | ||
}; | ||
}, | ||
{ | ||
dailyNotionalVolume: 0, | ||
dailyPremiumVolume: 0, | ||
dailyFees: 0, | ||
dailyRevenue: 0, | ||
} | ||
); | ||
|
||
return { | ||
timestamp, | ||
totalPremiumVolume: cumulative.totalFees, | ||
dailyPremiumVolume: daily.dailyFees, | ||
...cumulative, | ||
totalFees: cumulative.totalRevenue, | ||
...daily, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fees is require There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
dailyFees: daily.dailyRevenue, | ||
}; | ||
} | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
for options we can't include premium on fees
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.
Oh okay! Can you suggest how can we show premiums as premiums and not as premium volume (which is only visible on a graph). premiums should be shown in the side bars as well along with fees, revenue etc.
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.
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, 24h revenue should show as premiums 24h. anyways I've updated the code to show only revenue and not fees since they're the same data :)
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.
premiums should show here on the left panel too
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.
no fees is only add on fees when user buy option premium is not fees
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.
if you need update fees/rev plz set at field
dailyFees
,dailyRevenue
now current adapter set fees = rev then show fees = rev premiums is show only options page
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.
If that's the case, no change has to be made and this PR can be closed. Our only concern is premiums not showing in main options page or anywhere except in just the bar graph as premium volume which as you mentioned will be fixed :)
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 will take look why option is show daily rev instead daily premium
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.
Hey! updated the PR to just show more stats as per teams feedback :) please review