deepskew
ManualBuild

On-Chain Integration

deepskew binds to a small set of on-chain identifiers, reads them through three tiers (a public REST indexer, an event stream, and direct gRPC), and writes back along two paths: a binary trade loop (mint and redeem a position against a per-user PredictManager) and the PLP vault (supply and withdraw). This page is the map: the objects, the read path, the write paths, and where Predict sits in the wider DeepBook stack.

Everything deepskew touches resolves to one of four on-chain identifiers. These are Testnet values on the predict-testnet-4-16branch. The package id and quote asset should be re-resolved from the indexer’s /config at runtime, and on Mainnet the single market id becomes a runtime list, but on Testnet they are stable enough to treat as constants.

Predict package
0xf5ea2b37…785138 is the Predict Move package. Every call target (predict::mint, predict::redeem, predict::create_manager, predict_manager::deposit / withdraw, predict::supply, predict::withdraw, oracle::* events) lives under it. deepskew ships no Move package of its own; it composes this deployed one.
Predict market
0xc8736204…38028a is the shared market object. On Testnet there is one, so all 3.6k+ oracles report this single predict_id, and it is the first argument to the trade and vault calls.
Default oracle
0x82634405…43d6cf is the headline oracle the desk opens on: one rolling BTC expiry publishing spot, forward, and SVI params.
dUSDC quote
0xe9504008…a73e1a::dusdc::DUSDC is the accepted quote asset. It is dUSDC, the Predict Testnet token, not the official Testnet USDC.
NoteVerify any of these
Every value above links to Suiscan Testnet through explorerObject(id). The link text is truncated, but the link target carries the full id, so you can open the real object and confirm it yourself.

deepskew reads chain state through three tiers, each chosen for what it is best at. They layer: the indexer answers most questions, the event stream supplies freshness, and gRPC fills the gaps the indexer cannot.

  • Tier 1: the REST indexer. The public Predict indexer at https://predict-server.testnet.mystenlabs.com serves /config, /oracles, fills, and vault state. CORS is open, so the browser calls it directly with no proxy. This is the bulk read: the surface, the smile, and the tape all start here.
  • Tier 2: the checkpoint / event stream. Oracle events (OraclePricesUpdated, OracleSVIUpdated, OracleSettled, OracleActivated, all under <package>::oracle) give per-tick freshness. The cerulean pulse on each oracle update is this tier landing in the UI.
  • Tier 3: direct gRPC client.core reads. For wallet-side state the indexer does not hold, deepskew reads the Sui 2.x Core API directly, for example client.core.listCoins({ owner, coinType })to enumerate dUSDC and PLP coins. This is DeepBook’s prescribed shape: a structural CoinReader over core, paginated by cursor.

deepskew writes along two paths, both built as a single Transaction(coins consolidated, then split to the exact amount) and signed through the dApp Kit’s signAndExecuteTransaction, both generic over the quote type. Every target is on Mysten’s deployed Predict package; deepskew ships no Move package of its own.

Trade. A connect-gated ticket on the Flow & Edge view that leads with the model-fair N(d2) and runs the binary lifecycle through a per-user PredictManager, the on-chain account that holds the dUSDC positions are bought from and paid into.

  • predict::create_manager(ctx)creates and shares the caller’s PredictManager (a one-time setup), and predict_manager::deposit / withdraw<Quote> move dUSDC between the wallet and that account.
  • predict::mint<Quote>(predict, manager, oracle, key, qty, clock) opens a position: it debits the premium (the post-trade ask times the quantity) from the manager balance. The MarketKey is built on-chain with market_key::new(oracle_id, expiry, strike, is_up).
  • predict::redeem<Quote>(predict, manager, oracle, key, qty, clock) closes a position: it credits the payout (the bid before settlement, or $1 per contract once settled in the money) back to the manager balance.

Vault. The LP side, on the Vault view: two targets taking the shared Clock (0x6) as their last argument, with the market id as the first.

  • predict::supply<Quote>(predict, Coin<Quote>, clock) mints LP shares: it deposits dUSDC and returns a Coin<PLP> transferred to the sender.
  • predict::withdraw<Quote>(predict, Coin<PLP>, clock) burns LP shares: it spends a Coin<PLP> and returns Coin<Quote> to the sender.
CautionThe withdrawal limiter is a throughput cap, not a lock
Withdrawals are bounded on-chain by two things at once. There is a solvency floor (balance − max_payout) and a token-bucket rate limiter: not a fixed timed lock, but a continuously refilling throughput cap on how fast the vault can be drained. So a withdrawal binds to min(available_liquidity, available_withdrawal), and the UI clamps the input to that live budget rather than letting a transaction fail at the floor.

Predict does not sit alone. It is one product in the DeepBook stack, and deepskew reads the other two legs to frame the borrow-and-supply loop a leveraged liquidity provider would run.

  • DeepBook v3 spot.The on-chain CLOB venue Predict’s oracle prices against. deepskew reads /summary and picks the BTC/USDC pair, so the spot price the surface settles toward is shown next to the surface itself.
  • deepbook_margin. The borrow leg. deepskew reads /margin_pool_createdfor the dUSDC pool’s interest config and computes the kinked two-slope borrow APR at the current utilization, the cost side of funding a leveraged PLP position.

Both DeepBook indexers share the same Testnet host with open CORS, so they are called straight from the browser exactly like the Predict indexer. Together they close the loop: borrow dUSDC on margin, supply it to the PLP vault, and earn the vault’s edge against the borrow rate.

NoteSee it live
The full loop, with the spot reference, the borrow APR, and the PLP edge side by side, is on the Cross-Venue view. To put dUSDC into the vault yourself, see Provide Liquidity.