pub struct Config { /* private fields */ }
Expand description
Define the Exchange configuration
Implementations
sourceimpl Config
impl Config
sourcepub fn new(
fee_maker: f64,
fee_taker: f64,
starting_balance: f64,
leverage: f64,
futures_type: FuturesTypes,
identification: String,
set_order_timestamps: bool
) -> Result<Config>
pub fn new(
fee_maker: f64,
fee_taker: f64,
starting_balance: f64,
leverage: f64,
futures_type: FuturesTypes,
identification: String,
set_order_timestamps: bool
) -> Result<Config>
Create a new Config
Arguments
fee_maker: The maker fee as fraction, e.g 6bp -> 0.0006 fee_taker: The taker fee as fraction starting_balance: Initial Wallet Balance, denoted in QUOTE if using linear futures, denoted in BASE for inverse futures leverage: The positions leverage futures_type: The type of futures contract to simulate identification: A way to identify an exchange
Returns
Either a valid Config or an Error
sourcepub fn starting_balance(&self) -> f64
pub fn starting_balance(&self) -> f64
Return the starting wallet balance of this Config
sourcepub fn futures_type(&self) -> FuturesTypes
pub fn futures_type(&self) -> FuturesTypes
Return the FuturesType of the Config
sourcepub fn identification(&self) -> &str
pub fn identification(&self) -> &str
Return the exchange identification
sourcepub fn set_order_timestamps(&self) -> bool
pub fn set_order_timestamps(&self) -> bool
Return whether or not the Exchange is configured to set order timestamps in submit_order method
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
sourcefn 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 Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more