using System;
using System.Data;
using System.Diagnostics;
namespace CryptoExchange.Net.SharedApis
{
///
/// Symbol info
///
[DebuggerDisplay("{DebugView,nq}")]
public record SharedSpotSymbol
{
private string DebugView => $"{TradingMode} {(DisplayName ?? Name)} - {BaseAssetType} {BaseAssetSubType}";
///
/// The trading mode of the symbol
///
public TradingMode TradingMode { get; set; }
///
/// Base asset of the symbol
///
public string BaseAsset { get; set; }
///
/// Quote asset of the symbol
///
public string QuoteAsset { get; set; }
///
/// The name of the symbol
///
public string Name { get; set; }
///
/// The display name of the symbol
///
public string? DisplayName { get; set; }
///
/// Minimal quantity of an order in the base asset
///
public decimal? MinTradeQuantity { get; set; }
///
/// Minimal notional value (quantity * price) of an order
///
public decimal? MinNotionalValue { get; set; }
///
/// Max quantity of an order in the base asset
///
public decimal? MaxTradeQuantity { get; set; }
///
/// Step by which the quantity should increase
///
public decimal? QuantityStep { get; set; }
///
/// Step by which the price should increase
///
public decimal? PriceStep { get; set; }
///
/// The max amount of decimal places for quantity
///
public int? QuantityDecimals { get; set; }
///
/// The max amount of decimal places for price
///
public int? PriceDecimals { get; set; }
///
/// 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
///
public int? PriceSignificantFigures { get; set; }
///
/// Whether the symbol is currently available for trading
///
public bool Trading { get; set; }
///
/// Base asset type
///
public SharedAssetType BaseAssetType { get; set; }
///
/// Base asset sub type
///
public SharedAssetSubType? BaseAssetSubType { get; set; }
///
/// Quote asset type
///
public SharedAssetType QuoteAssetType { get; set; }
///
/// Quote asset sub type
///
public SharedAssetSubType? QuoteAssetSubType { get; set; }
///
/// The upper price limit percentage for the symbol. For example, if the last price was 200 and this value is 10, the upper price limit would be 220.
///
public decimal? UpperPriceLimitPercentage { get; set; }
///
/// The lower price limit percentage for the symbol. For example, if the last price was 200 and this value is -10, the lower price limit would be 180.
///
public decimal? LowerPriceLimitPercentage { get; set; }
///
/// The base maker fee percentage for the symbol. Note that user trade fees may be different based on the user's tier and other factors.
///
public decimal? MakerFeePercentage { get; set; }
///
/// The base taker fee percentage for the symbol. Note that user trade fees may be different based on the user's tier and other factors.
///
public decimal? TakerFeePercentage { get; set; }
///
/// ctor
///
public SharedSpotSymbol(string baseAsset, string quoteAsset, string symbol, bool trading, TradingMode? tradingMode = null)
{
TradingMode = tradingMode ?? TradingMode.Spot;
BaseAsset = baseAsset;
QuoteAsset = quoteAsset;
Name = symbol;
Trading = trading;
}
///
/// The SharedSymbol of this symbol
///
///
public virtual SharedSymbol SharedSymbol => new SharedSymbol(TradingMode, BaseAsset.ToUpperInvariant(), QuoteAsset.ToUpperInvariant()) { SymbolName = Name };
}
}