Tagline: "I don't think. I execute."
Nexwave Kernel is a deterministic DeFi execution kernel for Solana. It receives structured intents (e.g., swap 500 USDC for SOL with max 0.5% slippage), validates constraints, simulates via Jupiter, executes on-chain, and returns verified outcomes.
This kernel is designed to be called by external services (like Clawdbot skills) via HTTP. It does NOT handle natural language — it receives structured intent objects and returns structured results.
- ✅ Deterministic Execution: Validates constraints before execution
- ✅ Jupiter Integration: Fetches real-time quotes and executes swaps
- ✅ Constraint Validation: Enforces slippage limits, deadlines, minimum outputs
- ✅ Transaction Simulation: Simulates on-chain before execution
- ✅ Structured Logging: JSON-formatted logs for all operations
- ✅ Error Handling: Clear, actionable error messages with recoverability flags
- Runtime: Bun
- Language: TypeScript (strict mode)
- HTTP Framework: Hono
- Solana: @solana/web3.js
- Jupiter: @jup-ag/api (v6)
- Validation: Zod
- Base58 Encoding: bs58
cd ~/var/www/nexwave-kernel
bun installCopy .env.example to .env and configure:
cp .env.example .envEdit .env:
# Solana RPC endpoint (using Helius for better performance)
# Get your API key from: https://www.helius.dev/
SOLANA_RPC_URL=https://mainnet.helius-rpc.com/?api-key=YOUR_HELIUS_API_KEY
# Wallet private key (base58 encoded)
# Export from Phantom: Settings > Export Private Key
# Or generate with: solana-keygen new
WALLET_PRIVATE_KEY=your_base58_private_key_here
# Server port
PORT=3456
# Helius API Configuration (optional - for enhanced features)
HELIUS_API_KEY=YOUR_HELIUS_API_KEY
HELIUS_RPC_URL=https://mainnet.helius-rpc.com/?api-key=YOUR_HELIUS_API_KEYRecommended: Use Helius RPC instead of the public endpoint for:
- Higher rate limits
- Better reliability
- Faster transaction processing
- Priority routing
bun run devbun startThe server will start on http://localhost:3456.
Check kernel health status.
Response:
{
"status": "ok",
"version": "0.1.0",
"solanaConnected": true,
"jupiterConnected": true
}Validate constraints and simulate a swap without executing.
Request:
{
"action": "swap",
"inputToken": "USDC",
"outputToken": "SOL",
"amount": "100",
"constraints": {
"maxSlippageBps": 50,
"deadlineMs": 1706400000000,
"minOutput": "0.8"
}
}Success Response:
{
"success": true,
"quote": {
"inputAmount": "100",
"outputAmount": "0.802451275",
"priceImpactPct": 0.00018500503912435758,
"slippageBps": 50,
"route": ["USDC", "SOL"]
}
}Error Response (constraint violation):
{
"success": false,
"error": "Slippage 80bps exceeds max 50bps",
"recoverable": true
}Validate, simulate, and execute a swap on-chain.
Request: Same as /intent/simulate
Success Response:
{
"success": true,
"txHash": "5xyz...",
"explorerUrl": "https://solscan.io/tx/5xyz...",
"outcome": {
"inputAmount": "100",
"outputAmount": "0.802451275",
"actualSlippageBps": 28
}
}Error Response:
{
"success": false,
"error": "Wallet not configured",
"recoverable": false
}The kernel includes a built-in registry of common Solana tokens:
- SOL - Solana (wrapped)
- USDC - USD Coin
- USDT - Tether USD
- BONK - Bonk
- JUP - Jupiter
You can also use Solana mint addresses directly.
Before execution, the kernel validates:
- Deadline (if provided): Must be in the future
- Max Slippage: Must be between 1-500 bps (0.01% - 5%)
- Amount: Must be positive
- Tokens: Must be recognized (in registry or valid Solana address)
After simulation, before execution:
- Slippage Check: Simulated slippage must be ≤ maxSlippageBps
- Min Output (if provided): Simulated output must be ≥ minOutput
curl -X POST http://localhost:3456/intent/simulate \
-H "Content-Type: application/json" \
-d '{
"action": "swap",
"inputToken": "USDC",
"outputToken": "SOL",
"amount": "100",
"constraints": {
"maxSlippageBps": 50
}
}'# Test invalid slippage (too high)
curl -X POST http://localhost:3456/intent/simulate \
-H "Content-Type: application/json" \
-d '{
"action": "swap",
"inputToken": "USDC",
"outputToken": "SOL",
"amount": "100",
"constraints": {
"maxSlippageBps": 600
}
}'
# Expected: Error "Max slippage must not exceed 500bps (5%)"nexwave-kernel/
├── src/
│ ├── index.ts # Hono server entry point
│ ├── routes/
│ │ ├── intent.ts # POST /intent/simulate, POST /intent/execute
│ │ └── health.ts # GET /health
│ ├── core/
│ │ ├── types.ts # Intent, Constraint, ExecutionResult types
│ │ ├── validator.ts # Zod schemas + constraint validation
│ │ ├── simulator.ts # Jupiter quote fetching + simulation
│ │ └── executor.ts # Transaction building, signing, sending
│ ├── adapters/
│ │ └── jupiter.ts # Jupiter API wrapper
│ └── utils/
│ ├── tokens.ts # Token mint addresses, decimals lookup
│ └── logger.ts # Structured logging
├── .env.example
├── .env
├── package.json
├── tsconfig.json
└── README.md
All errors include:
success: boolean (alwaysfalsefor errors)error: string (human-readable error message)recoverable: boolean (whether retrying might succeed)
Recoverable errors (temporary, can retry):
- Network issues
- Slippage too tight for current market
- Insufficient liquidity
Non-recoverable errors (permanent, don't retry):
- Invalid token
- Wallet not configured
- Invalid intent format
All logs are JSON-formatted with:
timestamp: ISO 8601 timestamplevel: "info" | "warn" | "error" | "debug"message: Human-readable messagedata: Structured data (optional)
Example:
{
"timestamp": "2026-01-27T02:36:30.814Z",
"level": "info",
"message": "Nexwave Kernel starting",
"data": {
"version": "0.1.0",
"port": 3456,
"rpcUrl": "https://api.mainnet-beta.solana.com"
}
}- Private keys are never logged or exposed in responses
- All transactions are simulated before execution
- Constraint validation happens before any on-chain interaction
- Failed transactions don't consume SOL (simulation catches errors)
A Clawdbot skill (~/.clawdbot/skills/nexwave/) enables natural language DeFi trading via Telegram:
Example conversation:
User: "Swap 0.01 SOL for USDC"
Bot: "⚡ Quote: 0.01 SOL → 1.27 USDC
Slippage: 0.5% | Price Impact: 0.00%
Reply 'yes' to execute"
User: "yes"
Bot: "⚡ Executed! TX: https://solscan.io/tx/5xyz..."
The skill handles:
- Natural language parsing → structured intents
- Simulation-first workflow (always shows quote)
- User confirmation requirement
- Transaction result formatting
// Simulate a swap
const simulation = await fetch('http://localhost:3456/intent/simulate', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
action: 'swap',
inputToken: 'USDC',
outputToken: 'SOL',
amount: '500',
constraints: { maxSlippageBps: 50 }
})
});
const result = await simulation.json();
if (result.success) {
console.log(`Quote: ${result.quote.outputAmount} SOL`);
console.log(`Slippage: ${result.quote.slippageBps}bps`);
// Ask user for confirmation, then execute
const execution = await fetch('http://localhost:3456/intent/execute', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(intent)
});
const execResult = await execution.json();
if (execResult.success) {
console.log(`TX: ${execResult.explorerUrl}`);
}
}- Bun automatically loads
.env(no need for dotenv) - TypeScript runs with strict mode enabled
- All validation uses Zod schemas
- Jupiter API client is initialized per-request for thread safety
- Limit orders
- Bot orchestration (launch/monitor/kill trading bots)
- Multi-chain execution
- Position monitoring
- Portfolio rebalancing
MIT
For issues or questions, check the logs:
tail -f /tmp/nexwave-kernel.logBuilt for the Nexwave ecosystem. I don't think. I execute. ⚡