remove unused

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
This commit is contained in:
microwavedcola1 2022-03-18 16:30:18 +01:00
parent ba9bc82df2
commit ab61c6b244
8 changed files with 0 additions and 170 deletions

View File

@ -1,11 +0,0 @@
use anchor_lang::prelude::*;
use fixed::types::I80F48;
pub struct SpotMarketInfo {
pub spot_market: Pubkey,
pub maint_asset_weight: I80F48,
pub init_asset_weight: I80F48,
pub maint_liab_weight: I80F48,
pub init_liab_weight: I80F48,
pub liquidation_fee: I80F48,
}

View File

@ -1,30 +0,0 @@
use fixed::types::I80F48;
pub struct AnyAdvancedOrder {
pub advanced_order_type: AdvancedOrderType,
pub is_active: bool,
pub padding: [u8; ADVANCED_ORDER_SIZE - 2],
}
pub struct PerpTriggerOrder {
pub advanced_order_type: AdvancedOrderType,
pub is_active: bool,
pub market_index: u8,
pub order_type: OrderType,
pub side: Side,
pub trigger_condition: TriggerCondition, // Bid & Below => Take profit on short, Bid & Above => stop loss on short
pub reduce_only: bool, // only valid on perp order
pub padding0: [u8; 1],
pub client_order_id: u64,
pub price: i64,
pub quantity: i64,
pub trigger_price: I80F48,
/// Padding for expansion
pub padding1: [u8; 32],
}
pub struct AdvancedOrders {
pub meta_data: MetaData,
pub orders: [AnyAdvancedOrder; MAX_ADVANCED_ORDERS],
}

View File

@ -1,32 +0,0 @@
use fixed::types::I80F48;
// todo: I remember hearing something around we wanting to use the oracle account directly in program?
// but then if the confidence is bad, how would we refer to last known confident value?
pub struct PriceCache {
pub price: I80F48, // unit is interpreted as how many quote native tokens for 1 base native token
pub last_update: u64,
}
// todo: can we use rootbank directly?
// what about write locks? sleep on this!
pub struct RootBankCache {
pub deposit_index: I80F48,
pub borrow_index: I80F48,
pub last_update: u64,
}
// todo: can we just use the perpmarket directly?
// what about write locks? sleep on this!
pub struct PerpMarketCache {
pub long_funding: I80F48,
pub short_funding: I80F48,
pub last_update: u64,
}
pub struct MangoCache {
pub meta_data: MetaData,
pub price_cache: [PriceCache; MAX_PAIRS],
pub root_bank_cache: [RootBankCache; MAX_TOKENS],
pub perp_market_cache: [PerpMarketCache; MAX_PAIRS],
}

View File

@ -1,3 +0,0 @@
pub struct OrderBookStateHeader {
pub account_flags: u64, // Initialized, (Bids or Asks)
}

View File

@ -1,19 +0,0 @@
use fixed::types::I80F48;
pub struct PerpAccount {
pub base_position: i64, // measured in base lots
pub quote_position: I80F48, // measured in native quote
pub long_settled_funding: I80F48,
pub short_settled_funding: I80F48,
// orders related info
pub bids_quantity: i64, // total contracts in sell orders
pub asks_quantity: i64, // total quote currency in buy orders
/// Amount that's on EventQueue waiting to be processed
pub taker_base: i64,
pub taker_quote: i64,
pub mngo_accrued: u64,
}

View File

@ -1,47 +0,0 @@
use anchor_lang::prelude::*;
use fixed::types::I80F48;
pub struct LiquidityMiningInfo {
/// Used to convert liquidity points to MNGO
pub rate: I80F48,
pub max_depth_bps: I80F48, // instead of max depth bps, this should be max num contracts
/// start timestamp of current liquidity incentive period; gets updated when mngo_left goes to 0
pub period_start: u64,
/// Target time length of a period in seconds
pub target_period_length: u64,
/// Paper MNGO left for this period
pub mngo_left: u64,
/// Total amount of MNGO allocated for current period
pub mngo_per_period: u64,
}
pub struct PerpMarket {
pub meta_data: MetaData,
pub mango_group: Pubkey,
pub bids: Pubkey,
pub asks: Pubkey,
pub event_queue: Pubkey,
pub quote_lot_size: i64, // number of quote native that reresents min tick
pub base_lot_size: i64, // represents number of base native quantity; greater than 0
// TODO - consider just moving this into the cache
pub long_funding: I80F48,
pub short_funding: I80F48,
pub open_interest: i64, // This is i64 to keep consistent with the units of contracts, but should always be > 0
pub last_updated: u64,
pub seq_num: u64,
pub fees_accrued: I80F48, // native quote currency
pub liquidity_mining_info: LiquidityMiningInfo,
// mngo_vault holds mango tokens to be disbursed as liquidity incentives for this perp market
pub mngo_vault: Pubkey,
}

View File

@ -1,16 +0,0 @@
use fixed::types::I80F48;
use crate::Pubkey;
pub struct PerpMarketInfo {
pub perp_market: Pubkey, // One of these may be empty
pub maint_asset_weight: I80F48,
pub init_asset_weight: I80F48,
pub maint_liab_weight: I80F48,
pub init_liab_weight: I80F48,
pub liquidation_fee: I80F48,
pub maker_fee: I80F48,
pub taker_fee: I80F48,
pub base_lot_size: i64, // The lot size of the underlying
pub quote_lot_size: i64, // min tick
}

View File

@ -1,12 +0,0 @@
use anchor_lang::prelude::*;
pub struct ReferrerMemory {
pub meta_data: MetaData,
pub referrer_mango_account: Pubkey,
}
pub struct ReferrerIdRecord {
pub meta_data: MetaData,
pub referrer_mango_account: Pubkey,
pub id: [u8; INFO_LEN], // this id is one of the seeds
}