Fix using forecast in SDK + crypto alignment (#3119)

* fix access to forecast SDK

* fix alignment

* fix tests

* black lint

Co-authored-by: James Maslek <jmaslek11@gmail.com>
This commit is contained in:
DidierRLopes
2022-10-27 14:51:46 +01:00
committed by GitHub
parent 15e6e4ad85
commit 41b2a006c4
9 changed files with 274 additions and 3477 deletions

View File

@@ -11,8 +11,139 @@ logger = logging.getLogger(__name__)
token_terminal = TokenTerminal(key=cfg.API_TOKEN_TERMINAL_KEY)
# Fetch all data for projects
PROJECTS_DATA = token_terminal.get_all_projects()
# Fetch all data for projects'
try:
PROJECTS_DATA = token_terminal.get_all_projects()
except Exception as e:
logger.error(e)
PROJECTS_DATA = [
"0x",
"1inch",
"88mph",
"aave",
"abracadabra-money",
"alchemist",
"alchemix-finance",
"algorand",
"alpha-finance",
"arweave",
"autofarm",
"avalanche",
"axie-infinity",
"balancer",
"bancor",
"barnbridge",
"basket-dao",
"benqi",
"binance-smart-chain",
"bitcoin",
"cap",
"cardano",
"centrifuge",
"clipper",
"compound",
"convex-finance",
"cosmos",
"cryptex",
"curve",
"decentral-games",
"decred",
"dforce",
"dhedge",
"dodo",
"dogecoin",
"dydx",
"ellipsis-finance",
"elrond",
"enzyme-finance",
"erasure-protocol",
"ethereum",
"ethereum-name-service",
"euler",
"fantom",
"fei-protocol",
"filecoin",
"futureswap",
"gmx",
"goldfinch",
"harvest-finance",
"helium",
"hurricaneswap",
"idle-finance",
"index-cooperative",
"instadapp",
"integral-protocol",
"karura",
"keeperdao",
"keep-network",
"kusama",
"kyber",
"lido-finance",
"liquity",
"litecoin",
"livepeer",
"looksrare",
"loopring",
"maiar",
"makerdao",
"maple-finance",
"mcdex",
"metamask",
"mstable",
"near-protocol",
"nexus-mutual",
"nftx",
"notional-finance",
"opensea",
"optimism",
"osmosis",
"pancakeswap",
"pangolin",
"perpetual-protocol",
"piedao",
"pocket-network",
"polkadot",
"polygon",
"polymarket",
"pooltogether",
"powerpool",
"quickswap",
"rarible",
"rari-capital",
"reflexer",
"ren",
"ribbon-finance",
"rocket-pool",
"saddle-finance",
"set-protocol",
"solana",
"solend",
"spookyswap",
"stake-dao",
"stellar",
"sushiswap",
"synthetix",
"terra",
"tezos",
"the-graph",
"thorchain",
"tokemak",
"tokenlon",
"tornado-cash",
"trader-joe",
"uma",
"uniswap",
"unit-protocol",
"venus",
"vesper-finance",
"volmex",
"wakaswap",
"yearn-finance",
"yield-guild-games",
"yield-yak",
"zcash",
"zora",
]
METRICS = [
"twitter_followers",

View File

@@ -12,7 +12,138 @@ logger = logging.getLogger(__name__)
token_terminal = TokenTerminal(key=cfg.API_TOKEN_TERMINAL_KEY)
# Fetch all data for projects'
PROJECTS_DATA = token_terminal.get_all_projects()
try:
PROJECTS_DATA = token_terminal.get_all_projects()
except Exception as e:
logger.error(e)
PROJECTS_DATA = [
"0x",
"1inch",
"88mph",
"aave",
"abracadabra-money",
"alchemist",
"alchemix-finance",
"algorand",
"alpha-finance",
"arweave",
"autofarm",
"avalanche",
"axie-infinity",
"balancer",
"bancor",
"barnbridge",
"basket-dao",
"benqi",
"binance-smart-chain",
"bitcoin",
"cap",
"cardano",
"centrifuge",
"clipper",
"compound",
"convex-finance",
"cosmos",
"cryptex",
"curve",
"decentral-games",
"decred",
"dforce",
"dhedge",
"dodo",
"dogecoin",
"dydx",
"ellipsis-finance",
"elrond",
"enzyme-finance",
"erasure-protocol",
"ethereum",
"ethereum-name-service",
"euler",
"fantom",
"fei-protocol",
"filecoin",
"futureswap",
"gmx",
"goldfinch",
"harvest-finance",
"helium",
"hurricaneswap",
"idle-finance",
"index-cooperative",
"instadapp",
"integral-protocol",
"karura",
"keeperdao",
"keep-network",
"kusama",
"kyber",
"lido-finance",
"liquity",
"litecoin",
"livepeer",
"looksrare",
"loopring",
"maiar",
"makerdao",
"maple-finance",
"mcdex",
"metamask",
"mstable",
"near-protocol",
"nexus-mutual",
"nftx",
"notional-finance",
"opensea",
"optimism",
"osmosis",
"pancakeswap",
"pangolin",
"perpetual-protocol",
"piedao",
"pocket-network",
"polkadot",
"polygon",
"polymarket",
"pooltogether",
"powerpool",
"quickswap",
"rarible",
"rari-capital",
"reflexer",
"ren",
"ribbon-finance",
"rocket-pool",
"saddle-finance",
"set-protocol",
"solana",
"solend",
"spookyswap",
"stake-dao",
"stellar",
"sushiswap",
"synthetix",
"terra",
"tezos",
"the-graph",
"thorchain",
"tokemak",
"tokenlon",
"tornado-cash",
"trader-joe",
"uma",
"uniswap",
"unit-protocol",
"venus",
"vesper-finance",
"volmex",
"wakaswap",
"yearn-finance",
"yield-guild-games",
"yield-yak",
"zcash",
"zora",
]
TIMELINES = ["24h", "7d", "30d", "90d", "180d", "365d"]

View File

@@ -37,7 +37,7 @@ def get_brnn_data(
model_save_name: str = "brnn_model",
force_reset: bool = True,
save_checkpoints: bool = True,
) -> Tuple[list[TimeSeries], List[TimeSeries], List[TimeSeries], Optional[float], Any]:
) -> Tuple[List[TimeSeries], List[TimeSeries], List[TimeSeries], Optional[float], Any]:
"""Performs Block RNN forecasting
Args:

View File

@@ -40,7 +40,7 @@ def get_expo_data(
n_predict: int = 30,
start_window: float = 0.85,
forecast_horizon: int = 5,
) -> Tuple[list[TimeSeries], List[TimeSeries], List[TimeSeries], Optional[float], Any]:
) -> Tuple[List[TimeSeries], List[TimeSeries], List[TimeSeries], Optional[float], Any]:
"""Performs Probabilistic Exponential Smoothing forecasting
This is a wrapper around statsmodels Holt-Winters' Exponential Smoothing;

View File

@@ -1,7 +1,7 @@
# pylint: disable=too-many-arguments
import os
import argparse
from typing import Any, Union, Optional, List, Dict
from typing import Any, Union, Optional, List, Dict, Tuple
from datetime import timedelta, datetime, time
import logging
import pandas as pd
@@ -614,7 +614,7 @@ def dt_format(x) -> str:
def get_series(
data: pd.DataFrame, target_column: str = None, is_scaler: bool = True
) -> tuple[Optional[Scaler], TimeSeries]:
) -> Tuple[Optional[Scaler], TimeSeries]:
filler = MissingValuesFiller()
filler_kwargs = dict(
df=data,

View File

@@ -43,7 +43,7 @@ def get_nhits_data(
model_save_name: str = "brnn_model",
force_reset: bool = True,
save_checkpoints: bool = True,
) -> Tuple[list[TimeSeries], List[TimeSeries], List[TimeSeries], Optional[float], Any]:
) -> Tuple[List[TimeSeries], List[TimeSeries], List[TimeSeries], Optional[float], Any]:
"""Performs Nhits forecasting
Args:

View File

@@ -473,7 +473,7 @@ en:
crypto/_exchange: Exchange
crypto/headlines: crypto sentiment from 15+ major news headlines
crypto/candle: view a candle chart for a specific cryptocurrency
crypto/prt: potential returns tool - check how much upside if ETH reaches BTC market cap
crypto/prt: potential returns (e.g. upside if ETH reaches BTC market cap)
crypto/disc: discover trending cryptocurrencies, top gainers, losers, top sentiment
crypto/ov: overview of the cryptocurrencies, market cap, DeFi, latest news, top exchanges, stables
crypto/onchain: information on different blockchains, eth gas fees, whale alerts, DEXes info
@@ -482,7 +482,7 @@ en:
crypto/nft: non-fungible tokens, today drops
crypto/dd: due-diligence for loaded coin, coin information, social media, market stats
crypto/ta: technical analysis for loaded coin, ema, macd, rsi, adx, bbands, obv
crypto/forecast: forecast techniques, rnn, nbeats, transformer, block rnn
crypto/forecast: forecast techniques, rnn, nbeats, transformer, block rnn
crypto/qa: quantitative analysis decompose, cusum, residuals analysis
crypto/disc/cgtop: top coins (with or without category)
crypto/disc/cgtrending: trending coins

View File

@@ -8,7 +8,7 @@ Interval (min):
headlines crypto sentiment from 15+ major news headlines [FinBrain]
[unvl] candle view a candle chart for a specific cryptocurrency[/unvl]
[unvl] prt potential returns tool - check how much upside if ETH reaches BTC market cap[/unvl] [CoinGecko]
[unvl] prt potential returns (e.g. upside if ETH reaches BTC market cap)[/unvl] [CoinGecko]
> disc discover trending cryptocurrencies, top gainers, losers, top sentiment
> ov overview of the cryptocurrencies, market cap, DeFi, latest news, top exchanges, stables
@@ -19,5 +19,5 @@ Interval (min):
[unvl]> dd due-diligence for loaded coin, coin information, social media, market stats[/unvl]
[unvl]> ta technical analysis for loaded coin, ema, macd, rsi, adx, bbands, obv[/unvl]
[unvl]> qa quantitative analysis decompose, cusum, residuals analysis[/unvl]
[unvl]> forecast forecast techniques, rnn, nbeats, transformer, block rnn[/unvl]
[unvl]> forecast forecast techniques, rnn, nbeats, transformer, block rnn[/unvl]