Skip to content

Commit

Permalink
auction: add note about autoclose
Browse files Browse the repository at this point in the history
  • Loading branch information
erwanor committed Apr 25, 2024
1 parent a366ec5 commit d85c02f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/core/component/auction/src/component/dutch_auction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,10 @@ trait Inner: StateWrite {

let mut lp =
Position::new_with_nonce(tough_nonce, pair.clone(), 0u32, p, q, lp_reserves);
// PSA, hackers:
// Since our goal is to acquire some output asset, we want to close the
// position as soon as it gets filled. Otherwise, it could round-trip
// back to the input asset which defeats the purpose.
lp.close_on_fill = true;

let position_id = lp.id();
Expand Down

0 comments on commit d85c02f

Please sign in to comment.