Almanak

Open-source agent harness that writes and runs DeFi strategies

Advanced API
Screenshot of Almanak, Open-source agent harness that writes and runs DeFi strategies

What is Almanak?

Almanak is an open-source (Apache-2.0) agent harness for DeFi. Describe a strategy and Almanak Code writes it, then the harness checks, backtests, rehearses on a mainnet fork and runs it from your own Safe.

Almanak is an open-source agent harness for DeFi, released under Apache-2.0 and built for Python 3.12 or newer. Its central idea is to separate whoever writes a strategy from what that strategy is allowed to do. A user describes an idea in plain language, and Almanak Code, an agent bundled with the SDK, produces a strategy.py and a config.yaml, then validates them with the same almanak check command the harness applies to everything it runs. The same strategy code moves through three modes without being rewritten: backtest, fork rehearsal and live execution. Backtests replay the actual strategy against prepared historical datasets offline, with the window, costs, inventory and cadence set in one YAML file. Every run produces an HTML report and can be reproduced exactly, and missing measurements stay visible instead of being filled in by guesswork. Rehearsals run on a disposable mainnet fork using real contracts, simulated funds and generated Safe permissions. Going live happens from the user's own Safe, and a run can be paused, resumed or torn down at any time. The safety model is the main reason to pick it over a loose script. Strategy code runs in a sandbox with no network access, no secrets and no ability to sign. Each action it proposes passes a gateway that checks it against the Zodiac Roles permissions on the Safe before anything is sent. Funds and positions remain in the Safe, and Almanak never takes custody. Pending transactions, accounting and outcomes are recorded, so a run resumes after a restart. The audience is developers, quantitative builders and technically confident DeFi operators who are comfortable in a terminal. More than 40 reference strategies ship with the SDK, covering lending and leverage loops on Aave, Compound, Morpho and Spark, concentrated liquidity on Uniswap, PancakeSwap and Aerodrome, indicator-based trading and GMX perpetuals, across 9 chains. Compared with hosted bots or vault products, it is code-first and self-managed. Users who prefer another coding agent can point it at the docs and llms.txt, and the harness checks that agent's work the same way.

How do you use Almanak?

  1. 1Install the harness
    Install the Almanak SDK with Python 3.12 or newer, following the getting started guide. Almanak Code ships inside the SDK, so nothing extra is needed.
    Almanak — Install the harness
  2. 2Describe your strategy
    Run almanak in a terminal and tell Almanak Code what you want in a sentence. It writes strategy.py and config.yaml and verifies them with almanak check.
  3. 3Backtest it offline
    Set the window, inventory, cadence and costs in the YAML file and replay the strategy on historical data. Review the HTML report to see how it behaved.
    Almanak — Backtest it offline
  4. 4Rehearse on a mainnet fork
    Run the strategy against real contracts on a disposable fork with simulated funds and generated Safe permissions before risking capital.
    Almanak — Rehearse on a mainnet fork
  5. 5Go live from your Safe
    Run the strategy from your own Safe, with the gateway enforcing its permissions. Pause, resume or tear it down whenever you choose.

Almanak pros and cons

Pros

  • Same strategy code runs in backtest, fork rehearsal and production, so results carry over between stagesAI
  • Sandboxed strategies with no network, secrets or signing, plus gateway checks against Zodiac Roles permissionsAI
  • Funds stay in your own Safe and Almanak never takes custody, with access revocable at any timeAI
  • 40+ reference strategies across lending, liquidity, indicators and GMX perpetuals give a working starting pointAI
  • Open source under Apache-2.0, with reproducible backtests and an HTML report for every runAI

Cons

  • Terminal-first workflow that needs Python 3.12+, so it is a poor fit for users who want a no-code interfaceAI
  • Requires setting up a Safe with Zodiac Roles, which adds onboarding effort for newcomers to DeFiAI
  • Protocol and chain coverage is limited to the SDK's support list (nine chains and the named protocols)AI
  • Strategy quality still depends on the user's own judgment, since backtests and fork runs cannot guarantee live resultsAI

Almanak pricing

Pricing

The homepage presents Almanak as open source under the Apache-2.0 license and lists no paid plans or prices.

Learn more

Support

A documentation site covers getting started, backtesting and examples, and it includes a dedicated support page.

Learn more

Integrations

Works with Aave, Compound, Morpho, Spark, Uniswap, Curve, Aerodrome, PancakeSwap and GMX across 9 chains, and with Safe and Zodiac Roles. Other coding agents can be pointed at the docs and llms.txt.

Learn more

Features

Almanak Code writes strategies from plain language, backed by almanak check. Offline reproducible backtests with HTML reports, mainnet fork rehearsals, sandboxed strategy code, gateway checks against Safe Zodiac Roles, restart recovery and 40+ reference strategies.

Learn more

Frequently asked questions about Almanak

  • Is Almanak free?
    Yes, Almanak is listed as free to use.
  • How much does Almanak cost?
    The homepage presents Almanak as open source under the Apache-2.0 license and lists no paid plans or prices.
  • Does Almanak have an API?
    Yes, Almanak offers an API.
  • How do you use Almanak?
    The walkthrough on this page covers 5 steps: 1. Install the harness 2. Describe your strategy 3. Backtest it offline 4. Rehearse on a mainnet fork 5. Go live from your Safe.
  • What platforms does Almanak support?
    Almanak is available on MacOS, Linux and Windows.
  • What does Almanak integrate with?
    Works with Aave, Compound, Morpho, Spark, Uniswap, Curve, Aerodrome, PancakeSwap and GMX across 9 chains, and with Safe and Zodiac Roles. Other coding agents can be pointed at the docs and llms.txt.

Status

StatusActive
Views0
Outbound clicks0
Added12/5/2026

Platforms

MacOSLinuxWindows

Pricing

Free