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 can subscribe to trading pairs, receive real-time price updates, and initiate swaps. 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-based subscription for price updates.
  • 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:
Sub-APIBase PathPurpose
Maker API/api/v1/Market data, quotes, swap orders, and LSPS1 channel operations
RLN API/rln/v1/RGB Lightning Node operations — wallet, channels, and payments
The Maker API is publicly accessible and handles all trading and liquidity operations. The RLN API connects to your own RGB Lightning Node and requires a running node instance.

Which API do I need?

GoalAPIEndpoint group
Get available assets or trading pairsMaker APIMarket APIs
Get a price quote for a swapMaker APIMarket APIs
Create or track a swap orderMaker APISwap APIs
Order a Lightning channel from an LSPMaker APIRGB LSPS1 APIs
Stream real-time pricesMaker API (WebSocket)Swap Protocol
Check wallet balance or node infoRLN APIRequires your own node
Send/receive BTC or RGB assetsRLN APIRequires your own node
Open or close Lightning channelsRLN APIRequires your own node
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: No authentication is required for most Maker API endpoints. Public market data (assets, pairs, quotes) and swap creation are open. Planned: Bearer token authentication (Authorization: Bearer <token>) will be introduced for rate-limited or permissioned endpoints in a future release. The API playground is pre-configured with bearer auth for when it is required.

Base Response Format

All API responses follow a consistent JSON structure. Successful responses return the requested data directly as a JSON object or array. Error responses use the following format:
{
  "error": "error_code",
  "message": "Human-readable description of the error"
}
HTTP status codes follow standard conventions:
StatusMeaning
200Success
400Bad request — invalid parameters
404Resource not found
422Unprocessable entity — validation error
500Internal server error
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 KaleidoSwap SDKs 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