From 9ba9b97378f3790d222036d12147f7f2107559ba Mon Sep 17 00:00:00 2001 From: bigz_Pubkey <83473873+0xbigz@users.noreply.github.com> Date: Thu, 2 Jan 2025 16:31:50 -0500 Subject: [PATCH] program: improve-init-market-default-and-logs (#1380) --- programs/drift/src/instructions/admin.rs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/programs/drift/src/instructions/admin.rs b/programs/drift/src/instructions/admin.rs index 7fad00f10..2a079a5f8 100644 --- a/programs/drift/src/instructions/admin.rs +++ b/programs/drift/src/instructions/admin.rs @@ -306,8 +306,8 @@ pub fn handle_initialize_spot_market( min_borrow_rate: 0, fuel_boost_deposits: 0, fuel_boost_borrows: 0, - fuel_boost_taker: 0, - fuel_boost_maker: 0, + fuel_boost_taker: 1, + fuel_boost_maker: 1, fuel_boost_insurance: 0, token_program, pool_id: 0, @@ -317,6 +317,7 @@ pub fn handle_initialize_spot_market( unstaking_period: THIRTEEN_DAY, total_factor: if_total_factor, user_factor: if_total_factor / 2, + revenue_settle_period: 3600, ..InsuranceFund::default() }, }; @@ -891,8 +892,8 @@ pub fn handle_initialize_perp_market( quote_spot_market_index: QUOTE_SPOT_MARKET_INDEX, fee_adjustment: 0, fuel_boost_position: 0, - fuel_boost_taker: 0, - fuel_boost_maker: 0, + fuel_boost_taker: 1, + fuel_boost_maker: 1, pool_id: 0, high_leverage_margin_ratio_initial: 0, high_leverage_margin_ratio_maintenance: 0, @@ -998,6 +999,16 @@ pub fn handle_initialize_perp_market( safe_increment!(state.number_of_markets, 1); controller::amm::update_concentration_coef(perp_market, concentration_coef_scale)?; + crate::dlog!(oracle_price); + + let (amm_bid_size, amm_ask_size) = amm::calculate_market_open_bids_asks(&perp_market.amm)?; + crate::dlog!(amm_bid_size, amm_ask_size); + + let mrk = perp_market.amm.reserve_price()?; + let (amm_bid_price, amm_ask_price) = perp_market.amm.bid_ask_price(mrk)?; + crate::dlog!(amm_bid_price, amm_ask_price); + + crate::validation::perp_market::validate_perp_market(perp_market)?; Ok(()) }