跳转到内容
本页面的翻译由 LLM 生成。如果你发现翻译有误,请在 GitHub 上提交 issue 告诉我们。

Sai 技能原文

安装 Sai 技能 · GitHub 原文

以下为 Jiyuu 发布的英文原文。

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.

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 https://github.com/SaiDotFun/open-sai/releases/download/sai-cli/v0.1.2/sai_cli-0.1.2-py3-none-any.whl sai --json market prices

The package is sai-cli. uv tool install sai installs an unrelated PyPI package.

TaskPage
Run sai commands: markets, accounts, watches, connecting an account, settings, sai doctor, sai updatecli.md
Find out what a command, MCP tool call, or trade did, from sai logscli.md
Register the MCP server with an agent client, or use Sai MCP toolsmcp.md
Anything that previews, submits, or follows a trade, through the CLI or MCPtrading-safety.md
Live Perp and Oracle contract state: markets, collaterals, OI limits, fees, deposits, creditsreferences/contracts.md
SLP Vault health, share price, deposit caps, epochs, raw vault statereferences/vaults.md
Sai Keeper GraphQL: indexed trades, LP history, prices, referrals, subscriptionsreferences/graphql.md
DexPal REST: public stats, markets, yield, health checksreferences/rest.md
Referral code ownership, redemptions, testnet balance and credit checksreferences/referrals.md
Why contract state, GraphQL, and REST disagreereferences/reconciliation.md

Read trading-safety.md before the first trade of a session, even when the person asks for one quick order.

  • If Sai MCP tools such as mcp_info and market_prices are available, prefer them over shell commands.
  • Command sai --help and each command’s --help are the authority for options. Put --json before 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 import or sai 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.

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.

  • 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. nibiru CLI mechanics belong to agent skill nibiru-cli.

For a question that spans several sources:

  1. Identify the network and the entity: contract address, market index, token index, trader, vault, referral code, REST endpoint, or GraphQL field.
  2. Read live contract state when the fact controls protocol behavior.
  3. Read GraphQL or REST when the fact is about what the app or API shows.
  4. 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 Int amounts are base units. REST responses often return human or USD values.
  • TokenIndex(0) is the USD quote placeholder, not collateral. Mainnet collateral is TokenIndex(1) for USDC and TokenIndex(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/stats and GET /dexpal/v1/markets/details can use different time anchors.

examples/prompts.md lists protocol-data prompts that should and should not use this skill.