pub struct Config<M>where
M: Currency,{ /* private fields */ }
Expand description
Define the Exchange configuration
Implementations§
source§impl<M> Config<M>where
M: Currency,
impl<M> Config<M>where
M: Currency,
sourcepub fn contract_specification(
&self
) -> &ContractSpecification<M::PairedCurrency>
pub fn contract_specification( &self ) -> &ContractSpecification<M::PairedCurrency>
The contract specification.
source§impl<M> Config<M>where
M: Currency,
impl<M> Config<M>where
M: Currency,
sourcepub fn starting_balance(&self) -> M
pub fn starting_balance(&self) -> M
The starting balance of account (denoted in margin currency).
The concrete Currency
here defines the futures type.
If QuoteCurrency
is used as the margin currency,
then its a linear futures contract.
If BaseCurrency
is used as the margin currency,
then its an inverse futures contract.
sourcepub fn max_num_open_orders(&self) -> usize
pub fn max_num_open_orders(&self) -> usize
The maximum number of open orders the user can have at any given time
sourcepub fn initial_leverage(&self) -> Leverage
pub fn initial_leverage(&self) -> Leverage
The leverage initially set by the user.
source§impl<M> Config<M>where
M: Currency,
impl<M> Config<M>where
M: Currency,
sourcepub fn new(
starting_balance: M,
max_num_open_orders: usize,
initial_leverage: Leverage,
contract_specification: ContractSpecification<M::PairedCurrency>
) -> Result<Self>
pub fn new( starting_balance: M, max_num_open_orders: usize, initial_leverage: Leverage, contract_specification: ContractSpecification<M::PairedCurrency> ) -> Result<Self>
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
max_num_open_orders
: The maximum number of open ordes a user can have
at any time.
initial_leverage
: The initial desired leverage of positions.
contract_specification
: More details on the actual contract traded.
§Returns:
Either a valid Config or an Error