mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-07 23:16:53 +00:00
orderbook: Refactor package structure for simplicity and efficiency (#1465)
* initial purge and benchmarks proof before rn overhaul * rn LinkedList -> Tranche(s) and purge references * roll out acrost exchanges * linterino * rn silly billy label * linter strikes AAAAAGAIN! * fix some things * rm comment * Add actual comparison from master to branch benchmark for sorting algorithms * lower case via git mv YAAY! * drop code * convert type name * glorious: nits --------- Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
This commit is contained in:
@@ -266,7 +266,7 @@ func (e *EXMO) UpdateOrderbook(ctx context.Context, p currency.Pair, assetType a
|
||||
continue
|
||||
}
|
||||
|
||||
book.Asks = make(orderbook.Items, len(data.Ask))
|
||||
book.Asks = make(orderbook.Tranches, len(data.Ask))
|
||||
for y := range data.Ask {
|
||||
var price, amount float64
|
||||
price, err = strconv.ParseFloat(data.Ask[y][0], 64)
|
||||
@@ -279,13 +279,13 @@ func (e *EXMO) UpdateOrderbook(ctx context.Context, p currency.Pair, assetType a
|
||||
return book, err
|
||||
}
|
||||
|
||||
book.Asks[y] = orderbook.Item{
|
||||
book.Asks[y] = orderbook.Tranche{
|
||||
Price: price,
|
||||
Amount: amount,
|
||||
}
|
||||
}
|
||||
|
||||
book.Bids = make(orderbook.Items, len(data.Bid))
|
||||
book.Bids = make(orderbook.Tranches, len(data.Bid))
|
||||
for y := range data.Bid {
|
||||
var price, amount float64
|
||||
price, err = strconv.ParseFloat(data.Bid[y][0], 64)
|
||||
@@ -298,7 +298,7 @@ func (e *EXMO) UpdateOrderbook(ctx context.Context, p currency.Pair, assetType a
|
||||
return book, err
|
||||
}
|
||||
|
||||
book.Bids[y] = orderbook.Item{
|
||||
book.Bids[y] = orderbook.Tranche{
|
||||
Price: price,
|
||||
Amount: amount,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user