load_token_metadata#
API documentation for tradingstrategy.utils.token_extra_data.load_token_metadata Python function.
- load_token_metadata(pairs_df, client)[source]#
Load token metadata for all trading pairs.
Load and cache token metadata for given DataFrame of trading pairs
Gets Trading Strategy metadata, TokenSniffer data, Coingecko data
Uses
Client.fetch_token_metadata()
to retrofit trading pair data with token metadataCan be used e.g. for scam filtering
See
tradingstrategy.token_metadata.TokenMetadata
. :return:New DataFrame with new columns:
“token_metadata” containing token metadata object.
“coingecko_categories” containing CoinGecko categories
“tokensniffer_score” containing TokenSniffer risk score
“tokensniffer_error” containing error message if TokenSniffer data could not be fetched for a token
“buy_tax” containing buy tax
“sell_tax” containing sell tax
All data is for the base token of the trading pair. Columns will contain
None
value if not available.- Parameters:
pairs_df (DataFrame) –
client (Client) –
- Return type:
DataFrame