mirror of
https://github.com/JKorf/CryptoExchange.Net.git
synced 2026-10-17 00:20:55 +00:00
ae7504c26c
Added V2 Shared API's infrastructure Added request coalescing Added rate limiting admission logic Fixed some rate limiting issues
123 lines
4.7 KiB
C#
123 lines
4.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>
|
|
/// 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.
|
|
/// </summary>
|
|
public decimal? UpperPriceLimitPercentage { get; set; }
|
|
/// <summary>
|
|
/// 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.
|
|
/// </summary>
|
|
public decimal? LowerPriceLimitPercentage { get; set; }
|
|
/// <summary>
|
|
/// 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.
|
|
/// </summary>
|
|
public decimal? MakerFeePercentage { get; set; }
|
|
/// <summary>
|
|
/// 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.
|
|
/// </summary>
|
|
public decimal? TakerFeePercentage { 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 };
|
|
}
|
|
}
|