Grimoire
Grimoire lets you write strategies — called spells — in a readable format that compiles, validates, and executes across DeFi protocols. Every action goes through a safety pipeline before anything irreversible happens onchain.
Whether you're rebalancing a portfolio, swapping tokens, or managing lending positions, Grimoire gives you a structured, auditable way to do it.
Two Ways to Use Grimoire
Open Source (CLI & Library)
Install the Grimoire CLI and run spells locally. Write strategies in the .spell format, simulate them against live protocol data, and execute when ready.
Best for: developers, quant teams, and agents who want full control over strategy authoring and execution.
npm i -g @grimoirelabs/cli
grimoire simulate spells/my-strategy.spell --chain 1Grimoire Platform (API)
A cloud API that adds natural language intents, policy enforcement, clarification sessions, and sandboxed execution on top of the open source engine.
Best for: platforms, portfolio managers, and teams who want to integrate strategy validation and execution via API without running infrastructure.
curl -X POST https://api.grimoire.run/v1/run \
-H "x-api-key: YOUR_KEY" \
-d '{"intent": "Swap 100 USDC to ETH on Uniswap"}'How It Works
Write spell → Compile → Preview → (optional) Commit- Write your strategy intent as a spell
- Compile validates syntax and structure
- Preview simulates the full execution plan without moving funds
- Commit executes onchain only when the preview is safe
This preview-then-commit model means you always see what will happen before it does.
Quick Links
| I want to... | Go to |
|---|---|
| Install the CLI | Installation |
| Run my first spell | Quick Start |
| Understand core concepts | Core Concepts |
| Use the Platform API | Platform Getting Started |
| See supported protocols | Venues & Adapters |