prediction

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Level

type Level struct {
	Price    float64 `json:"price"`
	Quantity float64 `json:"quantity"`
}

Level represents a price level in the orderbook.

type Market

type Market struct {
	ID          string    `json:"id"`
	Question    string    `json:"question"`
	Description string    `json:"description"`
	EndTime     time.Time `json:"end_time"`
	Outcomes    []Outcome `json:"outcomes"`
	Active      bool      `json:"active"`
	Closed      bool      `json:"closed"`
	Archived    bool      `json:"archived"`
}

Market represents a prediction market event.

type OrderType

type OrderType string

OrderType is order type (limit/market/etc).

const (
	GTC OrderType = "GTC" // Good Till Cancelled
	IOC OrderType = "IOC" // Immediate Or Cancel
	FOK OrderType = "FOK" // Fill Or Kill
)

type Orderbook

type Orderbook struct {
	MarketID  string  `json:"market_id"`
	TokenID   string  `json:"token_id"`
	Timestamp int64   `json:"timestamp"`
	Bids      []Level `json:"bids"`
	Asks      []Level `json:"asks"`
}

Orderbook represents the state of the order book for a specific token/outcome.

type Outcome

type Outcome struct {
	ID          string  `json:"id"`
	Name        string  `json:"name"` // e.g. "Yes", "No", "Trump", "Biden"
	Price       float64 `json:"price"`
	Probability float64 `json:"probability"`
}

Outcome represents a possible result in a market.

type Side

type Side string

Side is order side (buy/sell).

const (
	Buy  Side = "BUY"
	Sell Side = "SELL"
)

type Token

type Token struct {
	ID        string `json:"id"`
	Symbol    string `json:"symbol"` // e.g. "YES", "NO"
	TokenID   string `json:"token_id"`
	Decimals  int    `json:"decimals"`
	Address   string `json:"address"`
	OutcomeID string `json:"outcome_id"`
}

Token represents the tradeable asset for an outcome.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL