Deepbook Predict logo

Deepbook Predict

Organization
MystenLabs
deepbook-predict

Guides DeepBook Predict integration on Sui: expiry-based prediction markets where every position is a strike range, minting and redeeming positions, market lifecycle and settlement, order ID handling, and the PoolVault/PLP liquidity pool. Use when the user asks about DeepBook Predict, Sui prediction markets, binary, directional, or range positions, strikes and expiry, quoting, settlement or try_settle, market states, PLP shares, the predict vault, quoteCoinType, or code importing `@mysten/deepbook-v3/predict`. For spot trading use the `deepbook-sdk` skill; for margin, `deepbook-margin`; for architecture, `deepbook-overview`.

Overview

PublisherMystenLabs
Repositoryskills
Skill namedeepbook-predict
Stars
21
Forks
12
Bundled files
4
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by MystenLabs on GitHub. Read the source before you install it.

Installation

Install the Deepbook Predict AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/MystenLabs/skills/tree/main/deepbook-predict
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/MystenLabs/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/deepbook-predict .claude/skills/deepbook-predict
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Deepbook Predict in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Deepbook Predict on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Deepbook Predict is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

DeepBook Predict

Expiry-based prediction markets on Sui. Each market covers one underlying and one expiry timestamp. Predict is not a perpetual market.

If an API or parameter is not shown here or in the reference files, check docs.sui.io and the deepbookv3 repository rather than extrapolating from other prediction protocols.

Quick start

ts
import { DeepBookClient } from '@mysten/deepbook-v3';
import { getConfig } from '@mysten/deepbook-v3/predict';

// Deployment IDs and coin types are per-network. Never hardcode a symbol.
const config = getConfig(network);           // 'testnet' | 'mainnet'
const collateral = config.quoteCoinType;

// `active` means live and NOT YET SETTLED — expired-but-unsettled markets are
// still returned here, and quoting against them aborts.
const markets = await client.predict.read.markets();
const tradable = markets.filter((m) => !m.is_settled);

Task: explain Predict and its position types

  • Every position is a range contract. It pays a fixed amount if the settlement price lands inside the chosen strike range, and nothing otherwise.
  • A directional ("binary") position is a one-sided range. Side up pays when settlement lands above the strike; side down pays when it lands at or below it.
  • Quantity is the maximum payout in USDC, not a share count, and must be a whole lot of 0.01 USDC (10,000 base units at 6 decimals).
  • Liquidity providers supply USDC to a shared pool, receive PLP shares, and take the other side of every trade.

Payoff detail and worked examples: positions-and-oracles.md.

Task: mint a position in TypeScript

Checklist:

  1. getConfig(network) → deployment IDs and quoteCoinType.
  2. client.predict.read.markets() → pick a market that is not settled.
  3. Build the mint call (market, side or strike range, quantity in whole 0.01 USDC lots). Exact argument names: workflow.md.
  4. Execute, then decode the order ID from the transaction result — it exists nowhere else.
  5. Persist { marketId, orderId } together.
  6. Re-read the order ID after any partial close.
ts
const tx = new Transaction();
client.predict.mint(tx, mintArgs); // see workflow.md for mintArgs

const result = await suiClient.signAndExecuteTransaction({
  transaction: tx,
  signer: keypair,
  options: { showEvents: true, showObjectChanges: true },
});

const { orderId } = client.predict.decode.mint(result);
await store.save({ marketId, orderId }); // both, always

Why both IDs: an order ID is unique only inside one market, so redeem and claim need the market ID alongside it. Closing part of a position replaces the order ID with a new one — the old ID no longer resolves.

Task: market states and settlement

  • active means live and not yet settled. It does not mean "not expired".
  • An expired market that nobody has settled is still returned by read.markets(), and quoting against it aborts.
  • Read the lifecycle state from the market — is_settled, or try_settlement_price — instead of comparing the expiry timestamp to the clock.
  • A market becomes settled when someone calls try_settle and it succeeds. The gap between expiry and settlement has no fixed duration.
  • After settlement, positions are claimed/redeemed against the settlement price: full notional if the price landed in range, zero otherwise.
ts
const price = await client.predict.read.try_settlement_price(marketId);
if (!price) {
  // expired or not: still unsettled — do not quote, do not claim
}

State machine detail: positions-and-oracles.md.

Task: vault and PLP liquidity

  • The Predict pool, PoolVault, is the counterparty to every trade.
  • Liquidity providers deposit the pool's collateral coin (USDC) and receive PLP shares — a 6-decimal coin matching USDC's decimals.
  • PLP is a proportional claim on pool value, so its value tracks pool profit and loss rather than paying a fixed yield.
  • Read the exact collateral coin type from getConfig(network).quoteCoinType; do not assume a symbol.
  • Withdrawals require available liquidity after covering maximum payout obligations, and large withdrawals may be throttled.

Supply/withdraw calls: workflow.md.

Task: common mistakes

MistakeDo instead
Assuming the collateral coin symbolRead getConfig(network).quoteCoinType
Inferring settlement from the expiry timestampRead is_settled or try_settlement_price
Quoting an expired market from read.markets()Filter out unsettled-but-expired markets; quoting them aborts
Hardcoding package or object IDsTreat them as pinned to a deployment; read them for the target network
Storing only the order IDStore { marketId, orderId }; order IDs are market-scoped
Reusing an order ID after a partial closeDecode the new order ID from that transaction's result
Quantity that is not a whole 0.01 USDC lotRound to whole lots; quantity is maximum payout
Treating positions as perpetualEvery position expires and is claimed after settlement

Reference files

  • positions-and-oracles.md — payoffs, market lifecycle, settlement mechanics, vault/PLP model.
  • workflow.md — exact call arguments for mint, redeem, claim, LP supply and withdraw.
  • contract-info.md — per-deployment IDs, coin types, server endpoint, event types.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Deepbook Predict AI skill do?

Guides DeepBook Predict integration on Sui: expiry-based prediction markets where every position is a strike range, minting and redeeming positions, market lifecycle and settlement, order ID handling, and the PoolVault/PLP liquidity pool. Use when the user asks about DeepBook Predict, Sui prediction markets, binary, directional, or range positions, strikes and expiry, quoting, settlement or try_settle, market states, PLP shares, the predict vault, quoteCoinType, or code importing `@mysten/deepbook-v3/predict`. For spot trading use the `deepbook-sdk` skill; for margin, `deepbook-margin`; for...

Why use Deepbook Predict on TypingMind?

Because you install it once and use it with any model. Deepbook Predict is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Deepbook Predict in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/MystenLabs/skills/tree/main/deepbook-predict. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Deepbook Predict?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Deepbook Predict?

As many as you like. As long as a model supports skills, you can use Deepbook Predict with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Deepbook Predict AI skill free?

Yes. It is published on GitHub by MystenLabs under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