# Getting Started

Build powerful applications on top of Sai's perpetual futures protocol. Whether you're creating trading bots, analytics dashboards, or custom integrations, this documentation will guide you through the process.

## Quick Start

Choose your integration path based on your development environment:

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>EVM Integration Guide</strong></td><td>Start here if you're building on EVM chains. Covers environment setup, contract connections, and basic operations like opening positions and managing collateral</td><td><a href="/pages/x6GuM73eIeBDLjPxeM3A">/pages/x6GuM73eIeBDLjPxeM3A</a></td></tr><tr><td><strong>WASM Integration Guide</strong></td><td>For WASM-based chains and clients. Learn integration patterns with language-specific examples and deployment guidance</td><td><a href="/pages/WKMKMdJjhQKkSZuv6kK2">/pages/WKMKMdJjhQKkSZuv6kK2</a></td></tr></tbody></table>

***

## Sai Core

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

### Core Modules

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Perp Contract</strong></td><td>Main perpetual futures contract handling position management, collateral, and settlement</td><td><a href="/pages/CnCG6He36sdAh0t6mVAQ">/pages/CnCG6He36sdAh0t6mVAQ</a></td></tr><tr><td><strong>Borrowing Module</strong></td><td>Borrowed funds management, interest rates, and liquidation mechanics</td><td><a href="/pages/b5Yoh7EqOvFi8DajOqK0">/pages/b5Yoh7EqOvFi8DajOqK0</a></td></tr><tr><td><strong>Price Impact Module</strong></td><td>How large trades affect pricing, slippage calculation, and execution costs</td><td><a href="/pages/oIXiIdPoelXFFUwpf7D9">/pages/oIXiIdPoelXFFUwpf7D9</a></td></tr></tbody></table>

### Reference Documentation

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>State Variables</strong></td><td>Complete reference of all smart contract state variables and their purposes</td><td><a href="/pages/8vcCjjPMps4y8aQcoA7O">/pages/8vcCjjPMps4y8aQcoA7O</a></td></tr><tr><td><strong>Contract Addresses Reference</strong></td><td>Mainnet and testnet deployment addresses for all Sai contracts</td><td><a href="/pages/Cc4tHnR3Je2ywLa2sbbC">/pages/Cc4tHnR3Je2ywLa2sbbC</a></td></tr><tr><td><strong>WASM &#x26; EVM Integration</strong></td><td>Platform-specific details for direct smart contract integration</td><td><a href="/pages/evVIrw02t9H2IFuGuWEw">/pages/evVIrw02t9H2IFuGuWEw</a></td></tr></tbody></table>

***

## Sai Keeper

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

### Getting Started

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Core Concepts</strong></td><td>Understand indexing, subscriptions, and how Keeper structures protocol data</td><td><a href="/pages/wkWgBSrkIGBpygzvw8tl">/pages/wkWgBSrkIGBpygzvw8tl</a></td></tr><tr><td><strong>Client Setup</strong></td><td>Get your GraphQL client configured and authenticated in minutes</td><td><a href="/pages/9bUolmzdEVNrHHABKeij">/pages/9bUolmzdEVNrHHABKeij</a></td></tr></tbody></table>

### API Reference

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Perp API</strong></td><td>Query positions, orders, trades, and perpetual-specific data</td><td><a href="/pages/jAAxsXY92TQmt1Prwyex">/pages/jAAxsXY92TQmt1Prwyex</a></td></tr><tr><td><strong>Liquidity Provider (LP) API</strong></td><td>Access liquidity pool data, provider positions, and performance metrics</td><td><a href="/pages/nSP7xqSeaRwEXjWyOrYz">/pages/nSP7xqSeaRwEXjWyOrYz</a></td></tr><tr><td><strong>Oracle API</strong></td><td>Get price feeds and oracle data used throughout the protocol</td><td><a href="/pages/qtCydifRnuxRW8Y4L1SC">/pages/qtCydifRnuxRW8Y4L1SC</a></td></tr><tr><td><strong>Fees API</strong></td><td>Query fee structures, accruals, and historical fee data</td><td><a href="/pages/IW1ai9xwPD43gLU5zd4A">/pages/IW1ai9xwPD43gLU5zd4A</a></td></tr></tbody></table>

### Examples & Advanced Usage

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Examples: Queries</strong></td><td>Copy-paste ready GraphQL queries for common use cases</td><td><a href="/pages/3bJuD90rJtFUL5eL7OLe">/pages/3bJuD90rJtFUL5eL7OLe</a></td></tr><tr><td><strong>Examples: Subscriptions</strong></td><td>See how to subscribe to real-time updates and build event-driven applications</td><td><a href="/pages/DTpzlxWT14kpG0oP7Adj">/pages/DTpzlxWT14kpG0oP7Adj</a></td></tr><tr><td><strong>Filters &#x26; Pagination</strong></td><td>Master filtering, sorting, and pagination for efficient large-scale data retrieval</td><td><a href="/pages/OH8OSiYwwfzuuIXbykP1">/pages/OH8OSiYwwfzuuIXbykP1</a></td></tr></tbody></table>

***

## Use Cases

Practical integration examples and real-world applications built on Sai.

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Telegram Bot Integration</strong></td><td>Build a Telegram trading bot with position monitoring, alerts, and order execution</td><td><a href="/pages/bzk5b2zHGvi61jze31O7">/pages/bzk5b2zHGvi61jze31O7</a></td></tr></tbody></table>

***

## Developer Resources

**Need help or want to connect with other builders?**

* 🐦 [X / Twitter](https://github.com/NibiruChain/sai-docs/blob/main/dev/__https:/x.com/SaiDotFun__/README.md) - @SaiDotFun
* 📢 [Telegram News Channel](https://github.com/NibiruChain/sai-docs/blob/main/dev/__https:/t.me/saidotfun__/README.md) - t.me/saidotfun
* 📸 [Instagram](https://github.com/NibiruChain/sai-docs/blob/main/dev/__https:/instagram.com/saidotfun__/README.md) - instagram.com/saidotfun
* 🎵 [TikTok](https://github.com/NibiruChain/sai-docs/blob/main/dev/__https:/www.tiktok.com/@saidotfun__/README.md) - @saidotfun
* ▶️ [YouTube](https://github.com/NibiruChain/sai-docs/blob/main/dev/__https:/www.youtube.com/@saidotfun__/README.md) - @saidotfun

**Additional Resources:**

* [Contract Addresses](/for-devs/sai-core/contracts.md) - Quick reference for all deployed contracts
* [GraphQL Playground](https://sai-keeper.nibiru.fi/) - Test queries interactively

***

{% hint style="success" %}
**Ready to build?** Start with the [EVM Integration Guide](/for-devs/dev/evm-guide.md) or [WASM Integration Guide](/for-devs/dev/wasm-guide.md) based on your development stack.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sai.fun/for-devs/dev.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
