Skip to content

Commit

Permalink
Fix #942 - Move pred_submitter_mgr under bot_only (#950)
Browse files Browse the repository at this point in the history
* Move pred_submitter_mgr under bot_only

* Formatting
  • Loading branch information
trizin authored Apr 29, 2024
1 parent 2cd7c1a commit 9e87b23
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
5 changes: 3 additions & 2 deletions READMEs/predictoor.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,13 @@ pdr deploy_pred_submitter_mgr my_ppss.yaml sapphire-testnet

#### Update YAML config with the contract address

Next, update `my_ppss.yaml` and input the contract address in place of `predictoor_ss.pred_submitter_mgr`:
Next, update `my_ppss.yaml` and input the contract address in place of `predictoor_ss.bot_only.pred_submitter_mgr`:

```
predictoor_ss:
...
pred_submitter_mgr: "CONTRACT_ADDRESS"
bot_only:
pred_submitter_mgr: "CONTRACT_ADDRESS"
...
```

Expand Down
4 changes: 2 additions & 2 deletions pdr_backend/ppss/predictoor_ss.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def s_until_epoch_end(self) -> int:

@property
def pred_submitter_mgr(self) -> str:
return self.d["pred_submitter_mgr"]
return self.d["bot_only"]["pred_submitter_mgr"]

# --------------------------------
# setters (add as needed)
Expand Down Expand Up @@ -180,13 +180,13 @@ def predictoor_ss_test_dict(
"predict_train_feedsets": feedset_list,
"approach": 1,
"stake_amount": 1,
"pred_submitter_mgr": pred_submitter_mgr,
"sim_only": {
"others_stake": 2313,
"others_accuracy": 0.50001,
"revenue": 0.93007,
},
"bot_only": {
"pred_submitter_mgr": pred_submitter_mgr,
"s_until_epoch_end": 60,
"s_start_payouts": 0,
},
Expand Down
6 changes: 4 additions & 2 deletions pdr_backend/predictoor/test/test_predictoor_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ def _test_predictoor_agent_main(
monkeypatch,
)
assert ppss.predictoor_ss.approach == approach
ppss.predictoor_ss.d["pred_submitter_mgr"] = pred_submitter_mgr.contract_address
ppss.predictoor_ss.d["bot_only"][
"pred_submitter_mgr"
] = pred_submitter_mgr.contract_address
feed_contracts = ppss.web3_pp.query_feed_contracts()
web3_config = ppss.web3_pp.web3_config
w3 = ppss.web3_pp.w3
Expand Down Expand Up @@ -349,7 +351,7 @@ def test_calc_stakes_across_feeds(tmpdir, monkeypatch):
)
feed_contracts = ppss.web3_pp.query_feed_contracts()
predictoor_ss = ppss.predictoor_ss
predictoor_ss.d["pred_submitter_mgr"] = "0x1"
predictoor_ss.d["bot_only"]["pred_submitter_mgr"] = "0x1"
predictoor_ss.d["stake_amount"] = 1.0
predictoor_ss.d["bot_only"]["s_until_epoch_end"] = 50000
web3_config = ppss.web3_pp.web3_config
Expand Down
2 changes: 1 addition & 1 deletion ppss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ predictoor_ss:
- binance BTC/USDT ETH/USDT c 5m
approach: 2 # 1->50/50; 2->two-sided model-based; 3-> one-sided model-based
stake_amount: 100 # How much your bot stakes. In OCEAN per epoch, per feed
pred_submitter_mgr: "DeployNewMgr" # DeployNewMgr | <address of deployed mgr>
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
revenue: 0.93006 # Sales revenue going towards predictoors. In OCEAN per epoch, per feed. Calcs: 37500 OCEAN/week/20_feeds (Predictoor DF rewards) = 18.6012 OCEAN/epoch/20_feeds (bc 2016 5m epochs/week) = 0.93006 OCEAN/epoch/feed

bot_only:
pred_submitter_mgr: "DeployNewMgr" # DeployNewMgr | <address of deployed mgr>
s_start_payouts: 220 # in s. Run payout if > this time left. 0 to disable
s_until_epoch_end: 60 # in s. Start predicting if > this time left

Expand Down

0 comments on commit 9e87b23

Please sign in to comment.