Documentation ¶
Index ¶
- func ExecuteOrderList(price sdk.Dec, bidList []OrderForTrade, askList []OrderForTrade) (newBidList []OrderForTrade, newAskList []OrderForTrade)
- func GetExecutionPrice(highPrice, midPrice, lowPrice sdk.Dec, orders []OrderForTrade) sdk.Dec
- func Match(highPrice, midPrice, lowPrice sdk.Dec, bidList []OrderForTrade, ...)
- type Account
- type OrderForTrade
- type PricePoint
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 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
Click to show internal directories.
Click to hide internal directories.