-
Notifications
You must be signed in to change notification settings - Fork 32
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
Use Curve Prices API for pool volume #277
Conversation
A few open questions:
Edit:
|
Coverage reportThe coverage rate went from
Diff Coverage details (click to unfold)curvesim/exceptions/init.py
curvesim/network/curve_prices.py
curvesim/pipelines/vol_limited_arb/init.py
curvesim/pool/init.py
curvesim/pool_data/init.py
curvesim/pool_data/queries/init.py
curvesim/pool_data/queries/metadata.py
curvesim/pool_data/queries/pool_volume.py
|
3cf51af
to
43567cc
Compare
- Add network.curve_prices - Add ApiResultError to exceptions - Add vol_limited_arb.pool_volume.get_pool_volume() - Compute volume multiplier per asset pair - Remove volume multiplier modes - Remove pipelines.utils - Remove PriceVolume.total_volumes() - Remove volume from PoolDataCache - Remove convex subgraph volume query
43567cc
to
dff0508
Compare
83e64fb
to
6f99d4e
Compare
Comparing 3pool sim results before and after the volume limit change. As expected: Volume Limits New version: |
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.
Everything looks really nice, big improvements on the current codebase!
I would update the changelog entries tho :)
- Removed volume from PoolDataCache | ||
- Removed convex subgraph volume query | ||
- Removed PoolDataCache | ||
|
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.
We should mention we've removed volume support for chains other Mainnet (pending future support from the curve-prices API) and sims for the RAI pool are no longer supported.
Added | ||
----- | ||
- Added network.curve_prices | ||
- Added ApiResultError to exceptions |
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.
I understand stuff gets aggregated for the release changelog, but it helps to leave out clutter like this: nobody will ever care you added this error class, but probably most people would want to know what network.curve_prices
is.
from curvesim.pool_data.metadata import PoolMetaData | ||
from curvesim.utils import get_pairs | ||
|
||
from ..unit.test_pool_metadata import ( |
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.
I'm not a fan of imports like this because they couple tests together unexpectedly. Nobody working on pool metadata tests would expect the pool volume integration tests to fail because they changed something.
Probably we should have a better test setup of some sort, whether it's fixtures or something else, but from what we discussed, this will go away anyway due to volume functionality being injected into a ReferenceMarket class, so I don't think it's worth it.
In that case, I would expect better intermediate abstractions of some sort, e.g. pool metadata --> asset abstractions --> volume functions; this would be "happening" inside a ReferenceMarket (or its factory), but for testing, it would separate pool metadata rather cleanly from the volume functions via the intermediate asset abstractions.
6f99d4e
to
0bda59a
Compare
- replace pool_data.queries with folder - move pool_volume to pool_data.queries - support get_pool_volume() using pool address
0bda59a
to
048c0e8
Compare
Description
Updates historical pool volume functionality to use the new Curve Prices API. Pool volume for each token pair is denominated in the pair's quote token, rather than pseudo-dollars, to allow for correct volume limiting for v2 pools. In the volume-limited arbitrage pipeline, volume multipliers are computed for each pair using this data. Volume limiter modes are removed as this method is more accurate than all of the previous modes, which relied on aggregate pool volume across all pairs.
Hygiene checklist
(modules, public functions, classes, and public methods)
and descriptive commit messages following Tim Pope's style
Cute Animal Picture