Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
7582ccc
delete many dirs and unit tests. pytest passing, now takes 67.5 s
trentmc Jan 27, 2025
dc5e778
rm analytics/; remove barge from pytest.yml; revive multisim in test_…
trentmc Jan 27, 2025
c07332b
merge with main: update pull_request_template.md
trentmc Jan 27, 2025
f87fd02
chop down to just supporting 'sim', 'ohlcv'
trentmc Jan 27, 2025
a2611e4
pytest passing
trentmc Jan 27, 2025
5ec0bab
black
trentmc Jan 27, 2025
d4a1a52
wip pylint
trentmc Jan 27, 2025
1270ce0
fully remove ta features
trentmc Jan 27, 2025
848c9c7
removing RelDiff transform
trentmc Jan 27, 2025
d05f646
more pruned; pytest & black passing
trentmc Jan 27, 2025
44d296f
all tests and linters pass
trentmc Jan 27, 2025
15d87af
revive coverage
trentmc Jan 27, 2025
f6c2430
remove dependency
trentmc Jan 27, 2025
d6b9c96
update readmes
trentmc Jan 27, 2025
1c8e8a1
remove Dockerfile
trentmc Jan 28, 2025
294cc72
tweak
trentmc Jan 28, 2025
3253013
Fix #1722 (in branch): TypeError: Expected str for time_str, got date…
trentmc Jan 28, 2025
c87ddd8
reinstate Dockerfile, we need it for CI
trentmc Jan 28, 2025
cfefef2
Merge branch 'main' into tdr
trentmc Jan 28, 2025
2c60f7d
fix pylint issues. Now pytest & linters are happy
trentmc Jan 28, 2025
86645ee
Merge branch 'tdr' of https://github.com/oceanprotocol/pdr-backend in…
trentmc Jan 28, 2025
bbfa1b2
Merge branch 'main' into tdr
trentmc Jan 28, 2025
3479175
profiling support
trentmc Jan 28, 2025
41abdae
move dev info into sim.md. Add profiling instrs. Add TOC and links to…
trentmc Jan 28, 2025
15991a2
don't strip dirs
trentmc Jan 28, 2025
f4bbe44
fix pylint issues wrt view_stats
trentmc Jan 28, 2025
2b70a12
strip sim_state to even simpler
trentmc Jan 28, 2025
0a17a7b
tweak
trentmc Jan 28, 2025
0eaa85f
simplify gitignore
trentmc Jan 28, 2025
d83a54b
log conf_up/down, # trades
trentmc Jan 28, 2025
a631eef
Bug fixes: (a) keep conf_up and conf_down in [0,1]; (b) increment num…
trentmc Jan 28, 2025
aae606d
tweak
trentmc Jan 28, 2025
89fcfe1
Add: center model on most recently seen price
trentmc Jan 28, 2025
86a8419
bug fix
trentmc Jan 29, 2025
d2caa2b
remove all var importance stuff
trentmc Jan 29, 2025
1e94998
remove multi_id
trentmc Jan 29, 2025
fa1c9e6
Track percent trade
trentmc Jan 29, 2025
1e2e7ab
In sim, track model accuracy: all pred'ns, and pred'ns where I actual…
trentmc Jan 29, 2025
1308baf
add CIs to model accuracy report
trentmc Jan 29, 2025
e6a660d
Fix #1724: BUG: test_time_types.py::test_dt_now_UTC_1 fails
trentmc Jan 29, 2025
334f70f
remove copyright
trentmc Jan 29, 2025
00bd0ae
add save_xy and test
trentmc Jan 29, 2025
bb59214
add xy csv
trentmc Jan 30, 2025
8b387f8
bug fix
trentmc Jan 30, 2025
c84db14
ppss.yaml settings for generating many Xy files over years
trentmc Jan 30, 2025
6a9008d
tweak
trentmc Jan 31, 2025
5993f8e
bug fix: only save Xy when model is built, not every iter
trentmc Jan 31, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 0 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
##
## Copyright 2024 Ocean Protocol Foundation
## SPDX-License-Identifier: Apache-2.0
##

# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
##
## Copyright 2024 Ocean Protocol Foundation
## SPDX-License-Identifier: Apache-2.0
##
name: Black

on:
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/check_mainnet.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
##
## Copyright 2024 Ocean Protocol Foundation
## SPDX-License-Identifier: Apache-2.0
##
name: Run Mainnet Check and Notify Slack

on:
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/check_testnet.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
##
## Copyright 2024 Ocean Protocol Foundation
## SPDX-License-Identifier: Apache-2.0
##
name: Run Script and Notify Slack

on:
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/cron_topup.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
##
## Copyright 2024 Ocean Protocol Foundation
## SPDX-License-Identifier: Apache-2.0
##
name: Topup accounts

on:
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
##
## Copyright 2024 Ocean Protocol Foundation
## SPDX-License-Identifier: Apache-2.0
##
name: MyPy Static Typechecking

on:
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
##
## Copyright 2024 Ocean Protocol Foundation
## SPDX-License-Identifier: Apache-2.0
##
name: Pylint Style Tests

on:
Expand Down
28 changes: 1 addition & 27 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
##
## Copyright 2024 Ocean Protocol Foundation
## SPDX-License-Identifier: Apache-2.0
##
name: pdr-backend tests

