- Agent-First Design: Built specifically for creating autonomous on-chain agents
- DeFi-Native Syntax: Specialized syntax sugar for common DeFi operations
- AI/ML Integration: First-class support for machine learning models and strategies
- Agent Communication: Built-in protocols for agent-to-agent communication
- Safety First: Static typing and compile-time checks for on-chain safety
- Rapid Development: Create complex DeFi bots in just a few lines of code
import "solana/defi" as defi;
// Define pools with minimal syntax
pool raydium_sol_usdc SOL USDC {
fee = 0.3%
price = SOL/USDC
}
pool orca_sol_usdc SOL USDC {
fee = 0.3%
price = SOL/USDC
}
// Define arbitrage strategy
strategy arb_strategy {
entry {
(raydium_sol_usdc.price / orca_sol_usdc.price - 1) > 0.005
}
size {
min(1000, available_liquidity * 0.1)
}
}
// Create and run the bot
bot arb_bot {
pools = [raydium_sol_usdc, orca_sol_usdc]
strategy = arb_strategy
risk = 1%
}
// Define agent-to-agent message protocol
message OrderIntent {
token: str,
side: str,
amount: double,
price: double
}
// Agent communication channel
channel dex_orders {
broadcast: [OrderIntent],
subscribe: fun(handler: fun(OrderIntent) > void)
}
strategy mean_reversion {
entry {
price < ma(200) && rsi < 30
}
exit {
price > ma(200) || rsi > 70
}
size {
portfolio.value * 0.1
}
}
model price_predictor {
inputs {
price_history: [double],
volume_history: [double]
}
outputs {
predicted_price: double,
confidence: double
}
}
risk_manager {
max_position_size = 5%
stop_loss = 2%
take_profit = 5%
max_drawdown = 10%
}
# install locally at ~/.local
zig build -Doptimize=ReleaseSafe install -p ~/.local
# install globally at /usr/local
sudo zig build -Doptimize=ReleaseSafe install -p /usr/local
Contributions are welcome! Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.
MIT License - see the LICENSE file for details.