Unique-Divine/jiyuu / ai-skills/sai
sai
VerifiedTrade and inspect Sai perpetuals on Nibiru with the open-source `sai` CLI and its MCP server, and query or reconcile Sai Perps data from live contracts, Sai Keeper GraphQL, and DexPal REST. Use for Sai markets, prices, positions, balances, trade history, live watches, connecting a Sai account, previewing or submitting trades, checking intents, installing or configuring the Sai MCP server, `sai config`, `sai doctor`, `sai update`, `sai logs`, fees, open interest, SLP vaults, referrals, or disagreements between on-chain and indexed data. Use agent skill `sai-ops` for contract and operator mutations.
Sai
Sai is a perpetual futures exchange on Nibiru. Traders deposit USDC, and Sai
Keeper turns each signed trading request, called an intent, into a contract
transaction. The sai CLI from
SaiDotFun/open-sai reads markets and
accounts, streams updates, submits intents, and runs an MCP server with the
same reads and trades.
This skill covers two kinds of work: operating Sai through the CLI or MCP tools, and reading protocol data directly from contracts and APIs. Read only the pages the task needs.
Install
Check for the CLI with sai --version. If it is missing, install the newest
release with uv:
uv run https://raw.githubusercontent.com/SaiDotFun/open-sai/main/scripts/install.py
The script finds the newest sai-cli release, checks its wheel against the
release's checksums, and installs it with uv tool install. To build from
source instead:
uv tool install git+https://github.com/SaiDotFun/open-sai
To try it without installing:
uvx --from git+https://github.com/SaiDotFun/open-sai sai --json market prices
The package is sai-cli. uv tool install sai installs an unrelated PyPI
package.
Which Page to Read
| Task | Page |
|---|---|
Run sai commands: markets, accounts, watches, connecting an account, settings, sai doctor, sai update | cli.md |
Find out what a command, MCP tool call, or trade did, from sai logs | cli.md |
| Register the MCP server with an agent client, or use Sai MCP tools | mcp.md |
| Anything that previews, submits, or follows a trade, through the CLI or MCP | trading-safety.md |
| Live Perp and Oracle contract state: markets, collaterals, OI limits, fees, deposits, credits | references/contracts.md |
| SLP Vault health, share price, deposit caps, epochs, raw vault state | references/vaults.md |
| Sai Keeper GraphQL: indexed trades, LP history, prices, referrals, subscriptions | references/graphql.md |
| DexPal REST: public stats, markets, yield, health checks | references/rest.md |
| Referral code ownership, redemptions, testnet balance and credit checks | references/referrals.md |
| Why contract state, GraphQL, and REST disagree | references/reconciliation.md |
Read trading-safety.md before the first trade of a session, even when the person asks for one quick order.
Rules for Every Task
- If Sai MCP tools such as
mcp_infoandmarket_pricesare available, prefer them over shell commands. - Command
sai --helpand each command's--helpare the authority for options. Put--jsonbefore the command for machine-readable output:sai --json market list. - Mainnet is the default network.
- Never ask the person for a session token, and never type, paste, or echo
one. The person signs in with
sai auth importorsai auth login NAME. - Say which account a trade uses before the person confirms it, and pin that account on both the preview and the trade.
- Keeper accepting an intent does not mean the trade executed.
Copies of This Skill
This skill is edited in
Unique-Divine/jiyuu
and packaged with the CLI. Command sai --skill prints the packaged
SKILL.md. A CLI that lists skill in sai --help also has sai skill show --page NAME for one child page and sai skill source for the commit the
copy came from; cli.md has the details. When this page and the
installed CLI disagree about a command, follow sai --help.
Outside This Skill
- Contract uploads, migrations, admin messages, creating referral codes,
issuing trading credits, and other operator changes belong to agent skill
sai-ops. - The Sai Keeper Postgres schema and direct database access belong to private
agent skill
sai-db. This skill needs no database access or credentials. - Heart Monitor GraphQL for chain transactions and Wasm events belongs to
agent skill
nibiru-gql.nibiruCLI mechanics belong to agent skillnibiru-cli.
Reading Protocol Data
For a question that spans several sources:
- Identify the network and the entity: contract address, market index, token index, trader, vault, referral code, REST endpoint, or GraphQL field.
- Read live contract state when the fact controls protocol behavior.
- Read GraphQL or REST when the fact is about what the app or API shows.
- Compare sources explicitly. Say which one owns each fact and which is stale, derived, or human-maintained.
Common mistakes:
- Contract query JSON uses CosmWasm
snake_case. GraphQL fields use camelCase. - On-chain amounts and GraphQL
Intamounts are base units. REST responses often return human or USD values. TokenIndex(0)is the USD quote placeholder, not collateral. Mainnet collateral isTokenIndex(1)for USDC andTokenIndex(2)for stNIBI.- Some contract queries take wrapped string indices such as
"MarketIndex(0)", and others take plain integers. Check references/contracts.md before guessing. - REST 24-hour windows differ.
GET /dexpal/v1/statsandGET /dexpal/v1/markets/detailscan use different time anchors.
examples/prompts.md lists protocol-data prompts that should and should not use this skill.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 469k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |