-
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.
- Loading branch information
Showing
17 changed files
with
315 additions
and
232 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
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
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,27 @@ | ||
from typing import List, Union | ||
|
||
from curvesim.constants import Chain | ||
from curvesim.pool_data.metadata import PoolMetaDataInterface | ||
from curvesim.pool_data.queries.metadata import get_metadata | ||
from curvesim.templates.sim_asset import OnChainAssetPair | ||
from curvesim.utils import get_pairs | ||
|
||
|
||
def get_pool_assets( | ||
metadata_or_address, chain: Union[str, Chain] = Chain.MAINNET | ||
) -> List[OnChainAssetPair]: | ||
if isinstance(metadata_or_address, str): | ||
pool_metadata: PoolMetaDataInterface = get_metadata(metadata_or_address, chain) | ||
else: | ||
pool_metadata = metadata_or_address | ||
|
||
symbol_pairs = get_pairs(pool_metadata.coin_names) | ||
address_pairs = get_pairs(pool_metadata.coins) | ||
|
||
sim_assets = [] | ||
for symbols, addresses in zip(symbol_pairs, address_pairs): | ||
id = "-".join(symbols) | ||
asset = OnChainAssetPair(id, *symbols, *addresses, pool_metadata.chain) | ||
sim_assets.append(asset) | ||
|
||
return sim_assets |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
__all__ = ["CoinGeckoPriceVolumeDataSource", "FileDataSource"] | ||
|
||
from curvesim.templates.data_source import FileDataSource | ||
|
||
from .coingecko import CoinGeckoPriceVolumeDataSource |
Oops, something went wrong.