DigitalRuby / ExchangeSharp

ExchangeSharp is a powerful, fast and easy to use .NET/C# API for interfacing with many crypto currency exchanges. REST and web sockets are supported.
https://www.digitalruby.com
MIT License
741 stars 374 forks source link

Cannot place marketorder for bitfinex #808

Closed jacobdeboer33 closed 1 year ago

jacobdeboer33 commented 1 year ago

Hi there

I cannot place a market order with bitfinex. I'm getting this exception:

ements not met 2023-07-30 23:17:47,868 - Error in buy: System.NotSupportedException: Exchange must return MinPrice and MaxPrice in order for ClampOrderQuantity() to work at ExchangeSharp.ExchangeAPI.ClampOrderQuantity(String marketSymbol, Decimal outputQuantity) at ExchangeSharp.ExchangeBitfinexAPI.OnPlaceOrderAsync(ExchangeOrderRequest order) at ExchangeSharp.ExchangeAPI.PlaceOrderAsync(ExchangeOrderRequest order)

I cannot find any info about this error. Can anybody help?

Thanks, Jacob

jacobdeboer33 commented 1 year ago

The problem seems to be the marketsymbol. The symbol thats in the marketinfo is lowercase. The symbol that comes with a ticker is uppercase. If I want to place a order with a uppercase marketsymbol the ClampOrderPrice method cannot find a market and will generate this exception.

The bug here is that the symbol in marketinfo differs from the ticker. I've fixed this problem by using lowercase symbols in all my code.