Metadata-Version: 2.5
Name: almanak
Version: 3.0.0
Summary: Almanak SDK: explicit protocol inputs for autonomous DeFi strategies
Project-URL: Homepage, https://almanak.co
Project-URL: Documentation, https://sdk.docs.almanak.co
Author-email: Almanak <engineering@almanak.co>
License-Expression: Apache-2.0
License-File: LICENSE
License-File: third_party/Curve-StableSwap-NG-20231115-LICENSE.txt
License-File: third_party/Curve-StableSwap-NG-20231212-LICENSE.txt
License-File: third_party/Curve-TriCrypto-NG-v2.0.0-LICENSE.txt
License-File: third_party/Curve-TwoCrypto-NG-v2.1.0-LICENSE.txt
License-File: third_party/FastLZ-LICENSE.txt
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Office/Business :: Financial :: Investment
Requires-Python: >=3.12
Requires-Dist: eth-abi<7,>=6.0.0
Requires-Dist: eth-account<0.15,>=0.14.0
Requires-Dist: eth-hash[pycryptodome]<0.9,>=0.8
Requires-Dist: eth-utils<7,>=6.0.0
Requires-Dist: httpx<0.29,>=0.28
Requires-Dist: pydantic<3,>=2.12
Requires-Dist: python-dotenv<2,>=1.2.4
Requires-Dist: pyyaml<7,>=6
Provides-Extra: code
Requires-Dist: pyright>=1.1.414; extra == 'code'
Provides-Extra: ta
Requires-Dist: numpy<3,>=2; extra == 'ta'
Requires-Dist: ta-lib<0.9,>=0.6; extra == 'ta'
Description-Content-Type: text/markdown

# 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+.

```sh
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

```sh
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](https://sdk.docs.almanak.co).
