Skip to content

Commit

Permalink
Merge branch 'release/0.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
gbjk committed Aug 26, 2023
2 parents 2834879 + cec1268 commit 803a8a5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.2.0
10 changes: 8 additions & 2 deletions exchanges/orderbook/orderbook.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ func Get(exchange string, p currency.Pair, a asset.Item) (*Base, error) {
return service.Retrieve(exchange, p, a)
}

// GetDepth returns a Depth pointer allowing the caller to stream orderbook
// changes
// GetDepth returns a Depth pointer allowing the caller to stream orderbook changes
func GetDepth(exchange string, p currency.Pair, a asset.Item) (*Depth, error) {
return service.GetDepth(exchange, p, a)
}
Expand Down Expand Up @@ -202,6 +201,13 @@ func (s *Service) Retrieve(exchange string, p currency.Pair, a asset.Item) (*Bas
return book.Retrieve()
}

// GetDepth returns the concrete book of which Base is a copy
// This is probably useful for immutably monitoring orderbook health and state
// whereas FetchOrderbook would trigger a refresh.
func (b *Base) GetDepth() (*Depth, error) {
return service.GetDepth(b.Exchange, b.Pair, b.Asset)
}

// TotalBidsAmount returns the total amount of bids and the total orderbook
// bids value
func (b *Base) TotalBidsAmount() (amountCollated, total float64) {
Expand Down

0 comments on commit 803a8a5

Please sign in to comment.