Contract Functions

Complete reference for all public functions.


User Functions

deposit

Deposit USDC to your trading balance.

function deposit(uint256 amount) external
  • Requires USDC approval first

  • Amount in USDC units (6 decimals)

withdraw

Withdraw USDC from trading balance to wallet.

function withdraw(uint256 amount) external
  • Cannot exceed your balance

  • Sent directly to msg.sender

buyShares

Buy YES or NO shares in a market.

  • isYes: true for YES, false for NO

  • amount: USDC to spend (before fees)

  • 2% fee deducted automatically

sellShares

Sell shares back to the AMM.

  • Must have enough shares

  • Receives USDC at current market price

claimWinnings

Claim payout from a resolved market.

  • Only works if you hold winning shares

  • Adds USDC to your trading balance


Resolution Functions

proposeOutcome

Propose the outcome of an expired market.

  • Requires proposal bond (5 USDC from balance)

  • outcome: true for YES, false for NO

  • Starts 24-hour challenge period

challengeOutcome

Challenge the current proposed outcome.

  • Requires challenge bond (10 USDC, escalates)

  • Flips the proposed outcome

  • Resets challenge period

finalizeOutcome

Finalize outcome after challenge period.

  • Anyone can call

  • Challenge period must be over

  • Distributes bonds to correct proposer


Market Creation

createMarket

Create a new prediction market.

  • Requires 100 USDC for initial liquidity

  • Deadline must be in the future

  • Returns new market ID


View Functions

getMarket

Get full market details.

getPosition

Get user's position in a market.

getPrice

Get current share prices.

Prices returned in basis points (5000 = $0.50).

Last updated