Coin type needs its own published module. scripts/create-binary-market.ts automates the whole flow.
Prerequisites
- Repo cloned,
.envpopulated (DARKPOOL_PACKAGE_ID,DUSDC_COIN_TYPE). - Sui CLI logged in with a funded testnet address (~0.5 SUI for gas).
- The resolver address you want to control settlement (can be your own).
One command
What happens
Materialize template
Copies
packages/binary-market-template/ into .binary-markets/binary_market_btc_80k_eoy/.Substitute slug + label
Replaces all
<slug> / <label> placeholders in Move.toml, yes.move, no.move, settlement.move.Publish (with --execute)
sui client publish --json. About 0.3 SUI gas, 30s wallclock. Extracts package id + both TreasuryCap ids from objectChanges.create_market
Calls
settlement::create_market<DUSDC>(yes_cap, no_cap, label, expiry_ms, resolver, ctx) which:- Wraps both
TreasuryCaps into a sharedSettlement<DUSDC>. - Mints a
ResolverCapand transfers it to--resolver.
Slug rules
Must match/^[a-z0-9_]+$/. Also avoid Move reserved words (coin, balance, …) since the slug becomes the module path.
Audit
Recovery
If thesui client publish succeeded but create_market aborted (rare; usually CLI flakiness), use the recovery path:
Adding V3 pools
The scaffolded market trades on dedicated V3 poolsPool<YES, DUSDC> and Pool<NO, DUSDC>. Bootstrap them once you have 1000 testnet DEEP:
Adding OO bridge
Wire the optimistic oracle by addingooMarketLinkId to the registry entry (post-registration via pnpm market:register --kind oo). The OOPanel then renders on the event detail page.