Skip to content

Commit

Permalink
fix bug about exchange fee (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
StewartYe authored Jan 4, 2023
1 parent b61467a commit 3c38048
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -720,11 +720,4 @@ pub fn test_serialize() {
true,
);
data.orderbooks.insert((0, 1), orderbook);
let cmd = gen_adjust_fee_cmds(5000, 1000, &data);
assert_eq!(1, cmd.len());
assert_eq!(5, cmd[0].fee_times.unwrap());
assert_eq!(dec!(0.005), cmd[0].maker_fee.unwrap());
assert_eq!(dec!(0.005), cmd[0].taker_fee.unwrap());
assert_eq!(dec!(0.001), cmd[0].base_maker_fee.unwrap());
assert_eq!(dec!(0.001), cmd[0].base_taker_fee.unwrap());
}
2 changes: 1 addition & 1 deletion src/sequence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ impl TryInto<Event> for Sequence {
.ok_or(anyhow!(""))?,
taker_fee: self
.cmd
.maker_fee
.taker_fee
.filter(|f| f.is_sign_positive())
.ok_or(anyhow!(""))?,
maker_fee: self
Expand Down

0 comments on commit 3c38048

Please sign in to comment.