1
0
mirror of https://github.com/JKorf/CryptoExchange.Net.git synced 2026-08-11 08:22:53 +00:00
Files
CryptoExchange.Net/CryptoExchange.Net/SharedApis/ResponseModels/SharedSpotSymbol.cs
T
Jan Korf fcb36f7ee0 Shared asset and symbol types
Added SpotSymbolCatalog to Shared ISpotSymbolRestClient interface
Added FuturesSymbolCatalog to Shared IFuturesSymbolRestClient interface
Added BaseAssetType, BaseAssetSubType, QuoteAssetType and QuoteAssetSubType to GetSymbolsRequest model
Added DisplayName to SharedSpotSymbol and SharedFuturesSymbol models
Added BaseAssetType, BaseAssetSubType, QuoteAssetType and QuoteAssetSubType to SharedSpotSymbol and SharedFuturesSymbol models
Added IsStableCoin, IsCommodity and IsEquity helper methods to LibraryHelpers
2026-07-20 13:40:58 +02:00

107 lines
3.7 KiB
C#

using System;
using System.Data;
using System.Diagnostics;
namespace CryptoExchange.Net.SharedApis
{
/// <summary>
/// Symbol info
/// </summary>
[DebuggerDisplay("{DebugView,nq}")]
public record SharedSpotSymbol
{
private string DebugView => $"{TradingMode} {(DisplayName ?? Name)} - {BaseAssetType} {BaseAssetSubType}";
/// <summary>
/// The trading mode of the symbol
/// </summary>
public TradingMode TradingMode { get; set; }
/// <summary>
/// Base asset of the symbol
/// </summary>
public string BaseAsset { get; set; }
/// <summary>
/// Quote asset of the symbol
/// </summary>
public string QuoteAsset { get; set; }
/// <summary>
/// The name of the symbol
/// </summary>
public string Name { get; set; }
/// <summary>
/// The display name of the symbol
/// </summary>
public string? DisplayName { get; set; }
/// <summary>
/// Minimal quantity of an order in the base asset
/// </summary>
public decimal? MinTradeQuantity { get; set; }
/// <summary>
/// Minimal notional value (quantity * price) of an order
/// </summary>
public decimal? MinNotionalValue { get; set; }
/// <summary>
/// Max quantity of an order in the base asset
/// </summary>
public decimal? MaxTradeQuantity { get; set; }
/// <summary>
/// Step by which the quantity should increase
/// </summary>
public decimal? QuantityStep { get; set; }
/// <summary>
/// Step by which the price should increase
/// </summary>
public decimal? PriceStep { get; set; }
/// <summary>
/// The max amount of decimal places for quantity
/// </summary>
public int? QuantityDecimals { get; set; }
/// <summary>
/// The max amount of decimal places for price
/// </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; }
/// <summary>
/// Base asset type
/// </summary>
public SharedAssetType BaseAssetType { get; set; }
/// <summary>
/// Base asset sub type
/// </summary>
public SharedAssetSubType? BaseAssetSubType { get; set; }
/// <summary>
/// Quote asset type
/// </summary>
public SharedAssetType QuoteAssetType { get; set; }
/// <summary>
/// Quote asset sub type
/// </summary>
public SharedAssetSubType? QuoteAssetSubType { get; set; }
/// <summary>
/// ctor
/// </summary>
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;
}
/// <summary>
/// The SharedSymbol of this symbol
/// </summary>
/// <returns></returns>
public virtual SharedSymbol SharedSymbol => new SharedSymbol(TradingMode, BaseAsset.ToUpperInvariant(), QuoteAsset.ToUpperInvariant()) { SymbolName = Name };
}
}