Documentation
Everything you need to integrate intent-based execution.
# Quick Start
Install the Kairos SDK and submit your first intent in under 2 minutes.
Terminal
npm install @kairos/sdksubmit-intent.ts
import { Kairos } from "@kairos/sdk";
import { Connection, Keypair } from "@solana/web3.js";
const kairos = new Kairos({
connection: new Connection("https://api.mainnet-beta.solana.com"),
wallet: yourKeypair,
});
// Submit a simple swap intent
const result = await kairos.submit({
type: "swap",
inputMint: "So11111111111111111111111111111111111111112",
outputMint: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
amount: 100_000_000_000, // 100 SOL in lamports
maxSlippage: 10, // 0.1% in bps
});
console.log("Intent ID:", result.intentId);
console.log("Fill price:", result.fillPrice);
console.log("Solver:", result.solver);# Intent Types
Kairos supports multiple intent types beyond simple swaps.
swapInstant token swap with solver competitionlimitExecute only when target price is reacheddcaDollar-cost average over timetwapTime-weighted average price executionconditionalExecute when custom conditions are metlimit-order.ts
const limit = await kairos.submit({
type: "limit",
inputMint: USDC,
outputMint: SOL,
amount: 5000_000_000, // 5000 USDC
limitPrice: 20.00, // Buy SOL at $20
expiry: "24h",
});# API Reference
REST API endpoints for programmatic access.
POST/v1/intentsGET/v1/intents/:idDELETE/v1/intents/:id/cancelGET/v1/solversGET/v1/quotes/:pairWS/v1/streamcurl
curl -X POST https://api.kairos.trade/v1/intents \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "swap",
"inputMint": "So111...112",
"outputMint": "EPjFW...Dt1v",
"amount": 100000000000,
"maxSlippage": 10
}'# SDK Usage
The TypeScript SDK wraps the REST API with type safety and wallet integration.
advanced-usage.ts
import { Kairos, IntentStatus } from "@kairos/sdk";
const kairos = new Kairos({ connection, wallet });
// Submit with WebSocket status tracking
const intent = await kairos.submit({
type: "swap",
inputMint: SOL,
outputMint: USDC,
amount: 50_000_000_000,
maxSlippage: 5,
});
// Listen to real-time updates
intent.on("solver_bid", (bid) => {
console.log(`Solver ${bid.solver} bid: ${bid.price}`);
});
intent.on("filled", (fill) => {
console.log(`Filled at ${fill.price} by ${fill.solver}`);
console.log(`Improvement: ${fill.improvement} bps vs AMM`);
});
intent.on("failed", (error) => {
console.error("Intent failed:", error.reason);
// Tokens returned automatically
});# For Solvers
Register as a solver and start competing for order flow. Permissionless — stake collateral and you're in.
solver.ts
import { KairosSolver } from "@kairos/solver-sdk";
const solver = new KairosSolver({
connection,
wallet: solverKeypair,
stake: 500_000_000_000, // 500 SOL collateral
});
// Register on-chain
await solver.register();
// Listen for intents and bid
solver.on("new_intent", async (intent) => {
const route = await findBestRoute(intent);
if (route.profitable) {
await solver.bid({
intentId: intent.id,
fillPrice: route.price,
route: route.path,
});
}
});
// Handle won auctions
solver.on("auction_won", async (auction) => {
const tx = await solver.execute(auction);
console.log("Executed:", tx.signature);
});# Configuration
kairos.config.ts
import { KairosConfig } from "@kairos/sdk";
const config: KairosConfig = {
// Network
cluster: "mainnet-beta",
commitment: "confirmed",
// Execution preferences
auctionWindow: 200, // ms - solver competition time
maxSolvers: 20, // max solvers per auction
preferredSolvers: [], // whitelist specific solvers
// MEV protection
privacy: "sealed-bid", // "sealed-bid" | "public" | "private"
jitoBundle: true, // use Jito for MEV protection
// Fallback
fallbackToAmm: true, // if no solver bids, use AMM directly
fallbackTimeout: 5000, // ms before fallback
};# Rate Limits
| Plan | Intents/min | API Calls/min | WebSocket |
|---|---|---|---|
| Free | 10 | 60 | 1 conn |
| Pro | 100 | 600 | 5 conn |
| Enterprise | Unlimited | Unlimited | Unlimited |
Need Help?
Join the community or reach out on Twitter.