-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Patch to compound v3 borrows #6495
Patch to compound v3 borrows #6495
Conversation
Workflow run id 10237860105 approved. |
Workflow run id 10237859950 approved. |
Workflow run id 10237860113 approved. |
Workflow run id 10237861969 approved. |
Workflow run id 10237861865 approved. |
thank you @darvinrio for the PR. can you help me out a bit more with some context here?
|
@tomfutago friendly tag, as the one who helped build this lineage of spells. do you want to give a quick review? |
I added base asset supply and withdrawal and partial borrows and repays. for more context: |
hey @darvinrio @jeff-dude I looked at the changes, admittedly not in massive depth, and here are my notes that hopefully will add some value:
|
hey @tomfutago thanks for the review. thanks in ahead for your patience cc: @jeff-dude |
all good, no rush! thanks for collaborating. |
A slightly more detailed report : This PR #6495 aims to
I hope this clears the confusions. happy to clear any doubts that might arise. In compound v3, the repay and supply were put together to prevent looping. Since these two were put together, and there was no amount bound, a user can repay and supply in the same event, if the amount sent to the Definition:
To find these amounts, we can track
SupplySay a user has 100 USDC debt, and sends 150 USDC via In this case, the The The Withdrawals:A user has supplied 50 USDC to the Comet, and now tries to withdrawal 110 USDC. Provided there are enough collaterals, the user withdraws 50 USDC from their supply, and borrows 60 USDC against their collateral. In this case, the The Comparing Existing Models:In the below queries, you can see that the new model accurately matches the existing models for full borrows and full repays, while also adding the partial borrows and partial repays. Borrows Check:https://dune.com/queries/3996425 https://dune.com/queries/3996456 Repays Check:https://dune.com/queries/3996448 https://dune.com/queries/3996453 The arbitrary
|
"slightly more detailed" 😳😂 that's probably most detailed response ever! will take a look, but it will take me some time (most likely earliest next week, if that..) @jeff-dude if you're happy with the above - no need to wait for me 👍 |
hey @darvinrio it sounds to me like you know much more than me how compound v3 works 🙌 thanks for providing this added info in so much depth! I looked at your explanations and comp queries - and I'm convinced updated logic is correct. |
thank you for providing me with my Monday morning validation 🤗 |
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.
thank you @darvinrio for the clean code updates & clear communication on what is changing and why.
thank you @tomfutago for taking the time to give a review 🙏
i'm good with the changes based on the two of you agreeing here
Thank you for contributing to Spellbook 🪄
Update!
Please build spells in the proper subproject directory. For more information, please see the main readme, which also links to a GH discussion with the option to ask questions.
Contribution type
Please check the type of contribution this pull request is for:
Note: You can safely discard any section below which doesn't apply based on selection above
For adding to existing spell lineage
If you are adding to an existing spell lineage, please provide the following information:
Description:
Follow up to Patch to add compound v3 Base asset supply #6448
Adding partial Borrow and Repay events of Base asset of compound v3 pools, via patch
for withdraws and borrows check -> https://dune.com/queries/3945443
for supply and repay check -> https://dune.com/queries/3945395
Additional information
Please provide any additional information that might help us review your pull request:
Thank you for your contribution!