Skip to main content
The RGB Lightning DEX API allows interaction with an RGB Lightning Service Provider (RGB-LSP) that provides liquidity on request and enables swap functionalities. The swap protocol operates on a taker-maker model, where clients request live quotes for trading pairs and initiate swaps against them. The API also supports the RGB LSPS1 (Lightning Service Provider Specification) for managing channels and liquidity services.

Key Features

  • RGB LSPS1 (Lightning Service Provider Specification) Support: Liquidity services and swap functionalities.
  • Real-time Market Data: WebSocket request/response quote streaming (quote_request/quote_response).
  • Swap Protocol: Taker-maker model for initiating and executing swaps.
  • Asset and Trading Pair Management: Comprehensive API for fetching supported assets and pairs.
Proceed to Getting Started to begin.

Two Sub-APIs

The KaleidoSwap API is split into two distinct services: The Maker API is publicly accessible and handles all trading and liquidity operations. The RLN API is the REST API served directly at the root of your own RGB Lightning Node (e.g. http://<node>:3001/nodeinfo) and requires a running node instance.

Which API do I need?

The interactive API playground below runs against the Signet environment (https://api.signet.kaleidoswap.com). Use it for exploration and testing. For production, use the mainnet URL once available.

Authentication

Current state: Anonymous access works for all Maker API endpoints. Bearer API keys (Authorization: Bearer <token>) are already accepted and attributed today — keys carry scopes such as quote:read (market data and quotes) and swap:execute (swap init/execute) — but enforcement is rolling out gradually, so requests without a key are still served. The API playground is pre-configured with bearer auth. Rolling out: Once enforcement is enabled, requests with a missing or invalid key will receive 401 responses. Integrations should start sending an API key now to be ready.

Base Response Format

All API responses follow a consistent JSON structure. Successful responses return the requested data directly as a JSON object or array. Errors use one of three envelopes. Application errors (invalid parameters, missing resources, conflicts, rate limits, server errors) return a structured envelope:
Request-validation errors (schema validation failures, HTTP 422) return FastAPI’s validation envelope:
Legacy errors: a few endpoints still return some 400 responses as a bare detail object, without error_code or request_id — for example an unsupported route on /market/quote or a malformed pair_ticker filter on /market/pairs:
HTTP status codes follow standard conventions: See Error Handling for a complete list of error codes.

Rate Limits

Rate limits apply to all API endpoints. Requests that exceed the limit receive a 429 Too Many Requests response. Specific limits vary by endpoint and environment. When building integrations, implement exponential backoff for retries and cache static data (assets, pairs) locally where possible.

Using the SDK

Instead of calling the REST API directly, you can use the official KaleidoSDK libraries that wrap these endpoints with type safety and convenience methods:

TypeScript SDK

Auto-generated typed client from the OpenAPI spec with client.maker.* and client.rln.* sub-clients

Python SDK

Synchronous Python client with Pydantic models, using the same sub-client architecture