Getting Started

Choose your integration path:

EVM Integration Guide

Start here if you're building on EVM chains. Covers environment setup, contract connections, and basic operations like opening positions and managing collateral.

WASM Integration Guide

For WASM-based chains and clients. Learn integration patterns with language-specific examples and deployment guidance.

Sai Core

Comprehensive documentation of the Sai smart contracts, modules, and architecture.

Core Modules

Perp Contract

Main perpetual futures contract handling position management, collateral, and settlement.

Perp: Borrowing Module

Borrowed funds management, interest rates, and liquidation mechanics.

Perp: Price Impact Module

How large trades affect pricing, slippage calculation, and execution costs.

Reference

Perp: State Variables

Complete reference of all smart contract state variables and their purposes.

Contract Addresses Reference

Mainnet and testnet deployment addresses for all Sai contracts.

WASM & EVM Integration

Platform-specific details for direct smart contract integration.

Sai Keeper

Query and subscribe to real-time data from the Sai protocol. Perfect for dashboards, bots, and analytics tools.

Getting Started

Core Concepts

Understand indexing, subscriptions, and how Keeper structures protocol data.

Client Setup

Get your GraphQL client configured and authenticated in minutes.

API Reference

Perp API

Query positions, orders, trades, and perpetual-specific data.

Liquidity Provider (LP) API

Access liquidity pool data, provider positions, and performance metrics.

Oracle API

Get price feeds and oracle data used throughout the protocol.

Fees API

Query fee structures, accruals, and historical fee data.

Examples

Examples: Queries

Copy-paste ready GraphQL queries for common use cases.

Examples: Subscriptions

See how to subscribe to real-time updates and build event-driven applications.

Advanced

Filters & Pagination

Master filtering, sorting, and pagination for efficient large-scale data retrieval.

Last updated