Comments (6)
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.
That makes sense yes
from binance.net.
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.
Hm that's weird. What values we're you using when you got that error?
from binance.net.
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.
Yes
from binance.net.
Related Issues (20)
- Issue with Nuget Package in Azure Functions project HOT 4
- StartUserStreamAsync, too many parameters, version 9.9.0 HOT 2
- Problem with latest version HOT 2
- BinanceRateLimit - Count Missing? HOT 2
- Universal Transfer has some missing transfer types HOT 2
- Hello, client.CoinFuturesApi.Account.GetIncomeHistoryAsync reports an error 404 HOT 1
- Is there a way to get borrow interest rates? HOT 2
- how to establish websocket connection HOT 4
- Binance changes since 2024-04-10
- Need add 'orderId' to BinancePayTrade HOT 3
- I want to see the USDT equivalents of my assets. HOT 1
- Field Symbol on BinanceOrderBook in Empty
- Cannot use Library in Azure Functions HOT 1
- Binance: Failed to convert order status: "PENDING_NEW"
- binanceRestClient.SpotApi.ExchangeData.GetProductsAsync() is not working HOT 2
- UsdFuturesApi.SubscribeToUserDataUpdatesAsync HOT 3
- orderbook logic using BinanceFuturesUsdtSymbolOrderBook
- Crash when using socket on 9.9.8 HOT 2
- Set specific HttpClient to use HOT 3
- UsdFutures Limit Order with `TimeInForce` Type `GoodTillDate` Fails
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from binance.net.