refactor: rename

This commit is contained in:
ysq
2025-07-11 16:38:30 +08:00
parent 2b970698c2
commit 9946637c62
3 changed files with 16 additions and 16 deletions
+4 -4
View File
@@ -8,8 +8,8 @@ pub fn get_amount_out(
share_fee_rate: u128,
virtual_base: u128,
virtual_quote: u128,
real_base_before: u128,
real_quote_before: u128,
real_base: u128,
real_quote: u128,
slippage_basis_points: u128,
) -> u64 {
let amount_in_u128 = amount_in as u128;
@@ -23,8 +23,8 @@ pub fn get_amount_out(
.unwrap()
.checked_sub(share_fee)
.unwrap();
let input_reserve = virtual_quote.checked_add(real_quote_before).unwrap();
let output_reserve = virtual_base.checked_sub(real_base_before).unwrap();
let input_reserve = virtual_quote.checked_add(real_quote).unwrap();
let output_reserve = virtual_base.checked_sub(real_base).unwrap();
let numerator = amount_in_net.checked_mul(output_reserve).unwrap();
let denominator = input_reserve.checked_add(amount_in_net).unwrap();
let mut amount_out = numerator.checked_div(denominator).unwrap();
+4 -4
View File
@@ -126,8 +126,8 @@ impl ProtocolParams for PumpSwapParams {
pub struct BonkParams {
pub virtual_base: Option<u128>,
pub virtual_quote: Option<u128>,
pub real_base_before: Option<u128>,
pub real_quote_before: Option<u128>,
pub real_base: Option<u128>,
pub real_quote: Option<u128>,
pub auto_handle_wsol: bool,
}
@@ -136,8 +136,8 @@ impl BonkParams {
Self {
virtual_base: None,
virtual_quote: None,
real_base_before: None,
real_quote_before: None,
real_base: None,
real_quote: None,
auto_handle_wsol: true,
}
}