fix trailing space
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
This commit is contained in:
parent
4f7e3a5738
commit
b5734e4f97
|
@ -2,24 +2,23 @@ use anchor_lang::prelude::*;
|
|||
|
||||
use crate::error::MangoError;
|
||||
use crate::state::*;
|
||||
use anchor_spl::token::Token;
|
||||
|
||||
#[derive(Accounts)]
|
||||
pub struct CreatePerpMarket<'info> {
|
||||
#[account(
|
||||
mut,
|
||||
has_one = admin,
|
||||
)]
|
||||
pub group: AccountLoader<'info, Group>,
|
||||
pub admin: Signer<'info>,
|
||||
|
||||
pub oracle: UncheckedAccount<'info>,
|
||||
|
||||
#[account(
|
||||
init,
|
||||
seeds = [group.key().as_ref(), b"PerpMarket".as_ref(), oracle.key().as_ref()],
|
||||
bump,
|
||||
payer = payer,
|
||||
space = 8 + std::mem::size_of::<PerpMarket>(),
|
||||
space = 8 + std::mem::size_of::<PerpMarket>(),
|
||||
)]
|
||||
pub perp_market: AccountLoader<'info, PerpMarket>,
|
||||
#[account(
|
||||
|
@ -27,7 +26,7 @@ pub struct CreatePerpMarket<'info> {
|
|||
seeds = [group.key().as_ref(), b"Asks".as_ref(), perp_market.key().as_ref()],
|
||||
bump,
|
||||
payer = payer,
|
||||
space = 8 + std::mem::size_of::<PerpMarket>(),
|
||||
space = 8 + std::mem::size_of::<Book>(),
|
||||
)]
|
||||
pub asks: AccountLoader<'info, crate::state::Book>,
|
||||
#[account(
|
||||
|
@ -35,7 +34,7 @@ pub struct CreatePerpMarket<'info> {
|
|||
seeds = [group.key().as_ref(), b"Bids".as_ref(), perp_market.key().as_ref()],
|
||||
bump,
|
||||
payer = payer,
|
||||
space = 8 + std::mem::size_of::<PerpMarket>(),
|
||||
space = 8 + std::mem::size_of::<Book>(),
|
||||
)]
|
||||
pub bids: AccountLoader<'info, Book>,
|
||||
#[account(
|
||||
|
@ -43,7 +42,7 @@ pub struct CreatePerpMarket<'info> {
|
|||
seeds = [group.key().as_ref(), b"EventQueue".as_ref(), perp_market.key().as_ref()],
|
||||
bump,
|
||||
payer = payer,
|
||||
space = 8 + std::mem::size_of::<PerpMarket>(),
|
||||
space = 8 + std::mem::size_of::<EventQueue>(),
|
||||
)]
|
||||
pub event_queue: AccountLoader<'info, crate::state::EventQueue>,
|
||||
|
||||
|
@ -51,14 +50,17 @@ pub struct CreatePerpMarket<'info> {
|
|||
pub payer: Signer<'info>,
|
||||
|
||||
pub system_program: Program<'info, System>,
|
||||
pub token_program: Program<'info, Token>,
|
||||
pub rent: Sysvar<'info, Rent>,
|
||||
}
|
||||
|
||||
pub fn create_perp_market(
|
||||
ctx: Context<CreatePerpMarket>,
|
||||
quote_lot_size: i64,
|
||||
base_lot_size: i64,
|
||||
// todo
|
||||
// base token index (optional)
|
||||
// quote token index
|
||||
// oracle
|
||||
// perp market index
|
||||
) -> Result<()> {
|
||||
let mut perp_market = ctx.accounts.perp_market.load_init()?;
|
||||
*perp_market = PerpMarket {
|
||||
|
|
Loading…
Reference in New Issue