-
Notifications
You must be signed in to change notification settings - Fork 183
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (51 loc) · 2.81 KB
/
Copy pathMakefile
File metadata and controls
65 lines (51 loc) · 2.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
.PHONY: backtest sandbox install update test check native-develop native-debug-develop clear-pmxt-cache clear-telonex-cache clear-polymarket-cache download-pmxt-raws download-telonex-data
PMXT_CACHE_ROOT ?= $(if $(XDG_CACHE_HOME),$(XDG_CACHE_HOME),$(HOME)/.cache)/nautilus_trader/pmxt
PMXT_LOCAL_DATA_ROOT ?= /Volumes/storage/pmxt_data
TELONEX_CACHE_ROOT ?= $(if $(XDG_CACHE_HOME),$(XDG_CACHE_HOME),$(HOME)/.cache)/nautilus_trader/telonex
POLYMARKET_CACHE_ROOT ?= $(if $(XDG_CACHE_HOME),$(XDG_CACHE_HOME),$(HOME)/.cache)/nautilus_trader/polymarket_trades
DESTINATION ?=
PMXT_RAW_DOWNLOAD_FLAGS ?=
TELONEX_DATA_DESTINATION ?= /Volumes/storage/telonex_data
TELONEX_DOWNLOAD_FLAGS ?=
backtest:
uv run python main.py
sandbox:
uv run python main.py --mode sandbox
install:
unset CONDA_PREFIX && uv venv --python 3.13 && uv pip install "nautilus_trader[polymarket,visualization]==1.226.0" bokeh plotly numpy py-clob-client duckdb textual nbformat nbclient ipykernel optuna python-dotenv aiohttp pytest ruff
check:
uv run ruff check .
uv run ruff format --check .
uv run pytest tests/ -q
test: check
native-develop:
unset CONDA_PREFIX && uv run --with "maturin>=1.12,<2" maturin develop --release --manifest-path crates/python/Cargo.toml --uv
native-debug-develop:
unset CONDA_PREFIX && uv run --with "maturin>=1.12,<2" maturin develop --manifest-path crates/python/Cargo.toml --uv
clear-pmxt-cache:
@python3 scripts/_cache_clear_guard.py --name PMXT_CACHE_ROOT --target "$(PMXT_CACHE_ROOT)" --unsafe "$(PMXT_LOCAL_DATA_ROOT)" --unsafe "$(TELONEX_DATA_DESTINATION)" --unsafe "$(DESTINATION)"
rm -rf "$(PMXT_CACHE_ROOT)"
mkdir -p "$(PMXT_CACHE_ROOT)"
du -sh "$(PMXT_CACHE_ROOT)"
clear-telonex-cache:
@python3 scripts/_cache_clear_guard.py --name TELONEX_CACHE_ROOT --target "$(TELONEX_CACHE_ROOT)" --unsafe "$(TELONEX_DATA_DESTINATION)" --unsafe "$(PMXT_LOCAL_DATA_ROOT)" --unsafe "$(DESTINATION)"
rm -rf "$(TELONEX_CACHE_ROOT)"
mkdir -p "$(TELONEX_CACHE_ROOT)"
du -sh "$(TELONEX_CACHE_ROOT)"
clear-polymarket-cache:
@python3 scripts/_cache_clear_guard.py --name POLYMARKET_CACHE_ROOT --target "$(POLYMARKET_CACHE_ROOT)" --unsafe "$(TELONEX_DATA_DESTINATION)" --unsafe "$(PMXT_LOCAL_DATA_ROOT)" --unsafe "$(DESTINATION)"
rm -rf "$(POLYMARKET_CACHE_ROOT)"
mkdir -p "$(POLYMARKET_CACHE_ROOT)"
du -sh "$(POLYMARKET_CACHE_ROOT)"
download-pmxt-raws:
@if [ -z "$(DESTINATION)" ]; then echo "Set DESTINATION=/path"; exit 2; fi
uv run python scripts/pmxt_download_raws.py \
--destination "$(DESTINATION)" \
$(PMXT_RAW_DOWNLOAD_FLAGS)
download-telonex-data:
uv run python scripts/telonex_download_data.py \
--destination "$(TELONEX_DATA_DESTINATION)" \
$(TELONEX_DOWNLOAD_FLAGS)
update:
@echo "No vendored Nautilus subtree remains in this branch."
@echo "Bump the upstream nautilus_trader version and port prediction_market_extensions/ as needed."