orderbook

package
v0.0.0-...-8513d1b Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BestPrice

type BestPrice struct {
	Provider string
	Price    float64
	Size     float64
}

type Book

type Book struct {
	Symbol string
	Asks   *Limits
	Bids   *Limits
}

func NewBook

func NewBook(symbol string) *Book

func (*Book) BestAsk

func (b *Book) BestAsk() *Limit

func (*Book) BestBid

func (b *Book) BestBid() *Limit

func (*Book) Spread

func (b *Book) Spread() float64

type CrossSpread

type CrossSpread struct {
	Symbol  string
	BestAsk BestPrice
	BestBid BestPrice
	Spread  float64
}

type DataFeed

type DataFeed struct {
	Provider string
	Symbol   string
	BestAsk  float64
	BestBid  float64
	Spread   float64
}

type Limit

type Limit struct {
	Price float64
	// contains filtered or unexported fields
}

func NewLimit

func NewLimit(price float64) *Limit

type Limits

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

func NewLimits

func NewLimits(isBids bool) *Limits

func (*Limits) Best

func (l *Limits) Best() *Limit

func (*Limits) Update

func (l *Limits) Update(price float64, size float64)

type Order

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

func NewAskOrder

func NewAskOrder(size float64) *Order

func NewBidOrder

func NewBidOrder(size float64) *Order

func NewOrder

func NewOrder(isBid bool, size float64) *Order

type Orderbook

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

func NewOrderbook

func NewOrderbook(pair string) *Orderbook

func NewOrderbookFromFile

func NewOrderbookFromFile(pair, askSrc, bidSrc string) (*Orderbook, error)

type Orderbooks

type Orderbooks map[string]*Book

type Provider

type Provider interface {
	Start() error
	GetOrderbooks() Orderbooks
	Name() string
}

Jump to

Keyboard shortcuts

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