- Notifications
You must be signed in to change notification settings - Fork386
Add function to get amount of asset locked per tick in pool#283
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
base:master
Are you sure you want to change the base?
Add function to get amount of asset locked per tick in pool#283
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Wow, well done! I've allowed the test to run now. If you want to run them yourself without having to wait for me to approve the run, you can push to the master branch of your own fork, which should trigger a run (althought might be missing credentials). |
codecovbot commentedOct 12, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov ReportBase:84.17% // Head:57.67% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@## master #283 +/- ##===========================================- Coverage 84.17% 57.67% -26.51%=========================================== Files 10 10 Lines 1030 1082 +52 ===========================================- Hits 867 624 -243- Misses 163 458 +295
Help us with your feedback. Take ten seconds to tell ushow you rate us. Have a feature suggestion?Share it here. ☔ View full report at Codecov. |
Looks like we have a failure:
Was also picked up by the typechecking:
|
@IanMichaelHarper looks like the error is here: @pytest.mark.parametrize("token0, token1", [("DAI","USDC")])deftest_asset_locked_per_tick_sums_to_tvl(self,client:Uniswap,token0,token1): ..... whereas in order to use the @pytest.mark.parametrize("token0, token1", [("DAI","USDC")])deftest_asset_locked_per_tick_sums_to_tvl(self,client:Uniswap,tokens,token0,token1): ..... |
Whoops. Sorry about that. Updated now. |
this is how I had the test passing originally for what I was working on, where approximately correct was fine. Finding the discrepancy for exact values requires more digging and debugging. |
I think approximately correct is fine for now, working with the tickbitmap, etc. can get a little complex. Apparently the subgraph bug has been fixed somewhat recently: I'll definitely take a look this weekend and see if there are any improvements to glean and update the tvl in pool code respectively. Good work though! 👍 |
Uh oh!
There was an error while loading.Please reload this page.
This function is more or less the same as the
get_tvl_in_pool()
function but slightly modified to return the amount of each asset locked in a pool per tick.I created a test to ensure that the amounts returned sum to the same result as
get_tvl_in_pool()
. I'm having trouble running the tests locally, so I thought I'd open a PR so the tests could run on Github.