> ## Documentation Index
> Fetch the complete documentation index at: https://docs.darkpool.fun/llms.txt
> Use this file to discover all available pages before exploring further.

# DeepBook Predict

> How DarkPool builds on top of the Predict primitive without forking it.

## Why we build on Predict

Six weeks before DarkPool started, Mysten Labs shipped **DeepBook Predict**, a shared-vault binary + range options primitive on top of DeepBook V3. It bundles three things every prediction market needs but most have to invent from scratch:

* **Shared vault liquidity** (PLP coins). Solves prediction-market cold-start. LPs deposit DUSDC, get an LP token, earn fees.
* **OracleSVI pricing**. One `OracleSVI` per (asset × expiry), serves prices for every binary + range strike on that asset/expiry pair. SVI vol surface, Pyth-fed spot, alpha-decay over time.
* **Composable positions**. `predict::mint` / `predict::redeem` are PTB-friendly; mint+redeem in one tx with other Move calls.

DarkPool does **not** fork Predict. Every mint/redeem/supply goes through Predict's modules unchanged. Our `predict_facade` emits attribution events alongside, keeping DarkPool inside the DeepBook ecosystem rather than splintering it.

## Branch pin

Predict is pinned to `predict-testnet-4-16`. Never reference `main`. The branch will shift before mainnet.

Live package IDs:

| Object                       | ID                                                                   |
| ---------------------------- | -------------------------------------------------------------------- |
| `PREDICT_PACKAGE_ID`         | `0xf5ea2b3749c65d6e56507cc35388719aadb28f9cab873696a2f8687f5c785138` |
| `PREDICT_OBJECT_ID` (shared) | `0xc8736204d12f0a7277c86388a68bf8a194b0a14c5538ad13f22cbd8e2a38028a` |

See [Predict contract information](https://docs.sui.io/onchain-finance/deepbook-predict/contract-information) for the canonical list.

## The \$1.00 invariant

In every binary prediction market, **YES payout + NO payout = 1 quote unit**. Predict already enforces this via the `Predict` shared object's bookkeeping and `Vault` accounting:

* `predict::mint_binary` debits the user's PredictManager and credits the Vault, recording a position entry keyed `(oracle_id, expiry, strike, is_up)`.
* `predict::redeem_binary` checks the OracleSVI state, computes payout (1 quote per winning unit, 0 per losing unit) minus fees, and credits the user's PredictManager.
* All arithmetic happens inside Predict in u128 / fixed-point as appropriate. We don't write any of this.

Our role:

1. Wrap these calls with our own attribution events (for agent reputation tracking).
2. Coordinate the atomic Pyth + redeem PTB.
3. Collect a 1% protocol fee on top of Predict's fee.

## How positions are represented

Unlike Polymarket / Limitless, **Predict positions are not standalone fungible coins**. They are entries in a user's `PredictManager` shared object, keyed by either:

* Binary: `(oracle_id, expiry_ms, strike, is_up)`
* Vertical range: `(oracle_id, expiry_ms, lower_strike, higher_strike)`

This is the v0.1 to v0.2 mental-model shift. There is no `Coin<YES>` / `Coin<NO>` for Predict markets. Those exist only for our scaffolded event markets, see [Binary Event Markets](/concepts/binary-event-markets).

## The `predict_facade` adapter

[`predict_facade.move`](/move/predict-facade) is a thin adapter that emits attribution events alongside the underlying Predict call. Each entry function below is meant to be added to a PTB **after** the corresponding `predict::*` call, so the indexer sees both events.

```move theme={"system"}
public entry fun attribute_binary_mint(...);
public entry fun attribute_range_mint(...);
public entry fun attribute_plp_supply(...);
public entry fun attribute_plp_withdraw(...);
public entry fun attribute_redeem(...);
```

<Note>
  **Status:** attribution is wired into the **resolver's settlement PTB** (`buildAtomicSettlementPTB` to `attribute_redeem`) and **`scripts/supply-plp.ts`** (`attribute_plp_supply`). Frontend and agent-service mints are unattributed today. Wiring those is a republish-era follow-up.
</Note>

## DUSDC quote asset

DUSDC (`0xe95040…::dusdc::DUSDC`) is the only quote asset Predict accepts. It's the DeepBook-allowlisted USDC type on testnet. Use the [DeepBook tally form](https://tally.so/r/Xx102L) to request testnet DUSDC; the return address ships with the allowlist.

Return commitment: 80% sweeps on Jun 23 + Jun 28 (see `scripts/return-testnet-dusdc.ts`).
