Client,Markets,Positions

The Client is the main entry point for all SDK operations.

gotype Client struct {
    // contains unexported fields
}

Responsibilities:

  • Manages connections to blockchain RPC nodes

  • Handles authentication (private keys, wallets)

  • Executes smart contract calls and transactions

  • Manages state and caching

Markets

A Market represents a prediction market on real-world events.

Market Structure:

  • ID: Unique identifier for the market

  • Question: The prediction question (e.g., "Will BTC reach $100k by Dec 31?")

  • Creator: Address of market creator

  • Resolution Time: When the market resolves

  • Category: Market category (sports, crypto, politics, etc.)

  • Outcomes: Possible outcomes (YES/NO or multiple outcomes)

Positions

A Position represents a user's stake/holding in a specific market outcome.

Position Attributes:

  • Shares: Number of shares held

  • AverageCost: Average cost paid per share

  • CurrentValue: Current market value of shares

  • UnrealizedPnL: Unrealized profit/loss

Orders

Orders are buy/sell requests in prediction markets.

Order Types:

  • LIMIT: Buy/sell at specific price

  • MARKET: Buy/sell at best available price

  • STOP_LOSS: Sell if price drops below threshold

Last updated