#[repr(C)]pub struct Market {Show 22 fields
pub version_tag: u64,
pub airspace: Pubkey,
pub orderbook_market_state: Pubkey,
pub event_queue: Pubkey,
pub asks: Pubkey,
pub bids: Pubkey,
pub underlying_token_mint: Pubkey,
pub underlying_token_vault: Pubkey,
pub ticket_mint: Pubkey,
pub claims_mint: Pubkey,
pub collateral_mint: Pubkey,
pub underlying_oracle: Pubkey,
pub ticket_oracle: Pubkey,
pub fee_destination: Pubkey,
pub seed: [u8; 32],
pub orderbook_paused: bool,
pub tickets_paused: bool,
pub borrow_tenor: i64,
pub lend_tenor: i64,
pub origination_fee: u64,
pub collected_fees: u64,
pub nonce: u64,
/* private fields */
}
Expand description
The Market
contains all the information necessary to run the fixed term market
Utilized by program instructions to verify given transaction accounts are correct. Contains data about the fixed term market including the tenor and ticket<->token conversion rate
Fields
version_tag: u64
Versioning and tag information
airspace: Pubkey
The airspace the market is a part of
orderbook_market_state: Pubkey
The market state of the agnostic orderbook
event_queue: Pubkey
The orderbook event queue
asks: Pubkey
The orderbook asks byteslab
bids: Pubkey
The orderbook bids byteslab
underlying_token_mint: Pubkey
The token mint for the underlying asset of the tickets
underlying_token_vault: Pubkey
Token account storing the underlying asset accounted for by this ticket program
ticket_mint: Pubkey
The token mint for the tickets
claims_mint: Pubkey
Mint owned by fixed-term market to issue claims against a user. These claim notes are monitored by margin to ensure claims are repaid.
collateral_mint: Pubkey
Mint owned by fixed-term market to issue collateral value to a user The collateral notes are monitored by the margin program to track value
underlying_oracle: Pubkey
oracle that defines the value of the underlying asset
ticket_oracle: Pubkey
oracle that defines the value of the tickets
fee_destination: Pubkey
where fees can be withdrawn to
seed: [u8; 32]
The user-defined part of the seed that generated this market’s PDA
orderbook_paused: bool
Is the market taking orders
tickets_paused: bool
Can tickets be redeemed
borrow_tenor: i64
Length of time before a borrow is marked as due, in seconds
lend_tenor: i64
Length of time before a claim is marked as mature, in seconds
origination_fee: u64
assessed on borrows. scaled by origination_fee::FEE_UNIT
collected_fees: u64
amount of fees currently available to be withdrawn by market owner
nonce: u64
Used to generate unique order tags
Implementations
sourceimpl Market
impl Market
for signing CPIs with the market account
sourcepub fn loan_to_disburse(&self, filled_quote: u64) -> u64
pub fn loan_to_disburse(&self, filled_quote: u64) -> u64
how much a borrower should receive from their fill after an origination fee is assessed
sourcepub fn borrow_order_qty(&self, requested: u64) -> u64
pub fn borrow_order_qty(&self, requested: u64) -> u64
the size a borrow order should have including the requested amount plus the origination fee
Trait Implementations
sourceimpl AccountDeserialize for Market
impl AccountDeserialize for Market
sourcefn try_deserialize(buf: &mut &[u8]) -> Result<Self>
fn try_deserialize(buf: &mut &[u8]) -> Result<Self>
Mint
account into a token
Account
. Read moresourcefn try_deserialize_unchecked(buf: &mut &[u8]) -> Result<Self>
fn try_deserialize_unchecked(buf: &mut &[u8]) -> Result<Self>
impl Copy for Market
impl Pod for Market
impl ZeroCopy for Market
Auto Trait Implementations
impl RefUnwindSafe for Market
impl Send for Market
impl Sync for Market
impl Unpin for Market
impl UnwindSafe for Market
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
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
. Read more