Documentation ¶
Index ¶
- type CurrentOrder
- type OrderRes
- type SafeMap
- func (sm *SafeMap) DeleteMap(key string)
- func (sm *SafeMap) ListMap() ([]string, []*list.Element)
- func (sm *SafeMap) ListMap_Tmp() ([]string, []*list.Element)
- func (sm *SafeMap) MapLength() int
- func (sm *SafeMap) ReadMap(key string) (*list.Element, bool)
- func (sm *SafeMap) WriteMap(key string, value *list.Element)
- type XvcOrder
- func (o *XvcOrder) Copy() *XvcOrder
- func (o *XvcOrder) FROM() common.Address
- func (o *XvcOrder) ID() string
- func (o *XvcOrder) MarshalJSON() ([]byte, error)
- func (o *XvcOrder) ORDERTYPE() string
- func (o *XvcOrder) PRICE() string
- func (o *XvcOrder) QUANTITY() string
- func (o *XvcOrder) RULE() string
- func (o *XvcOrder) SIDE() string
- func (o *XvcOrder) TIME() int64
- func (o *XvcOrder) TRADE() string
- func (o *XvcOrder) UnmarshalJSON(data []byte) error
- type XvcOrderBook
- func (d *XvcOrderBook) CancelOrder(orderID string) *XvcOrder
- func (ob *XvcOrderBook) InsertToOrderBook(od *XvcOrder) error
- func (ob *XvcOrderBook) Order(orderID string) *XvcOrder
- func (d *XvcOrderBook) Set(k string, v *list.Element)
- func (ob *XvcOrderBook) String(trade string) (string, error)
- func (d *XvcOrderBook) UpdateOrder(e *XvcOrder, diff decimal.Decimal)
- type XvcOrderQueue
- func (oq *XvcOrderQueue) Append(o *XvcOrder) *list.Element
- func (oq *XvcOrderQueue) Head() *list.Element
- func (oq *XvcOrderQueue) Len() int
- func (oq *XvcOrderQueue) OrderVolume(trade string) decimal.Decimal
- func (oq *XvcOrderQueue) PRICE() string
- func (oq *XvcOrderQueue) Remove(e *list.Element) *XvcOrder
- func (oq *XvcOrderQueue) String() string
- func (oq *XvcOrderQueue) Tail() *list.Element
- func (oq *XvcOrderQueue) Update(e *XvcOrder, diff decimal.Decimal)
- func (oq *XvcOrderQueue) VOLUME() string
- type XvcOrderSide
- func (os *XvcOrderSide) Append(o *XvcOrder) *list.Element
- func (os *XvcOrderSide) DEPTH() int
- func (os *XvcOrderSide) GreaterThan(price decimal.Decimal) *XvcOrderQueue
- func (os *XvcOrderSide) Len() int
- func (os *XvcOrderSide) LessThan(price decimal.Decimal) *XvcOrderQueue
- func (os *XvcOrderSide) MaxPriceQueue() *XvcOrderQueue
- func (os *XvcOrderSide) MinPriceQueue() *XvcOrderQueue
- func (os *XvcOrderSide) Orders(trade string) []*OrderRes
- func (os *XvcOrderSide) Remove(e *list.Element) *XvcOrder
- func (os *XvcOrderSide) String() string
- func (os *XvcOrderSide) UpdateOrder(e *XvcOrder, diff decimal.Decimal)
- func (os *XvcOrderSide) VOLUME() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CurrentOrder ¶
type SafeMap ¶
func NewSafeMap ¶
type XvcOrder ¶
type XvcOrder struct { Id string From common.Address Trade string //ETH/BTC Ordertype string //LimitOrder Side string //Buy/Sell Timestamp int64 //Quantity decimal.Decimal //Price decimal.Decimal Quantity string Price string Rule string //GTE/IOC }
func NewXvcOrder ¶
func (*XvcOrder) MarshalJSON ¶
MarshalJSON implements json.Marshaler interface
func (*XvcOrder) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler interface
type XvcOrderBook ¶
type XvcOrderBook struct { Orders *SafeMap Buys *XvcOrderSide Sells *XvcOrderSide }
func NewXvcOrderBook ¶
func NewXvcOrderBook() *XvcOrderBook
func (*XvcOrderBook) CancelOrder ¶
func (d *XvcOrderBook) CancelOrder(orderID string) *XvcOrder
func (*XvcOrderBook) InsertToOrderBook ¶
func (ob *XvcOrderBook) InsertToOrderBook(od *XvcOrder) error
func (*XvcOrderBook) Order ¶
func (ob *XvcOrderBook) Order(orderID string) *XvcOrder
func (*XvcOrderBook) UpdateOrder ¶
func (d *XvcOrderBook) UpdateOrder(e *XvcOrder, diff decimal.Decimal)
type XvcOrderQueue ¶
type XvcOrderQueue struct { //Volume decimal.Decimal //Price decimal.Decimal Volume string Price string //Orders []*XvcOrder Orders *list.List }
func NewXvcOrderQueue ¶
func NewXvcOrderQueue(price string) *XvcOrderQueue
func (*XvcOrderQueue) Append ¶
func (oq *XvcOrderQueue) Append(o *XvcOrder) *list.Element
Append adds order to tail of the queue
func (*XvcOrderQueue) Head ¶
func (oq *XvcOrderQueue) Head() *list.Element
Head returns top order in queue
func (*XvcOrderQueue) Len ¶
func (oq *XvcOrderQueue) Len() int
Len returns amount of orders in queue
func (*XvcOrderQueue) OrderVolume ¶
func (oq *XvcOrderQueue) OrderVolume(trade string) decimal.Decimal
func (*XvcOrderQueue) PRICE ¶
func (oq *XvcOrderQueue) PRICE() string
func (*XvcOrderQueue) Remove ¶
func (oq *XvcOrderQueue) Remove(e *list.Element) *XvcOrder
Remove removes order from the queue and link order chain
func (*XvcOrderQueue) String ¶
func (oq *XvcOrderQueue) String() string
String implements fmt.Stringer interface
func (*XvcOrderQueue) Tail ¶
func (oq *XvcOrderQueue) Tail() *list.Element
Tail returns bottom order in queue
func (*XvcOrderQueue) VOLUME ¶
func (oq *XvcOrderQueue) VOLUME() string
type XvcOrderSide ¶
type XvcOrderSide struct { PriceTree *rbtx.RedBlackTreeExtended Prices map[string]*XvcOrderQueue Volume string NumOrders int Depth int Lock sync.Mutex }
func NewOrderSide ¶
func NewOrderSide() *XvcOrderSide
func (*XvcOrderSide) Append ¶
func (os *XvcOrderSide) Append(o *XvcOrder) *list.Element
Append appends order to definite price level
func (*XvcOrderSide) GreaterThan ¶
func (os *XvcOrderSide) GreaterThan(price decimal.Decimal) *XvcOrderQueue
GreaterThan returns nearest OrderQueue with price greater than given
func (*XvcOrderSide) Len ¶
func (os *XvcOrderSide) Len() int
func (*XvcOrderSide) LessThan ¶
func (os *XvcOrderSide) LessThan(price decimal.Decimal) *XvcOrderQueue
LessThan returns nearest OrderQueue with price less than given
func (*XvcOrderSide) MaxPriceQueue ¶
func (os *XvcOrderSide) MaxPriceQueue() *XvcOrderQueue
MaxPriceQueue returns maximal level of price
func (*XvcOrderSide) MinPriceQueue ¶
func (os *XvcOrderSide) MinPriceQueue() *XvcOrderQueue
MinPriceQueue returns maximal level of price
func (*XvcOrderSide) Orders ¶
func (os *XvcOrderSide) Orders(trade string) []*OrderRes
func (*XvcOrderSide) Remove ¶
func (os *XvcOrderSide) Remove(e *list.Element) *XvcOrder
Remove removes order from definite price level
func (*XvcOrderSide) String ¶
func (os *XvcOrderSide) String() string
String implements fmt.Stringer interface
func (*XvcOrderSide) UpdateOrder ¶
func (os *XvcOrderSide) UpdateOrder(e *XvcOrder, diff decimal.Decimal)
func (*XvcOrderSide) VOLUME ¶
func (os *XvcOrderSide) VOLUME() string