book

package
v0.0.0-...-033d69a Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddParam

type AddParam struct {
	Price    fixed.FixedNumber
	Quantity fixed.FixedNumber
	Quote    fixed.FixedNumber
	OrderId  OrderId
	Side     SideType
}

type BookLevel

type BookLevel struct {
	// contains filtered or unexported fields
}

type Order

type Order struct {
	// contains filtered or unexported fields
}

type OrderBook

type OrderBook struct {
	// contains filtered or unexported fields
}

func NewOrderBook

func NewOrderBook() *OrderBook

func (*OrderBook) Add

func (b *OrderBook) Add(orderType OrderType, p *AddParam) []*Trade

type OrderId

type OrderId uint64

type OrderType

type OrderType int
const (
	MarketOrder OrderType = iota
	LimitOrder
)

type SideType

type SideType bool
const (
	BuySide, SellSide SideType = true, false
)

type Trade

type Trade struct {
	TakerId   OrderId
	MakerId   OrderId
	Price     fixed.FixedNumber
	Quantity  fixed.FixedNumber
	Side      SideType
	Timestamp int64
}

Jump to

Keyboard shortcuts

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