Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Negative amount on bitfinex orderbook #58

Closed
saniales opened this issue Oct 17, 2018 · 0 comments
Closed

Negative amount on bitfinex orderbook #58

saniales opened this issue Oct 17, 2018 · 0 comments
Assignees
Labels

Comments

@saniales
Copy link
Owner

in exchanges/bitfinex.go change this

			// now let's create the cache
			for price, amount := range orderbookMap {
				if amount < 0 {
					orderbook.Asks = insertSort(orderbook.Asks, environment.Order{
						Value:    decimal.NewFromFloat(price),
						Quantity: decimal.NewFromFloat(amount),
					}, false)
				} else if amount > 0 {
					orderbook.Bids = insertSort(orderbook.Bids, environment.Order{
						Value:    decimal.NewFromFloat(price),
						Quantity: decimal.NewFromFloat(-amount),
					}, true)
				}
			}

to this

			// now let's create the cache
			for price, amount := range orderbookMap {
				if amount < 0 {
					orderbook.Asks = insertSort(orderbook.Asks, environment.Order{
						Value:    decimal.NewFromFloat(price),
						Quantity: decimal.NewFromFloat(-amount),
					}, false)
				} else if amount > 0 {
					orderbook.Bids = insertSort(orderbook.Bids, environment.Order{
						Value:    decimal.NewFromFloat(price),
						Quantity: decimal.NewFromFloat(amount),
					}, true)
				}
			}
@saniales saniales added the bug label Oct 17, 2018
@saniales saniales self-assigned this Oct 17, 2018
saniales added a commit that referenced this issue Oct 17, 2018
wb73 pushed a commit that referenced this issue Oct 17, 2018
* fixing orderbook sync issue

* Fixed bitfinex orderbook

* [TASK 130] Fixes #58
saniales added a commit that referenced this issue Oct 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant