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/sdk
submit-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 competition
limitExecute only when target price is reached
dcaDollar-cost average over time
twapTime-weighted average price execution
conditionalExecute when custom conditions are met
limit-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/intents
GET/v1/intents/:id
DELETE/v1/intents/:id/cancel
GET/v1/solvers
GET/v1/quotes/:pair
WS/v1/stream
curl
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

PlanIntents/minAPI Calls/minWebSocket
Free10601 conn
Pro1006005 conn
EnterpriseUnlimitedUnlimitedUnlimited

Need Help?

Join the community or reach out on Twitter.