An open-source Python SDK for developing, testing, and deploying
institutional-grade trading strategies with an intent-based architecture
12 chains and 20+ protocol connectors including Uniswap, Aave, Morpho, GMX, Polymarket, and more.
Express trading logic as high-level intents like Swap, LP, and Borrow. The framework handles compilation and execution.
PnL simulation, paper trading on Anvil forks, Monte Carlo analysis, and parameter sweeps - all from the CLI.
Gateway security architecture, alerting, stuck detection, emergency management, and canary deployments built in.
FROM INSTALL TO PRODUCTION
pip install almanakInstall the SDK from PyPI. Requires Python 3.12+.
almanak strat newScaffold a new strategy from a template with config, tests, and environment setup.
almanak strat run --network anvil --onceRun your strategy on a local Anvil fork with auto-started gateway. Add --dashboard for live monitoring.
almanak strat runDeploy to production with non-custodial Safe smart accounts. Gateway architecture keeps secrets isolated.
FROM INSTALL TO PRODUCTION

pip install almanak - Install the SDK from PyPI. Requires Python 3.12+.

almanak strat new - Scaffold a new strategy from a template with config, tests, and environment setup.

almanak strat run --network anvil --once - Run your strategy on a local Anvil fork with auto-started gateway. Add --dashboard for live monitoring.

almanak strat run - Deploy to production with non-custodial Safe smart accounts. Gateway architecture keeps secrets isolated.
1class MyStrategy(Strategy):
2 """A simple rebalancing strategy."""
3
4 def configure(self):
5 self.token_a = self.config["token_a"]
6 self.token_b = self.config["token_b"]
7 self.threshold = self.config["rebalance_threshold"]
8
9 async def decide(self, state: StrategyState):
10 prices = state.prices
11 portfolio = state.portfolio
12
13 ratio = portfolio.value(self.token_a) / portfolio.total_value()
14
15 if abs(ratio - 0.5) > self.threshold:
16 return [
17 Swap(
18 from_token=self.token_a if ratio > 0.5 else self.token_b,
19 to_token=self.token_b if ratio > 0.5 else self.token_a,
20 amount_pct=abs(ratio - 0.5) * 100,
21 )
22 ]
23 return []
Scaffold, test on a local fork, backtest, and deploy - all from your terminal. Add --dashboard for live monitoring.
ACROSS 12 CHAINS
Connectors for DEXs, lending, perpetuals, prediction markets, liquid staking, and CEXs.
ALMANAK CODE
Terminal-based AI coding agent that understands your strategies. Chat interactively, debug code, and get workspace-aware assistance - all from your terminal.
Works with Claude, GPT-4, and other models. Choose the best model for your task.
Session history and context preserved across interactions. Pick up where you left off.
Bash execution, file read/write, grep, and glob - all available to the AI agent.
Define reusable agents and skills tailored to your workflow and strategy patterns.
./strategies/rebalancer.py. Here's what I found:PROTECTING CAPITAL
WITH INSTITUTIONAL GRADE SOLUTIONS
Full control over your funds through Safe smart accounts. No third party ever holds custody.
Strategy containers run with no secrets and no internet access. All external operations are mediated through a controlled gRPC gateway sidecar.
All strategy code is fully auditable. Backtest, paper trade, and stress test before deploying to production.









High-level intents compile to optimized transactions. Automatic pool selection, slippage management, and multi-step execution.
PnL simulation, Monte Carlo analysis, parameter sweeps, and paper trading on Anvil forks.
Real-time price feeds, technical indicators, and three-tier state management for reliability.
Built-in Slack/Telegram notifications, stuck detection, and a live CLI dashboard.