Skip to content

✨ feat: Add SuiBets — decentralised P2P sports betting on Sui blockchain#640

Open
elpou88 wants to merge 5 commits into
pmxt-dev:mainfrom
elpou88:feat/suibets-exchange
Open

✨ feat: Add SuiBets — decentralised P2P sports betting on Sui blockchain#640
elpou88 wants to merge 5 commits into
pmxt-dev:mainfrom
elpou88:feat/suibets-exchange

Conversation

@elpou88
Copy link
Copy Markdown

@elpou88 elpou88 commented May 24, 2026

SuiBets Exchange Connector

SuiBets is a decentralised P2P sports betting dApp on the Sui blockchain. This PR adds it as a new pmxt exchange, making all P2P bet offers queryable through the unified pmxt API.

How it maps to pmxt concepts

pmxt concept SuiBets equivalent
UnifiedMarket A P2P bet offer (one creator vs one taker side)
UnifiedEvent A sports match (groups all offers for that fixture)
Outcome YES Creator's pick (e.g. "Real Madrid wins")
Outcome NO Opposite side (taker's pick)
price Implied probability derived from the offer odds
liquidity Remaining creator stake available to be filled
contractAddress On-chain Sui object ID (when using on-chain escrow)

Usage

import pmxt from 'pmxtjs';

const exchange = new pmxt.SuiBets();

// List all open P2P offers as markets
const markets = await exchange.fetchMarkets({ limit: 20 });

// Group by match (event)
const events = await exchange.fetchEvents({ query: 'Real Madrid' });

// Fetch order book for a specific offer
const book = await exchange.fetchOrderBook('offer123:creator');

// Fetch user positions (requires wallet)
const ex2 = new pmxt.SuiBets({ walletAddress: '0xabc...' });
const positions = await ex2.fetchPositions();

What's on-chain

SuiBets uses the Sui blockchain for escrow. When isOnchain: true, the creator stake is locked in a Move smart contract (contractAddress = Sui object ID). Settlement is fully on-chain — no house, no custody.

  • Contract: 0xd51fe151bec66a15b086a67c1cfce9b05759ddac1d73fcd3e14324ad202b2e59
  • Network: Sui Mainnet
  • Model: P2P order book — no AMM, no house edge, 2% platform fee

Files added

  • core/src/exchanges/suibets/api.ts — Inline OpenAPI spec for SuiBets REST API
  • core/src/exchanges/suibets/fetcher.ts — Fetches raw P2P offers from SuiBets API
  • core/src/exchanges/suibets/normalizer.ts — Maps offers → UnifiedMarket / UnifiedEvent
  • core/src/exchanges/suibets/index.tsSuiBetsExchange class
  • core/src/index.ts — Registers SuiBets in the pmxt namespace

cc @SamTinnerholm — as discussed on X 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant