Git Product home page Git Product logo

Comments (6)

JKorf avatar JKorf commented on August 22, 2024 1

Sure, here's a little console program which looks up the step size for a specific coin you type in. Note that step size is a property for a specific market, not a coin. NEO-BTC stepsize is probably different from NEO-ETH stepsize for example. This test program just assumes BTC as quote asset.

    class Program
    {
        static void Main()
        {
            Test().Wait();
        }

        public static async Task Test()
        {
            BinanceExchangeInfo info = null;
            using (var client = new BinanceClient())
            {
                var exchangeInfoResult = await client.GetExchangeInfoAsync();
                if (!exchangeInfoResult.Success)
                {
                    Console.WriteLine("Error getting info: " + exchangeInfoResult.Error.Message);
                    Console.ReadLine();
                    return;
                }
                info = exchangeInfoResult.Data;
            }

            while (true)
            {
                var coin = Console.ReadLine();
                // Assuming BTC quote asset
                var stepSize = GetStepSizeForAsset(info, coin, "BTC");
                if (stepSize == null)
                    Console.WriteLine("Couldn't find info for coin " + coin);
                else
                    Console.WriteLine("Step size for coin " + coin + " is " + stepSize);
            }
        }

        public static decimal? GetStepSizeForAsset(BinanceExchangeInfo info, string baseAsset, string quoteAsset)
        {
            var asset = info.Symbols.SingleOrDefault(s => s.QuoteAsset.ToLower() == quoteAsset.ToLower() && s.BaseAsset.ToLower() == baseAsset.ToLower());
            return asset?.Filters.OfType<BinanceSymbolLotSizeFilter>().First().StepSize;
        }
    }

from binance.net.

JKorf avatar JKorf commented on August 22, 2024

That makes sense yes

from binance.net.

JKorf avatar JKorf commented on August 22, 2024

Btw, you can also enable automatic compliance of the trade rules by setting TradeRulesBehaviour to AutoComply. It will automatically floor the quantity using the stepsize it gets from the server.

from binance.net.

JKorf avatar JKorf commented on August 22, 2024

Hm that's weird. What values we're you using when you got that error?

from binance.net.

JKorf avatar JKorf commented on August 22, 2024

I see, the problem is the wrapper sends too many trailing zero's. I've fixed it and pushing it to Nuget.

from binance.net.

JKorf avatar JKorf commented on August 22, 2024

Yes

from binance.net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.