Skip to content

Commit

Permalink
program: improve-init-market-default-and-logs (#1380)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xbigz authored Jan 2, 2025
1 parent f54daa2 commit 9ba9b97
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions programs/drift/src/instructions/admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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()
},
};
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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(())
}
Expand Down

0 comments on commit 9ba9b97

Please sign in to comment.