Skip to content

sui_v1.4.1_1687474683_release

@lxfind lxfind tagged this 22 Jun 20:36
## Description 

Cherry-pick https://github.com/MystenLabs/sui/pull/12464 to release
branch.

The self-matching prevention mechanism ensures that the matching engine
takes measures to avoid unnecessary trades
when matching a user's buy/sell order with their own sell/buy order.

There are four Self-Trade Prevention Options.

Decrement & cancel: Cancel smaller order and decrement larger order by
the smaller size.
If the same size, cancel both.
Cancel oldest: Cancel older (resting) order in full.
Continue to execute the newer taking order.
Cancel newest: Cancel newer (taking) order in full.
Let the old resting order remain on the order book.
Cancel both: Cancel both orders immediately.
For now, we have only implemented the behavior of canceling the oldest
order.
However, we have reserved the self_matching_prevention option as a
parameter
in case we need to implement other behaviors in the future.
This approach allows us to maintain backward compatibility
and provides us with the capability to extend functionality.

## Test Plan 

cd to deepbook dir and run "sui move test"

---
If your changes are not user-facing and not a breaking change, you can
skip the following section. Otherwise, please indicate what changed, and
then add to the Release Notes section as highlighted during the release
process.

### Type of Change (Check all that apply)

- [X ] protocol change
- [ ] user-visible impact
- [ ] breaking change for a client SDKs
- [ ] breaking change for FNs (FN binary must upgrade)
- [X ] breaking change for validators or node operators (must upgrade
binaries)
- [ ] breaking change for on-chain data layout
- [ ] necessitate either a data wipe or data migration

### Release notes
Implemented Self-matching prevention through canceling the oldest order.

Co-authored-by: wiggins-dev <115710624+wiggins-dev@users.noreply.github.com>
Co-authored-by: Mark Logan <mark@mystenlabs.com>
Assets 2
Loading