-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- replace pool_data.queries with folder - move pool_volume to pool_data.queries - support get_pool_volume() using pool address
- Loading branch information
Showing
8 changed files
with
86 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,12 @@ | ||
""" | ||
Tools for fetching pool state and metadata. | ||
Tools for fetching pool metadata and volume. | ||
Currently supports stableswap pools, metapools, rebasing (RAI) metapools, | ||
and 2-token cryptopools. | ||
""" | ||
|
||
__all__ = [ | ||
"from_address", | ||
"get_metadata", | ||
] | ||
__all__ = ["get_metadata", "get_pool_volume"] | ||
|
||
from curvesim.pool_data.metadata import PoolMetaData | ||
|
||
from .queries import from_address | ||
|
||
|
||
def get_metadata( | ||
address, | ||
chain="mainnet", | ||
env="prod", | ||
end_ts=None, | ||
): | ||
""" | ||
Pulls pool state and metadata from daily snapshot. | ||
Parameters | ||
---------- | ||
address : str | ||
Pool address prefixed with “0x”. | ||
chain : str | ||
Chain/layer2 identifier, e.g. “mainnet”, “arbitrum”, “optimism". | ||
Returns | ||
------- | ||
:class:`~curvesim.pool_data.metadata.PoolMetaDataInterface` | ||
""" | ||
# TODO: validate function arguments | ||
metadata_dict = from_address(address, chain, env=env, end_ts=end_ts) | ||
metadata = PoolMetaData(metadata_dict) | ||
|
||
return metadata | ||
from .queries.metadata import get_metadata | ||
from .queries.pool_volume import get_pool_volume |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
""" | ||
Functions for fetching data about Curve pools. | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters