-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Finish #51: Add local README for each stakeholder Changes in this PR - Add predictoor README - Refactor existing READMEs. Now everything works together harmoniuosly - Add placeholders for remote networks
- Loading branch information
Showing
12 changed files
with
219 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!-- | ||
Copyright 2023 Ocean Protocol Foundation | ||
SPDX-License-Identifier: Apache-2.0 | ||
--> | ||
|
||
# Using Predictoor Subgraph | ||
|
||
### Querying | ||
|
||
You can query [subgraph](http://172.15.0.15:8000/subgraphs/name/oceanprotocol/ocean-subgraph/graphql) and see [this populated data PR](https://github.com/oceanprotocol/ocean-subgraph/pull/678) here for entities. | ||
|
||
### Filtering | ||
|
||
Here are additional envvars used to filter: | ||
|
||
- PAIR_FILTER = if we do want to act upon only same pair, like "BTC/USDT,ETH/USDT" | ||
- TIMEFRAME_FILTER = if we do want to act upon only same timeframes, like "5m,15m" | ||
- SOURCE_FILTER = if we do want to act upon only same sources, like "binance,kraken" | ||
- OWNER_ADDRS = if we do want to act upon only same publishers, like "0x123,0x124" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<!-- | ||
Copyright 2023 Ocean Protocol Foundation | ||
SPDX-License-Identifier: Apache-2.0 | ||
--> | ||
|
||
# Usage for Predictoors | ||
|
||
This is for predictoors - people who are running `predictoor` agents to submit individual predictions. | ||
|
||
## Contents | ||
|
||
- [Install](#install) | ||
- [Local Usage](#local-usage) | ||
- [Remote Testnet Usage](#remote-testnet-usage) | ||
- [Remote Mainnet Usage](#remote-mainnet-usage) | ||
|
||
## Install | ||
|
||
First, [install pdr-backend](install.md). | ||
|
||
Then, [install barge](barge.md#install-barge). | ||
|
||
## Local Usage | ||
|
||
In barge console: | ||
```console | ||
#run barge with all agents except predictoor | ||
./start_ocean.sh --predictoor --with-pdr-trueval --with-pdr-trader --with-pdr-publisher --with-pdr-dfbuyer | ||
``` | ||
|
||
Open a new console and: | ||
``` | ||
# Setup virtualenv | ||
cd pdr-backend | ||
source venv/bin/activate | ||
# Set envvars | ||
export ADDRESS_FILE="${HOME}/.ocean/ocean-contracts/artifacts/address.json" | ||
export RPC_URL=http://127.0.0.1:8545 | ||
export SUBGRAPH_URL="http://172.15.0.15:8000/subgraphs/name/oceanprotocol/ocean-subgraph" | ||
export PRIVATE_KEY="0xef4b441145c1d0f3b4bc6d61d29f5c6e502359481152f869247c7a4244d45209" | ||
# run predictoor agent | ||
python3 pdr_backend/predictoor/main.py | ||
``` | ||
|
||
Relax & watch as the predictoor agent submits random predictions, trueval submits random true_vals for each epoch and trader signals trades. | ||
|
||
You can query predictoor subgraph for detailed run info. See [subgraph.md](subgraph.md) for details. | ||
|
||
The agent predicts according to the `predict()` function in [`pdr_backend/predictoor/predict.py`](../pdr_backend/predictoor/predict.py). Its default strategy is simplistic (random predictions). So you need to customize it. The docstring at the top of `predict.py` provides more info. | ||
|
||
## Remote Testnet Usage | ||
|
||
FIXME | ||
|
||
## Remote Mainnet Usage | ||
|
||
FIXME | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!-- | ||
Copyright 2023 Ocean Protocol Foundation | ||
SPDX-License-Identifier: Apache-2.0 | ||
--> | ||
|
||
# Using Predictoor Subgraph | ||
|
||
### Querying | ||
|
||
You can query [subgraph](http://172.15.0.15:8000/subgraphs/name/oceanprotocol/ocean-subgraph/graphql) and see [this populated data PR](https://github.com/oceanprotocol/ocean-subgraph/pull/678) here for entities. | ||
|
||
### Filtering | ||
|
||
Here are additional envvars used to filter: | ||
|
||
- PAIR_FILTER = if we do want to act upon only same pair, like "BTC/USDT,ETH/USDT" | ||
- TIMEFRAME_FILTER = if we do want to act upon only same timeframes, like "5m,15m" | ||
- SOURCE_FILTER = if we do want to act upon only same sources, like "binance,kraken" | ||
- OWNER_ADDRS = if we do want to act upon only same publishers, like "0x123,0x124" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<!-- | ||
Copyright 2023 Ocean Protocol Foundation | ||
SPDX-License-Identifier: Apache-2.0 | ||
--> | ||
|
||
# Usage for Traders | ||
|
||
This is for traders - people who are running `trader` agents that buy aggregated predictions, then trade. | ||
|
||
## Contents | ||
|
||
- [Install](#install) | ||
- [Local Usage](#local-usage) | ||
- [Remote Testnet Usage](#remote-testnet-usage) | ||
- [Remote Mainnet Usage](#remote-mainnet-usage) | ||
|
||
|
||
## Install | ||
|
||
First, [install pdr-backend](install.md). | ||
|
||
Then, [install barge](barge.md#install-barge). | ||
|
||
## Local Usage | ||
|
||
In barge console: | ||
```console | ||
#run barge with all agents except trader | ||
./start_ocean.sh --predictoor --with-pdr-trueval --with-pdr-predictoor --with-pdr-publisher --with-pdr-dfbuyer | ||
``` | ||
|
||
Open a new console and: | ||
``` | ||
# Setup virtualenv | ||
cd pdr-backend | ||
source venv/bin/activate | ||
# Set envvars | ||
export ADDRESS_FILE="${HOME}/.ocean/ocean-contracts/artifacts/address.json" | ||
export RPC_URL=http://127.0.0.1:8545 | ||
export SUBGRAPH_URL="http://172.15.0.15:8000/subgraphs/name/oceanprotocol/ocean-subgraph" | ||
export PRIVATE_KEY="0xef4b441145c1d0f3b4bc6d61d29f5c6e502359481152f869247c7a4244d45209" | ||
# run trader agent | ||
python3 pdr_backend/trader/main.py | ||
``` | ||
|
||
Relax & watch as the predictoor agent submits random predictions, trueval submits random true_vals for each epoch and trader signals trades. | ||
|
||
You can query predictoor subgraph for detailed run info. See [subgraph.md](subgraph.md) for details. | ||
|
||
The agent trades according to the `trade()` function in [`pdr_backend/trader/trade.py`](../pdr_backend/trader/trade.py). Its default strategy is simplistic; you need to customize it. The docstring at the top of `trade.py` provides more info. | ||
|
||
## Remote Testnet Usage | ||
|
||
FIXME | ||
|
||
## Remote Mainnet Usage | ||
|
||
FIXME | ||
|
||
## Final note | ||
|
||
As with all trading strategies, there's risk involved. Always trade responsibly. Nothing in this README or related should be considered financial advice. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
# Predictoor | ||
|
||
FIXME. This is a placeholder. Fill me in. | ||
See [READMEs/predictoor.md](../../READMEs/predictoor.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.