diff --git a/pdr_backend/ppss/predictoor_ss.py b/pdr_backend/ppss/predictoor_ss.py index 7b66df013..96bee1c79 100644 --- a/pdr_backend/ppss/predictoor_ss.py +++ b/pdr_backend/ppss/predictoor_ss.py @@ -73,6 +73,12 @@ def revenue(self) -> Eth: def s_until_epoch_end(self) -> int: return self.d["bot_only"]["s_until_epoch_end"] + @property + def s_cutoff(self) -> int: + if "s_cutoff" not in self.d["bot_only"]: + return 10 + return self.d["bot_only"]["s_cutoff"] + # -------------------------------- # setters (add as needed) @enforce_types diff --git a/pdr_backend/predictoor/predictoor_agent.py b/pdr_backend/predictoor/predictoor_agent.py index 6d0fef93c..65861a866 100644 --- a/pdr_backend/predictoor/predictoor_agent.py +++ b/pdr_backend/predictoor/predictoor_agent.py @@ -121,6 +121,8 @@ def take_step(self): # within the time window to predict? if self.cur_epoch_s_left > self.epoch_s_thr: return + if self.cur_epoch_s_left < self.s_cutoff: + return logger.info(self.status_str()) @@ -168,6 +170,11 @@ def epoch_s_thr(self): """Start predicting if there's > this time left""" return self.ppss.predictoor_ss.s_until_epoch_end + @property + def s_cutoff(self): + """Stop predicting if there's < this time left""" + return self.ppss.predictoor_ss.s_cutoff + @property def s_per_epoch(self) -> int: return self.feed.seconds_per_epoch @@ -193,6 +200,7 @@ def status_str(self) -> str: s += f", target_slot={self.target_slot}" s += f". {self.cur_epoch_s_left} s left in epoch" s += f" (predict if <= {self.epoch_s_thr} s left)" + s += f" (stop predictions if <= {self.s_cutoff} s left)" s += f". s_per_epoch={self.s_per_epoch}" return s diff --git a/ppss.yaml b/ppss.yaml index 972267f94..6b7066438 100644 --- a/ppss.yaml +++ b/ppss.yaml @@ -3,8 +3,8 @@ lake_ss: parquet_dir: parquet_data feeds: - binance BTC/USDT ETH/USDT 5m -# - binance BTC/USDT ETH/USDT BNB/USDT XRP/USDT ADA/USDT DOGE/USDT SOL/USDT LTC/USDT TRX/USDT DOT/USDT 5m -# - kraken BTC/USDT 5m + # - binance BTC/USDT ETH/USDT BNB/USDT XRP/USDT ADA/USDT DOGE/USDT SOL/USDT LTC/USDT TRX/USDT DOT/USDT 5m + # - kraken BTC/USDT 5m st_timestr: 2023-06-01_00:00 # starting date for data fin_timestr: now # ending date for data @@ -12,7 +12,7 @@ predictoor_ss: predict_feed: binance BTC/USDT c 5m approach: 2 # 1->50/50; 2->model-based stake_amount: 100 # How much your bot stakes. In OCEAN per epoch, per feed - + sim_only: others_stake: 10000 # How much all others' bots stake. In OCEAN per epoch, per feed. Calcs: stake volume = 10e6 $/day/20_feeds = 34700 $/epoch/20_feeds (bc 288 5m epochs/day) = 1735 $/epoch/feed = 2313 OCEAN/epoch/feed (at 1 OCEAN=$0.75) others_accuracy: 0.50001 # What percent of others' bots stake is correct. Value in range 0.0-1.0. 0.50001 means mostly 50-50 stake and some small fry predicting a bit accurately @@ -20,12 +20,13 @@ predictoor_ss: bot_only: s_until_epoch_end: 60 # in s. Start predicting if there's > this time left - + s_cutoff: 20 # in s. Stop predicting if there's < this time left + aimodel_ss: input_feeds: - binance BTC/USDT ETH/USDT c 5m max_n_train: 5000 # no. epochs to train model on - autoregressive_n : 1 # no. epochs that model looks back, to predict next + autoregressive_n: 1 # no. epochs that model looks back, to predict next approach: LinearLogistic trader_ss: @@ -49,7 +50,7 @@ trader_ss: sim_ss: # sim only do_plot: True log_dir: logs - test_n : 2000 # number of epochs to simulate + test_n: 2000 # number of epochs to simulate exchange_only: timeout: 30000 options: @@ -76,16 +77,16 @@ publisher_ss: trueval_ss: feeds: - binance BTC/USDT 5m -# - binance BTC/USDT ETH/USDT BNB/USDT XRP/USDT ADA/USDT DOGE/USDT SOL/USDT LTC/USDT TRX/USDT DOT/USDT 5m -# - kraken BTC/USDT 5m + # - binance BTC/USDT ETH/USDT BNB/USDT XRP/USDT ADA/USDT DOGE/USDT SOL/USDT LTC/USDT TRX/USDT DOT/USDT 5m + # - kraken BTC/USDT 5m batch_size: 30 sleep_time: 30 dfbuyer_ss: feeds: - binance BTC/USDT 5m -# - binance BTC/USDT ETH/USDT BNB/USDT XRP/USDT ADA/USDT DOGE/USDT SOL/USDT LTC/USDT TRX/USDT DOT/USDT 5m -# - kraken BTC/USDT 5m + # - binance BTC/USDT ETH/USDT BNB/USDT XRP/USDT ADA/USDT DOGE/USDT SOL/USDT LTC/USDT TRX/USDT DOT/USDT 5m + # - kraken BTC/USDT 5m batch_size: 20 consume_interval_seconds: 86400 weekly_spending_limit: 37000 @@ -95,7 +96,7 @@ payout_ss: topup_ss: addresses: - - opf_addresses + - opf_addresses # - 0xabcd... # min_bal: 20 # topup_bal: 30 @@ -103,9 +104,7 @@ topup_ss: # ------------------------------------------------------------------ # Network settings - web3_pp: - sapphire-testnet: address_file: "~/.ocean/ocean-contracts/artifacts/address.json" rpc_url: https://testnet.sapphire.oasis.dev @@ -147,8 +146,8 @@ web3_pp: deployment_configs: testnet_predictoor_deployment: - cpu: '1' - memory: '512Mi' + cpu: "1" + memory: "512Mi" source: "binance" type: "predictoor" approach: 3 @@ -156,11 +155,11 @@ deployment_configs: s_until_epoch_end: 20 pdr_backend_image_source: "oceanprotocol/pdr-backend:latest" agents: - - pair: 'BTC/USDT' + - pair: "BTC/USDT" stake_amt: 0.1 timeframe: 5m approach: 1 - - pair: 'ETH/USDT' + - pair: "ETH/USDT" stake_amt: 1 timeframe: 1h s_until_epoch_end: 100