Skip to content

Commit abb8b87

Browse files
committed
Fix order summary scaling
1 parent 8ec5672 commit abb8b87

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

program/src/processor/cancel_order.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,10 @@ pub(crate) fn process(
167167
.total_base_qty
168168
.checked_mul(market_state.base_currency_multiplier)
169169
.unwrap();
170+
order_summary.total_base_qty_posted = order_summary
171+
.total_base_qty_posted
172+
.checked_mul(market_state.base_currency_multiplier)
173+
.unwrap();
170174
order_summary.total_quote_qty = order_summary
171175
.total_quote_qty
172176
.checked_mul(market_state.quote_currency_multiplier)

program/src/processor/new_order.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,10 @@ pub(crate) fn process(
298298
.total_base_qty
299299
.checked_mul(market_state.base_currency_multiplier)
300300
.unwrap();
301+
order_summary.total_base_qty_posted = order_summary
302+
.total_base_qty_posted
303+
.checked_mul(market_state.base_currency_multiplier)
304+
.unwrap();
301305
order_summary.total_quote_qty = order_summary
302306
.total_quote_qty
303307
.checked_mul(market_state.quote_currency_multiplier)

program/src/processor/swap.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,10 @@ pub(crate) fn process(
254254
.total_base_qty
255255
.checked_mul(market_state.base_currency_multiplier)
256256
.unwrap();
257+
order_summary.total_base_qty_posted = order_summary
258+
.total_base_qty_posted
259+
.checked_mul(market_state.base_currency_multiplier)
260+
.unwrap();
257261
order_summary.total_quote_qty = order_summary
258262
.total_quote_qty
259263
.checked_mul(market_state.quote_currency_multiplier)

program/tests/functional.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ use dex_v4::state::UserAccountHeader;
1313
use dex_v4::state::DEX_STATE_LEN;
1414
use dex_v4::state::USER_ACCOUNT_HEADER_LEN;
1515
use mpl_token_metadata::pda::find_metadata_account;
16+
use solana_program::account_info::AccountInfo;
17+
use solana_program::entrypoint::ProgramResult;
18+
use solana_program::msg;
19+
use solana_program::program_error::PrintProgramError;
1620
use solana_program::pubkey::Pubkey;
1721
use solana_program::system_instruction::create_account;
1822
use solana_program::system_program;
@@ -148,7 +152,7 @@ async fn test_dex() {
148152
},
149153
create_market::Params {
150154
signer_nonce: signer_nonce as u64,
151-
min_base_order_size: 10,
155+
min_base_order_size: 10_000,
152156
tick_size: 1,
153157
base_currency_multiplier: 1_000,
154158
quote_currency_multiplier: 1,

0 commit comments

Comments
 (0)