orderfills

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package orderfills defines Polymarket on-chain OrderFilled truth models.

Index

Constants

View Source
const (
	SideBUY  = "BUY"
	SideSELL = "SELL"

	SourceOnchainOrderFilled = "onchain_order_filled"
)

Variables

This section is empty.

Functions

func ValidateFill

func ValidateFill(fill Fill) error

func ValidateQuery

func ValidateQuery(query Query) error

Types

type BlockNumberReader

type BlockNumberReader interface {
	LatestBlockNumber(ctx context.Context) (uint64, error)
}

type Fill

type Fill struct {
	TxHash      string
	LogIndex    uint
	Exchange    string
	MarketID    string
	ConditionID string
	TokenID     string
	Side        string
	Price       string
	Size        string
	BlockNumber uint64
	FilledAt    time.Time
	Source      string
}

func NormalizeFill

func NormalizeFill(fill Fill) (Fill, error)

type Market

type Market struct {
	MarketID    string
	ConditionID string
	YesTokenID  string
	NoTokenID   string
}

type Query

type Query struct {
	ExchangeAddresses []string
	FromBlock         uint64
	ToBlock           uint64
	MarketID          string
	ConditionIDs      []string
	TokenIDs          []string
	Markets           []Market
}

type Reader

type Reader interface {
	OrderFilled(ctx context.Context, query Query) ([]Fill, error)
}

func NewReader

func NewReader(rpcURL string) Reader

func NewReaderWithOptions

func NewReaderWithOptions(options ReaderOptions) Reader

type ReaderOptions

type ReaderOptions struct {
	RPCURL            string
	ExchangeAddresses []string
}

Jump to

Keyboard shortcuts

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