using System;
using System.Diagnostics;
namespace CryptoExchange.Net.SharedApis
{
///
/// Book ticker
///
[DebuggerDisplay("{Symbol,nq} - {BestBidPrice} / {BestAskPrice}")]
public record SharedBookTicker : SharedSymbolModel
{
///
/// Price of the best ask
///
public decimal BestAskPrice { get; set; }
///
/// Quantity of the best ask
///
[Obsolete("Use `BestAskQuantities` instead")]
public decimal BestAskQuantity => BestAskQuantities.QuantityInBaseAsset ?? BestAskQuantities.QuantityInContracts ?? 0;
///
/// Quantities of the best ask
///
public SharedOrderQuantity BestAskQuantities { get; set; }
///
/// Price of the best bid
///
public decimal BestBidPrice { get; set; }
///
/// Quantity of the best bid
///
[Obsolete("Use `BestBidQuantities` instead")]
public decimal BestBidQuantity => BestBidQuantities.QuantityInBaseAsset ?? BestBidQuantities.QuantityInContracts ?? 0;
///
/// Quantities of the best bid
///
public SharedOrderQuantity BestBidQuantities { get; set; }
///
/// ctor
///
public SharedBookTicker(
SharedSymbol? sharedSymbol,
string symbol,
decimal bestAskPrice,
SharedOrderQuantity bestAskQuantity,
decimal bestBidPrice,
SharedOrderQuantity bestBidQuantity)
: base(sharedSymbol, symbol)
{
BestAskPrice = bestAskPrice;
BestAskQuantities = bestAskQuantity.WithCalculatedQuantities(bestAskPrice, null);
BestBidPrice = bestBidPrice;
BestBidQuantities = bestBidQuantity.WithCalculatedQuantities(bestBidPrice, null);
}
}
}