on:
Expand All @@ -26,39 +22,17 @@ jobs:
with:
python-version: "3.11"

- uses: actions/checkout@v2
name: Checkout Barge
with:
repository: "oceanprotocol/barge"
path: "barge"
ref: "5bd4a318c732d84a6b7fbeb193cee7fb16891a67"

- name: Run Barge
working-directory: ${{ github.workspace }}/barge
env:
SUBGRAPH_VERSION: main
run: |
bash -x start_ocean.sh --no-aquarius --no-elasticsearch --no-provider --no-dashboard --with-thegraph --predictoor > start_ocean.log &

- name: Install dependencies
working-directory: ${{ github.workspace }}
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest

- name: Wait for contracts deployment
working-directory: ${{ github.workspace }}/barge
run: |
for i in $(seq 1 250); do
sleep 5
[ -f "$HOME/.ocean/ocean-contracts/artifacts/ready" ] && break
done

- name: Test with pytest
id: pytest
run: |
coverage run --source=pdr_backend --omit=*/test/*,*/test_ganache/*,*/test_noganache/* -m pytest
coverage run --source=pdr_backend --omit=*/test/*,*/test_noganache/* -m pytest
coverage report
coverage xml
- name: Publish code coverage
Expand Down
101 changes: 6 additions & 95 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,69 +58,9 @@ cover/
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
Expand All @@ -131,59 +71,30 @@ ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
.test_cache/
.cache/
dir/

# predictoor-specific
out*.txt
my_ppss.yaml
my_ppss_profiling.yaml
my_ppss_makemoney.yaml
my_logging.yaml
logs/
csvs/
parquet_data/
lake_data/
xy_dir/
xy_data/
pdr_predictions.parquet

# sim state
sim_state

# pdr_backend accuracy output
pdr_backend/accuracy/output/*.json

# lakeinfo output
validate_duplicate_rows.csv

# agent deployer
.keys.json
.deployments/
#profiling
profile.stats
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ ignore=
Dockerfile,
entrypoint.sh,
pdr_backend.egg-info,
copyright_template.tmpl
profile.stats

# Add files or directories matching the regex patterns to the blacklist. The
# regex matches against base names, not paths.
Expand Down
38 changes: 4 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

## Run bots (agents)

- **[Run predictoor bot](READMEs/predictoor.md)** - make predictions, make $
- **[Run trader bot](READMEs/trader.md)** - consume predictions, trade, make $

(If you're a predictoor or trader, you can safely ignore the rest of this README.)
- **[Run sim/trading](READMEs/sim.md)** - predict, trade, make $. Historical, live mock, or live real.

## Settings: PPSS

Expand Down Expand Up @@ -36,52 +33,29 @@ pdr
This will output something like:

```text
Usage: pdr sim|predictoor|trader|..
Usage: pdr sim|trader|..

Main tools:
pdr sim YAML_FILE
pdr predictoor YAML_FILE NETWORK
pdr trader APPROACH YAML_FILE NETWORK
pdr trader APPROACH YAML_FILE livemock|livereal (FIXME)
...
```

## Atomic READMEs

- [Get tokens](READMEs/get-tokens.md): [testnet faucet](READMEs/testnet-faucet.md), [mainnet ROSE](READMEs/get-rose-on-sapphire.md) & [OCEAN](READMEs/get-ocean-on-sapphire.md)
- [Claim payout for predictoor bot](READMEs/payout.md)
- [Predictoor subgraph](READMEs/subgraph.md). [Subgraph filters](READMEs/filters.md)
- [Run barge locally](READMEs/barge.md)

## Flows for core team

- Backend-dev - for `pdr-backend` itself
- [Local dev flow](READMEs/dev.md)
- Local dev flow: see [sim](READMEs/sim.md)
- [VPS dev flow](READMEs/vps.md)
- [Release process](READMEs/release-process.md)
- [Clean code guidelines](READMEs/clean-code.md)
- [Dependency management](READMEs/dependencies.md)
- [Run dfbuyer bot](READMEs/dfbuyer.md) - runs Predictoor DF rewards
- [Run publisher](READMEs/publisher.md) - publish new feeds
- [Run trueval](READMEs/trueval.md) - run trueval bot
- [Run lake](READMEs/lake-and-etl.md) - run data lake

## Repo structure

This repo implements all bots in Predictoor ecosystem. Here are each of the sub-directories in the repo.

Main bots & user tools:

- `predictoor` - submit individual predictions
- `trader` - buy aggregated predictions, then trade
- `sim` - experiments / simulation flow
- `payout` - OCEAN & ROSE payout

OPF-run bots & higher-level tools:

- `trueval` - report true values to contract
- `dfbuyer` - buy feeds on behalf of Predictoor DF
- `publisher` - publish pdr data feeds
- `deployer` - deployer tool

Mid-level building blocks:

Expand All @@ -93,11 +67,7 @@ Data-level building blocks:
- `ohlcv` - financial data pipeline
- `aimodel` - AI/ML modeling engine
- `lake` - data lake and analytics tools
- `subgraph` - blockchain queries, complements lake
- `accuracy` - to report % correct in webapp
- `pred_submitter` - for predictoor bots to submit >>1 predictions in 1 tx

Lower-level utilities:

- `contract` - classes to wrap blockchain contracts; some simple data structures
- `util` - function-based tools
Loading