Skip to content

Commit

Permalink
dex: fix mistake when collecting prev reserves
Browse files Browse the repository at this point in the history
  • Loading branch information
erwanor committed Jan 28, 2025
1 parent 13dfa45 commit 1eef064
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ pub(crate) trait PositionVolumeTracker: StateWrite {
// We **DO NOT** want to track the volume of the other asset denominated in staking tokens.
let prev_r1 = prev_state
.as_ref()
.map_or(Amount::zero(), |prev| new_state.reserves_1().amount);
.map_or(Amount::zero(), |prev| prev.reserves_1().amount);

let prev_r2 = prev_state
.as_ref()
.map_or(Amount::zero(), |prev| new_state.reserves_2().amount);
.map_or(Amount::zero(), |prev| prev.reserves_2().amount);

let new_r1 = new_state.reserves_1().amount;
let new_r2 = new_state.reserves_2().amount;
Expand Down

0 comments on commit 1eef064

Please sign in to comment.