Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
KeremP wants to merge36 commits intouniswap-python:masterfromKeremP:v3-features

Conversation

KeremP
Copy link
Contributor

Added V3 features:

  • create/get v3 pool instance
  • create v3 liquidity position
  • remove v3 liquidity position

ErikBjare reacted with rocket emoji
@ErikBjare
Copy link
Member

Very nice! Let me know when you want a review :)

Any idea why the CI chokes on the CLI tests?

@KeremP
Copy link
ContributorAuthor

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.

@ErikBjare
Copy link
Member

Btw, do you think this would be easy to do at the same time?#254

@liquid-8
Copy link
Member

Btw, do you think this would be easy to do at the same time?#254

Long story short:
https://stackoverflow.com/questions/71814845/how-to-calculate-uniswap-v3-pools-total-value-locked-tvl-on-chain
Due to personal reasons, I can't implement that myself at the moment. However, it seems to be not too complicated to add.

@KeremP
Copy link
ContributorAuthor

Btw, do you think this would be easy to do at the same time?#254

Long story short:https://stackoverflow.com/questions/71814845/how-to-calculate-uniswap-v3-pools-total-value-locked-tvl-on-chain Due to personal reasons, I can't implement that myself at the moment. However, it seems to be not too complicated to add.

Sure thing, seems pretty straightforward to implement

@KeremP
Copy link
ContributorAuthor

Very nice! Let me know when you want a review :)

Any idea why the CI chokes on the CLI tests?

Took a peek at the logs for the CI, seems like provider env variable may not have set

@ErikBjare
Copy link
Member

ErikBjare commentedJul 14, 2022
edited
Loading

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.

@ErikBjare
Copy link
Member

Should have fixed it in#266, feel free to rebase so the tests get green :)

@codecov
Copy link

codecovbot commentedJul 15, 2022
edited
Loading

Codecov Report

Merging#264 (0175265) intomaster (208843c) willincrease coverage by2.16%.
The diff coverage is92.67%.

@@            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
Impacted FilesCoverage Δ
uniswap/util.py86.95% <80.64%> (-5.36%)⬇️
uniswap/uniswap.py82.63% <94.32%> (+3.53%)⬆️
uniswap/cli.py92.95% <100.00%> (ø)
uniswap/constants.py100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell ushow you rate us. Have a feature suggestion?Share it here.

@KeremP
Copy link
ContributorAuthor

Now that we have all green :) Going to write tests for the methods that address#254 and should be good for a review

@KeremP
Copy link
ContributorAuthor

Btw, do you think this would be easy to do at the same time?#254

Long story short:https://stackoverflow.com/questions/71814845/how-to-calculate-uniswap-v3-pools-total-value-locked-tvl-on-chain Due to personal reasons, I can't implement that myself at the moment. However, it seems to be not too complicated to add.

Sure thing, seems pretty straightforward to implement

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).

@KeremP
Copy link
ContributorAuthor

KeremP commentedAug 18, 2022
edited
Loading

@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

@liquid-8
Copy link
Member

Amazing job, that's impressive. The only thing I just can't get why
def get_liquidity_positions(self) -> List[int]:
instead of
def get_liquidity_positions(address: AddressLike) -> List[int]:

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.

@KeremP
Copy link
ContributorAuthor

Fair point, I agree. I'll make that change quick.

liquid-8 reacted with rocket emoji

@liquid-8
Copy link
Member

@ErikBjare just take a look at this grandeur!

Copy link
Member

@ErikBjareErikBjare left a comment
edited
Loading

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.

KeremP reacted with thumbs up emoji
ErikBjare pushed a commit that referenced this pull requestAug 29, 2022
… position, TVL calculation (#264)implementing V3 features. added methods to fetch on-chain pool datafeature: adding position miniting (WIP)WIP testing V3 pool position mintingwip v3 featuresfeat: create v3 pool and mint/add liquidity positionfix: add 0x0 address assert in get_pool_instancefeat: close v3 liquidity positionminor cleanupsadd get_tvl_in_pool to return total value locked in poolimplementing V3 features. added methods to fetch on-chain pool datafeature: adding position miniting (WIP)WIP testing V3 pool position mintingwip v3 featuresfeat: create v3 pool and mint/add liquidity positionfeat: close v3 liquidity positionminor cleanupsfixing minor errors afer rebasecleanup asset amounts for testsfix: ensure asset amounts are correct for v3 liquidity position testsadd tests for TVL calculations. include method for fetching TVL from V3 subgraph as on-chain method takes long to runadd arbitrum subgraph endpointfix typoskip tvl tests for nowfeat: get TVL on chainminor cleanupsfix aribitrum multicall2 address. clean up TVL testupdate get_liquidity_positions to take arbitrary address param
@ErikBjare
Copy link
Member

Merged a squashed version in9edfbaa (which was messy), now trying to address some issues during rebase.

@ErikBjare
Copy link
Member

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! ❤️

KeremP reacted with heart emoji

@KeremP
Copy link
ContributorAuthor

Sounds good! Thanks for the review :)

@ghost
Copy link

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.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ErikBjareErikBjareErikBjare approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@KeremP@ErikBjare@liquid-8

[8]ページ先頭

©2009-2025 Movatter.jp