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 InitializeParamswhere MarketSizeParams: BorshDeserialize, u64: BorshDeserialize, u16: BorshDeserialize, Pubkey: BorshDeserialize, Option<u32>: BorshDeserialize,

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§

impl BorshSerialize for InitializeParamswhere MarketSizeParams: BorshSerialize, u64: BorshSerialize, u16: BorshSerialize, Pubkey: BorshSerialize, Option<u32>: BorshSerialize,

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§

§

impl<T> AbiExample for T

§

default fn example() -> T

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.
§

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

§

fn vzip(self) -> V