-
Notifications
You must be signed in to change notification settings - Fork 385
feat: create pool and create/remove liquidity position for v3 #264
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
Conversation
Very nice! Let me know when you want a review :) Any idea why the CI chokes on the CLI tests? |
Thanks! Will do. Not sure as to why the CI isn't passing - was working earlier when I ran tests locally. I'll take a look tonight and see what's up. |
Btw, do you think this would be easy to do at the same time? #254 |
Long story short: |
Sure thing, seems pretty straightforward to implement |
Took a peek at the logs for the CI, seems like provider env variable may not have set |
Ah yeah, I just now remember that secrets (like our PROVIDER credentials) aren't set on PRs. Might get a second key, obfuscate it slightly, and use it for PRs. |
Should have fixed it in #266, feel free to rebase so the tests get green :) |
Codecov Report
@@ Coverage Diff @@
## master #264 +/- ##
==========================================
+ Coverage 82.42% 84.59% +2.16%
==========================================
Files 10 10
Lines 808 1032 +224
==========================================
+ Hits 666 873 +207
- Misses 142 159 +17
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Now that we have all green :) Going to write tests for the methods that address #254 and should be good for a review |
…V3 subgraph as on-chain method takes long to run
After implementing a version of this - seems this takes quite a while to run as it iterates across the entire tick range of a pool and calls the .tick() function of the contract each iteration. So, I added a method to fetch the TVL data from the uniswap subgraph using the built-in request library. Do you think I should remove the subgraph query function? suppose it's easy enough for users to make similar requests on their own (this is also failing some tests at the moment). |
@ErikBjare this is now ready for review :) wrt to #254 I've added a function get_tvl_in_pool() and have commented the logic (some weird hacks with the tickBitmap to get it working), but let me know if any questions. Edit: I've removed my prior functions for querying subgraph, feel that's out of scope here and there are known issues w/ its calculation of TVL |
Amazing job, that's impressive. The only thing I just can't get why IMO if we have a scenario when this function has the reason to be implemented for our address, then we also have a similar/same scenario for others. |
Fair point, I agree. I'll make that change quick. |
@ErikBjare just take a look at this grandeur! |
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.
Awesome work @KeremP! You da MVP! 🥇
Found no major issues, just a couple nits. I'll fix and merge :)
Sorry for the late review.
… position, TVL calculation (#264) implementing V3 features. added methods to fetch on-chain pool data feature: adding position miniting (WIP) WIP testing V3 pool position minting wip v3 features feat: create v3 pool and mint/add liquidity position fix: add 0x0 address assert in get_pool_instance feat: close v3 liquidity position minor cleanups add get_tvl_in_pool to return total value locked in pool implementing V3 features. added methods to fetch on-chain pool data feature: adding position miniting (WIP) WIP testing V3 pool position minting wip v3 features feat: create v3 pool and mint/add liquidity position feat: close v3 liquidity position minor cleanups fixing minor errors afer rebase cleanup asset amounts for tests fix: ensure asset amounts are correct for v3 liquidity position tests add tests for TVL calculations. include method for fetching TVL from V3 subgraph as on-chain method takes long to run add arbitrum subgraph endpoint fix typo skip tvl tests for now feat: get TVL on chain minor cleanups fix aribitrum multicall2 address. clean up TVL test update get_liquidity_positions to take arbitrary address param
Merged a squashed version in 9edfbaa (which was messy), now trying to address some issues during rebase. |
Alright, I can't manage to get this PR to get marked as "Merged" for some reason (keeps complaining about some conflict?). Changes are merged though, fixing some lingering issues on master. Thanks again for contributing @KeremP! ❤️ |
Sounds good! Thanks for the review :) |
What is the difference between mint_liquidity and mint_position here? I tried to create positions using both. mint_liquidity was successful but mint_position didn't seem to create a position though the function execution was successful. |
Added V3 features: