1
0
mirror of https://github.com/JKorf/CryptoExchange.Net synced 2025-06-06 23:46:12 +00:00

Added PriceSignificationFigures to SharedSpotSymbol model

This commit is contained in:
Jkorf 2025-01-21 14:00:08 +01:00
parent cf397af3ab
commit 2af1520ecc
2 changed files with 5 additions and 0 deletions

View File

@ -261,6 +261,7 @@ namespace CryptoExchange.Net
if (price != null)
{
adjustedPrice = AdjustValueStep(0, decimal.MaxValue, symbol.PriceStep, RoundingType.Down, price.Value);
adjustedPrice = symbol.PriceSignificantFigures.HasValue ? RoundToSignificantDigits(adjustedPrice.Value, symbol.PriceSignificantFigures.Value, RoundingType.Closest) : adjustedPrice;
adjustedPrice = symbol.PriceDecimals.HasValue ? RoundDown(price.Value, symbol.PriceDecimals.Value) : adjustedPrice;
if (adjustedPrice != 0 && adjustedPrice * quantity < symbol.MinNotionalValue)
{

View File

@ -46,6 +46,10 @@
/// </summary>
public int? PriceDecimals { get; set; }
/// <summary>
/// The max amount of significant figures to use for price. For example with value of 5 these values are valid: 0.00001, 0.12300, 123.53, 12345, but this is not: 12345.1
/// </summary>
public int? PriceSignificantFigures { get; set; }
/// <summary>
/// Whether the symbol is currently available for trading
/// </summary>
public bool Trading { get; set; }