-
Notifications
You must be signed in to change notification settings - Fork 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: Added wise-lending-v2 fees #1968
Conversation
The wise-lending-v2 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.
hi @jenelyn0214 thanks for the PR, but we prefer computing fees on chain (where possible) this way we/the users can understand what is included as fees and the adapter would continue to work even if the endpoint becomes unreachable.
Easiest way to do this is, relying on event logs, are there are any logs emitted when users pay the fees.
If you share sample transaction of this, I can work on refactoring it to compute fees using onchain data
@jenelyn0214 could you take the on-chain code we use for https://data.wisetoken.net/WISE/globals/fees.json and implement here same calls to contract data that gives us same result as in the feed. |
The wise-lending-v2 adapter exports:
|
@g1nt0ki can you check again we've changed the implementation to be on-chain |
fees/wise-lending-v2/index.ts
Outdated
calls: arbitrumPools, | ||
}); | ||
|
||
api.add(arbitrumPools, feeAmounts); |
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 it total value not daily
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 query this endpoint daily then you get the values on daily basis
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.
so this adapter shows our current fees generated by the protocol that are not withdrawn, as soon as protocol withdraws the fees this global value of fees accumulated is reduced accordingly. @dtmkeng feel free to open our contract and see how the fees are handled.
-
query feeTokens() to see accumulated fees for the pool that are not withdrawn, query feeTokens() at any time to get the amount of fees protocol holds at each point in time.
-
elaborate about daily? contract provides fees for each pool at every given moment every time you make a snapshot of this data (daily, monthly or each hour is up to you) we give you data on chain about fees we've collected at each point available from the protocol.
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 it total value not daily
can you elaborate how it should be? did you check contract code? the fees reported are correct per pool, if they are withdrawn on daily basis call to this function would reflect that in value updated every time queried.
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.
value you get from function it total value not daily
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.
daily value from contract function should like this https://github.com/DefiLlama/dimension-adapters/blob/master/fees/crv-usd.ts
@g1nt0ki could you take a look and progress this PR? We've changed the solution to be on-chain. |
The wise-lending-v2 adapter exports:
|
@jenelyn0214 hmm, on second thought, this might show lower fees because if the protocol withdraws fees in the 24 hour period, it is subtracted right? is there some event log when the withdrawal happens so we can include it? |
yes let's include it if possible, we have event
emitted during claimWiseFees call. |
okay, updated code the use that event: a2a5c6a |
No description provided.