Almanak SDK
Almanak is a Python SDK for writing, checking, backtesting and operating
autonomous DeFi strategies. A strategy consists of two author-maintained files:
strategy.py, which makes decisions, and config.yaml, which states the
economic choices the strategy may use.
The same strategy definition runs in historical evaluation, identified forks and supported production environments. The SDK keeps network access, secrets, signing, durable execution and protocol mechanics outside strategy code.
Version 3.0.0 is the first release of the rewritten SDK. Projects built on the
2.x line should pin almanak<3.
Installation
Requires Python 3.12+.
uv add almanak # as a project dependency
uv tool install almanak # the command-line tool only
Optional extras:
| Extra | Enables |
|---|---|
ta |
Technical analysis over declared strategy price series (numpy, TA-Lib) |
code |
Python LSP for the bundled Almanak Code agent (pyright) |
Local strategy hook execution is verified on Linux and requires Bubblewrap
(sudo apt-get install bubblewrap libseccomp2 on Debian or Ubuntu). Fork runs
also require Foundry's anvil.
Usage
almanak check path/to/strategy
almanak backtest run path/to/strategy --backtest-config backtest.yaml \
--gateway-config operator.yaml --env-file .env --output runs/test
almanak run path/to/strategy --fork --gateway-config operator.fork.yaml \
--env-file .env --output runs/demo
almanak support lists the connectors, chains, actions and run modes that
admission accepts.
Documentation
Guides, the CLI reference and the strategy API are at sdk.docs.almanak.co.
Metadata
Release files for almanak 3.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| almanak-3.0.0.tar.gz | 1.5 MB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| almanak-3.0.0-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details |
| almanak-3.0.0-py3-none-manylinux_2_17_x86_64.whl | Python 3 | none | Linux glibc 2.17+ x86-64 | Details |
| almanak-3.0.0-py3-none-manylinux_2_17_aarch64.whl | Python 3 | none | Linux glibc 2.17+ ARM64 | Details |
| almanak-3.0.0-py3-none-macosx_11_0_x86_64.whl | Python 3 | none | macOS 11.0+ x86-64 | Details |
| almanak-3.0.0-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details |
Total release size: 215.8 MB
Release files / almanak-3.0.0.tar.gz
| Download URL | almanak-3.0.0.tar.gz |
|---|---|
| Size | 1.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bbee4f1c425fbc7a88b101c99710e701ded609224041230a59ab8d7f21753a1f
|
|
BLAKE2b-256 checksum How to use checksums |
154e43462e3b34f1f2e11c163a808b79d58e99999567323db722c0f793a63751
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / almanak-3.0.0-py3-none-win_amd64.whl
| Download URL | almanak-3.0.0-py3-none-win_amd64.whl |
|---|---|
| Size | 49.0 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
1d2789971cce1d979bd3fe6fb13022723b8a0237c7bb142fe83f9cfded3ab3e0
|
|
BLAKE2b-256 checksum How to use checksums |
1cdd94d2d48c6cb3ce6b040e612b2d09a0b1707b97b295fcdf725da9edc51da0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / almanak-3.0.0-py3-none-manylinux_2_17_x86_64.whl
| Download URL | almanak-3.0.0-py3-none-manylinux_2_17_x86_64.whl |
|---|---|
| Size | 46.3 MB |
| Tags | Linux glibc 2.17+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
9dcc07e1004c959793463641959f4f3cfb84841b0ce94e5609f7efc80f22c365
|
|
BLAKE2b-256 checksum How to use checksums |
1fc59d619688c8e92bc0f9d9347589817a46458408199ed55ba56428382674d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / almanak-3.0.0-py3-none-manylinux_2_17_aarch64.whl
| Download URL | almanak-3.0.0-py3-none-manylinux_2_17_aarch64.whl |
|---|---|
| Size | 46.1 MB |
| Tags | Linux glibc 2.17+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
fd8e53b6820abb8d49560ef22ea30996f0e666feb8091c8f5e8221018e450812
|
|
BLAKE2b-256 checksum How to use checksums |
d24d8a3d172b9b7b051be25f3ba7b8677fb1af71886539d8f46fff51aca8033c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / almanak-3.0.0-py3-none-macosx_11_0_x86_64.whl
| Download URL | almanak-3.0.0-py3-none-macosx_11_0_x86_64.whl |
|---|---|
| Size | 37.6 MB |
| Tags | Python 3 macOS 11.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
39ef7bf64bf476d7b4e49746ef2c747bc67b9899314124690bbbe4bfd2c25f0b
|
|
BLAKE2b-256 checksum How to use checksums |
bd1e0946bd0b0cade221e1cb2943fa85db4e829eef65cdbaaf372e606ee8e774
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / almanak-3.0.0-py3-none-macosx_11_0_arm64.whl
| Download URL | almanak-3.0.0-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 35.3 MB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
d12ebccfed168a878a33a408c64a35f5b72ae07cafd063a88095a0f4aaff9777
|
|
BLAKE2b-256 checksum How to use checksums |
f76abea81308f00ebed01eaf3f3d125f768469db71839582d1b602eba6dbd6df
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|