Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Grimoire

A language for expressing financial strategy with safety built in.

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.

Terminal
npm i -g @grimoirelabs/cli
grimoire simulate spells/my-strategy.spell --chain 1

Get started with the CLI →

Grimoire 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.

Terminal
curl -X POST https://api.grimoire.run/v1/run \
  -H "x-api-key: YOUR_KEY" \
  -d '{"intent": "Swap 100 USDC to ETH on Uniswap"}'

Explore the Platform →

How It Works

Write spell → Compile → Preview → (optional) Commit
  1. Write your strategy intent as a spell
  2. Compile validates syntax and structure
  3. Preview simulates the full execution plan without moving funds
  4. 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 CLIInstallation
Run my first spellQuick Start
Understand core conceptsCore Concepts
Use the Platform APIPlatform Getting Started
See supported protocolsVenues & Adapters