Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#930 - Remove CLI approach arg from predictoor #931

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Usage: pdr sim|predictoor|trader|..

Main tools:
pdr sim YAML_FILE
pdr predictoor APPROACH YAML_FILE NETWORK
pdr predictoor YAML_FILE NETWORK
pdr trader APPROACH YAML_FILE NETWORK
...
```
Expand Down
4 changes: 2 additions & 2 deletions READMEs/predictoor.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ Update the rest of the config as desired.
Then, run a bot with modeling-on-the fly (approach 2). In console:

```console
pdr predictoor 2 my_ppss.yaml sapphire-testnet
pdr predictoor my_ppss.yaml sapphire-testnet
```

Your bot is running, congrats! Sit back and watch it in action. It will loop continuously.
Expand Down Expand Up @@ -190,7 +190,7 @@ Follow the same steps in [Deploy the Prediction Submitter Manager](#deploy-the-p
Then, run the bot. In console:

```console
pdr predictoor 2 my_ppss.yaml sapphire-mainnet
pdr predictoor my_ppss.yaml sapphire-mainnet
```

This is where there's real $ at stake. Good luck!
Expand Down
4 changes: 2 additions & 2 deletions READMEs/vps.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,13 @@ In `my_ppss.yaml` file, in `web3_pp` -> `development` section:
Then, run a bot with modeling-on-the fly (approach 2). In console:

```console
pdr predictoor 2 my_ppss.yaml development
pdr predictoor my_ppss.yaml development
```

Or, to be fancier: (a) add `nohup` so that the run keeps going if the ssh session closes, and (b) output to out.txt (c) observe output
```console
# start bot
nohup pdr predictoor 2 my_ppss.yaml development 1>out.txt 2>&1 &
nohup pdr predictoor my_ppss.yaml development 1>out.txt 2>&1 &

# observe output
tail -f out.txt
Expand Down
4 changes: 2 additions & 2 deletions pdr_backend/cli/cli_arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
HELP_MAIN = """
Main tools:
pdr sim PPSS_FILE
pdr predictoor APPROACH PPSS_FILE NETWORK
pdr predictoor PPSS_FILE NETWORK
pdr trader APPROACH PPSS_FILE NETWORK
pdr claim_OCEAN PPSS_FILE
pdr claim_ROSE PPSS_FILE
Expand Down Expand Up @@ -502,7 +502,7 @@ def print_args(arguments: Namespace):

# main tools
SimArgParser = _ArgParser_PPSS
PredictoorArgParser = _ArgParser_APPROACH_PPSS_NETWORK
PredictoorArgParser = _ArgParser_PPSS_NETWORK
TraderArgParser = _ArgParser_APPROACH_PPSS_NETWORK
ClaimOceanArgParser = _ArgParser_PPSS
ClaimRoseArgParser = _ArgParser_PPSS
Expand Down
10 changes: 5 additions & 5 deletions system_tests/test_predictoor_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def _test_predictoor_system(mock_feeds, mock_feed_contract, approach, caplog):
mock_web3_pp, mock_predictoor_ss = setup_mock_web3_pp(
mock_feeds, mock_feed_contract
)
mock_predictoor_ss.approach = approach

merged_ohlcv_df = Mock()

Expand All @@ -53,14 +54,13 @@ def _test_predictoor_system(mock_feeds, mock_feed_contract, approach, caplog):
return_value=merged_ohlcv_df,
):
# Mock sys.argv
sys.argv = ["pdr", "predictoor", str(approach), "ppss.yaml", "development"]
sys.argv = ["pdr", "predictoor", "ppss.yaml", "development"]

cli_module._do_main()

# Verifying outputs
assert "pdr predictoor: Begin" in caplog.text
assert "Arguments:" in caplog.text
assert f"APPROACH={approach}" in caplog.text
assert "PPSS_FILE=ppss.yaml" in caplog.text
assert "NETWORK=development" in caplog.text
assert "Feed: 5m binance BTC/USDT 0x1" in caplog.text
Expand All @@ -80,15 +80,15 @@ def test_predictoor_approach_1_system(
caplog,
):
_ = mock_verify_feed_dependencies
_test_predictoor_system(mock_feeds, mock_feed_contract, 1, caplog)
_test_predictoor_system(mock_feeds, mock_feed_contract, 2, caplog)


@patch("pdr_backend.ppss.ppss.PPSS.verify_feed_dependencies")
def test_predictoor_approach_3_system(
def test_predictoor_approach_2_system(
mock_verify_feed_dependencies,
mock_feeds,
mock_feed_contract,
caplog,
):
_ = mock_verify_feed_dependencies
_test_predictoor_system(mock_feeds, mock_feed_contract, 3, caplog)
_test_predictoor_system(mock_feeds, mock_feed_contract, 2, caplog)
Loading