Describe
Tell Almanak Code what you want. It writes strategy.py and config.yaml and checks its own work with almanak check.
Almanak is an open-source agent harness for DeFi. Describe a strategy and Almanak Code writes it. The harness checks it, backtests it, rehearses it on a fork and runs it, with your funds in your own Safe.
uv tool install almanak





Almanak Code writes the strategy, and the harness runs the same code in every mode, from a backtest to mainnet.
Tell Almanak Code what you want. It writes strategy.py and config.yaml and checks its own work with almanak check.
Replay the strategy on historical data, offline. Any run can be reproduced exactly.
Run it on a mainnet fork with simulated funds and generated Safe permissions.
Go live from your own Safe. Pause, resume or tear it down whenever you choose.
Strategy code never holds a key, whoever wrote it. It runs in a sandbox with no network and no secrets. Every action it proposes passes a gateway that checks it against the permissions on your Safe.

strategy.py + config.yamlchecked by almanak checkno network · no secrets · can't signruns the strategy codeproviders · operator key · gassends only what is allowedfunds and positions stay hererevoke access at any timeStrategy code runs with no network, no secrets and no way to sign.
Every action is checked against your Safe's Zodiac Roles before anything is sent.
Funds and positions stay in your Safe. Almanak never takes custody.
Pending transactions, accounting and outcomes are recorded, so a run picks up where it left off.
Run almanak and Almanak Code starts in your terminal. It ships inside the SDK, works from the SDK's own docs, source and reference strategies, and checks every strategy with the same almanak check the harness runs.
Backtests run your actual strategy code against prepared historical data, offline, with the window, costs and inventory you choose. Then rehearse it on a disposable mainnet fork: real contracts, simulated funds.
40+ reference strategies ship with the SDK, to fork, study or hand to Almanak Code.
Supply, borrow and loop on Aave, Compound, Morpho and Spark, with the unwind written into the strategy.
Open, recentre and close concentrated positions on Uniswap, PancakeSwap and Aerodrome inside a band you approve.
Act on RSI, moving averages or ATR breakouts computed from the price series the strategy declares.
Borrow on one protocol and trade or provide liquidity on another, all from one fund.
Open, manage and close GMX V2 positions, with stop-loss and take-profit exits.
almanak support --referencesAave, Compound, Morpho, Spark, Uniswap, Curve, Aerodrome, PancakeSwap and GMX across 9 chains, taken straight from the SDK's support list.
Protocols //













Install the harness, run almanak and describe what you want.
uv tool install almanak