Struct nash_protocol::types::exchange::Market [−][src]
pub struct Market {
pub asset_a: AssetofPrecision,
pub asset_b: AssetofPrecision,
pub min_trade_size_a: AssetAmount,
pub min_trade_size_b: AssetAmount,
}
Expand description
This type encodes all the information necessary for a client operating over the protocol to understand a market.
Fields
asset_a: AssetofPrecision
asset_b: AssetofPrecision
min_trade_size_a: AssetAmount
min_trade_size_b: AssetAmount
Implementations
pub fn new(
asset_a: AssetofPrecision,
asset_b: AssetofPrecision,
min_trade_size_a: AssetAmount,
min_trade_size_b: AssetAmount
) -> Self
pub fn new(
asset_a: AssetofPrecision,
asset_b: AssetofPrecision,
min_trade_size_a: AssetAmount,
min_trade_size_b: AssetAmount
) -> Self
Create a new market from assets with precision
use nash_protocol::types::{Market, Asset};
Market::new(Asset::ETH.with_precision(4), Asset::USDC.with_precision(2));
Return name of A/B market as “A_B”
pub fn blockchains(&self) -> Vec<Blockchain>ⓘ
pub fn blockchains(&self) -> Vec<Blockchain>ⓘ
Get list of blockchains associated with this market. There will always be either one or two blockchains associated with a market.
Get market asset by string name
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Market
impl UnwindSafe for Market
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more