match

package
v0.0.0-...-962cb54 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2020 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteOrderList

func ExecuteOrderList(price sdk.Dec, bidList []OrderForTrade, askList []OrderForTrade) (newBidList []OrderForTrade, newAskList []OrderForTrade)

Given price, execute the orders in bidList and askList

func GetExecutionPrice

func GetExecutionPrice(highPrice, midPrice, lowPrice sdk.Dec, orders []OrderForTrade) sdk.Dec

func Match

func Match(highPrice, midPrice, lowPrice sdk.Dec, bidList []OrderForTrade, askList []OrderForTrade)

match bid order list against ask order list

Types

type Account

type Account interface {
	String() string
}

type OrderForTrade

type OrderForTrade interface {
	GetPrice() sdk.Dec
	GetAmount() int64
	GetHeight() int64
	GetHash() []byte
	GetSide() int
	GetOwner() Account
	Deal(otherSide OrderForTrade, amount int64, price sdk.Dec)
	String() string
}

func ExecuteOrder

func ExecuteOrder(price sdk.Dec, currOrder OrderForTrade, orderList []OrderForTrade) []OrderForTrade

Given price, execute currOrder against orders in orderList

type PricePoint

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

func (*PricePoint) String

func (pp *PricePoint) String() string

Jump to

Keyboard shortcuts

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