pub struct InitializeParams {
pub market_size_params: MarketSizeParams,
pub num_quote_lots_per_quote_unit: u64,
pub tick_size_in_quote_lots_per_base_unit: u64,
pub num_base_lots_per_base_unit: u64,
pub taker_fee_bps: u16,
pub fee_collector: Pubkey,
pub raw_base_units_per_base_unit: Option<u32>,
}
Fields§
§market_size_params: MarketSizeParams
These parameters define the number of orders on each side of the market as well as the maximum
number of supported traders. They are used to deserialize the market state (see dispatch_market.rs
).
num_quote_lots_per_quote_unit: u64
Number of quote lots to make up a full quote unit. Quote lots are the smallest measurement for the quote currency that can be processed by the market. 1 “unit” is the standard measure of a currency (e.g. 1 US Dollar, 1 Euro, or 1 BTC).
Assume the quote mint is USDC. If num_quote_lots_per_quote_unit is equal to 10000, this means that the smallest unit that the exchange can process is $0.0001. Because USDC has 6 decimals, this means the equivalent quote_lot_size (quote atoms per quote lot) is equal to 1e6 / 10000 = 100.
tick_size_in_quote_lots_per_base_unit: u64
Tick size, in quote lots per base units. A tick is the smallest price increment for a market.
Assume the quote mint is USDC and num_quote_lots_per_quote_unit is equal to 10000 (quote_lot_size = 100). If tick size is equal to $0.01 (10000 atoms), this means that tick_size_in_quote_lots_per_base_unit is equal to tick_size / quote_lot_size = 10000 / 100 = 100.
num_base_lots_per_base_unit: u64
Number of base lots to make up a full base unit. Base lots are the smallest measurement for the base currency that can be processed by the market.
Assume the base mint is SOL. If num_base_lots_per_base_unit is equal to 1000, this means that the smallest unit that the exchange can process is 0.0001 SOL. Because SOL has 9 decimals, this means the equivalent base_lot_size is equal to 1e9 / 1000 = 1e6.
taker_fee_bps: u16
Market fee charged to takers, in basis points (0.01%). This fee is charged on the quote currency.
fee_collector: Pubkey
The Pubkey of the account that will receive fees for this market.
raw_base_units_per_base_unit: Option<u32>
1 raw base unit is defined as 10^base_mint_decimals atoms.
By default, raw_base_units_per_base_unit is set to 1 (if the Option is passed in as None
).
It is highly recommended to be a power of 10.
If this parameter is supplied, the market will treat the number of base atoms in a base unit as
(10^base_mint_decimals) * raw_base_units_per_base_unit
.
Trait Implementations§
Source§impl BorshDeserialize for InitializeParams
impl BorshDeserialize for InitializeParams
fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self, Error>
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSerialize for InitializeParamswhere
MarketSizeParams: BorshSerialize,
u64: BorshSerialize,
u16: BorshSerialize,
Pubkey: BorshSerialize,
Option<u32>: BorshSerialize,
impl BorshSerialize for InitializeParamswhere
MarketSizeParams: BorshSerialize,
u64: BorshSerialize,
u16: BorshSerialize,
Pubkey: BorshSerialize,
Option<u32>: BorshSerialize,
Auto Trait Implementations§
impl Freeze for InitializeParams
impl RefUnwindSafe for InitializeParams
impl Send for InitializeParams
impl Sync for InitializeParams
impl Unpin for InitializeParams
impl UnwindSafe for InitializeParams
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more