Struct InitializeParams

Source
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

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self, Error>

Source§

fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>

Deserializes this instance from a given slice of bytes. Updates the buffer to point at the remaining bytes.
Source§

fn try_from_slice(v: &[u8]) -> Result<Self, Error>

Deserialize this instance from a slice of bytes.
Source§

fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>
where R: Read,

Source§

impl BorshSerialize for InitializeParams

Source§

fn serialize<W: Write>(&self, writer: &mut W) -> Result<(), Error>

Source§

fn try_to_vec(&self) -> Result<Vec<u8>, Error>

Serialize this instance into a vector of bytes.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V