-
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
Gyroscope: fee adapter #2465
base: master
Are you sure you want to change the base?
Gyroscope: fee adapter #2465
Conversation
The gyroscope adapter exports:
|
fees/gyroscope/index.ts
Outdated
return async (options: FetchOptions) => { | ||
const dailyFees = options.createBalances(); | ||
try { | ||
const value = await queryDune("4776022", {}); |
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.
seem your query is wrong
- should split by chain
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.
also, can you compute this on chain using event logs, the dune query is bit confusing
The gyroscope 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.
- tried to add a fee split by chain
- doing this with onchain events would be rather convoluted, dune seems significantly easier
- would strongly welcome any edits to make this adapter work
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.
"doing this with onchain events would be rather convoluted" why? can you briefly explain how you are computing the fees? I can look into writing the adapter myself.
We prefer onchain adapter over dune as it is less maintenance and we have better control
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.
would be amazing if you could help with the adapter @g1nt0ki .
here would be the logic for doing this onchain:
- protocol fees accrue from pools to fee collector addresses. fee collector addresses are defined on a per-chain basis.
- listing these addresses below, but FYI, you can query the fee collector addresses by looking at the addresses returned by the
getFeesMetadata
function of any pool: eg https://basescan.org/address/0x276a02120c71193b138941dc5838da270e98e088#readContract#F11 - fees that accrue to the fee collector addresses are LP shares and must be priced first. the LP share pricing logic is as follows:
(amount of LP shares minted to the fee collector) / (post-event pool.getActualSupply()) * (post-event pool TVL)
for your convenience, also listing all fee collector addresses here:
- https://basescan.org/address/0xce88686553686DA562CE7Cea497CE749DA109f9F
- https://basescan.org/address/0xA01ba17778A860EC92053325d0de4022240ceeA4
- https://etherscan.io/address/0xA01ba17778A860EC92053325d0de4022240ceeA4
- https://etherscan.io/address/0xce88686553686DA562CE7Cea497CE749DA109f9F
- https://gnosisscan.io/address/0xce88686553686DA562CE7Cea497CE749DA109f9F
- https://polygonscan.com/address/0xce88686553686DA562CE7Cea497CE749DA109f9F
- https://seitrace.com/address/0xDcC628c4C9f3840EA70f95798Ec4C16B0DA23ef9?chain=pacific-1
- https://snowtrace.io/address/0xA01ba17778A860EC92053325d0de4022240ceeA4
- https://snowtrace.io/address/0xce88686553686DA562CE7Cea497CE749DA109f9F
- https://arbiscan.io/address/0xce88686553686DA562CE7Cea497CE749DA109f9F
- https://arbiscan.io/address/0xA01ba17778A860EC92053325d0de4022240ceeA4
No description provided.