Skip to content

Commit

Permalink
Update sip-378.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kaleb-keny committed Apr 19, 2024
1 parent 65b0a7a commit 07307b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions content/sips/sip-378.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ C) Allow for 0 fee perp trading

<!--A short (~200 word) description of the variable change proposed.-->

A) [`acceptablePriceExceeded`](https://github.com/Synthetixio/synthetix-v3/blob/3912d2f61dd6c7f7c29e750b7f116804027b0965/markets/perps-market/contracts/storage/AsyncOrder.sol#L302) is thrown whenever the limit price is worse than the users' `fillPrice` upon order commitment and settle. As per ERC-7421, integrators are required to push for a fresh price update when the staleness error is thrown. However, the concept of `acceptablePrice` might require fresh price to be includedon commitment in order for the acceptablePrice to be relevant. Hence removing this check, on commitment is necessary in order to simplify the order execution pattern for integrators and decrease the gas cost associated with order execution.
A) [`acceptablePriceExceeded`](https://github.com/Synthetixio/synthetix-v3/blob/3912d2f61dd6c7f7c29e750b7f116804027b0965/markets/perps-market/contracts/storage/AsyncOrder.sol#L302) is thrown whenever the limit price is worse than the users' `fillPrice` upon order commitment and settle. As per ERC-7421, integrators are required to push for a fresh price update when the staleness error is thrown (for write transactions). However, the concept of `acceptablePrice` might require fresh price to be include don commitment in order for the acceptablePrice to be relevant. Hence removing this check, on commitment is necessary in order to simplify the order execution pattern for integrators and decrease the gas cost associated with order execution.

B) [SIP-354](https://sips.synthetix.io/sips/sip-354) introduced a requirement that all markets, in a given supermarket, are not in a stale state, upon order settlement. This cause issues, given that keepers are compensated for updating 1 price per order. Furthermore, when a user commits to an order, staleness is only checked against the position being altered. This SIP proposes to drop tolerance check requirements when [settleOrder](https://github.com/Synthetixio/synthetix-v3/blob/434b685c49db22ddc24cffa07a6b3fbfb8f0df17/markets/perps-market/contracts/modules/AsyncOrderSettlementPythModule.sol#L46) calls [requiredCredit](https://github.com/Synthetixio/synthetix-v3/blob/9b410c97cc1afee9c0c0c4ced5a1e652369bf36f/markets/perps-market/contracts/storage/PerpsMarket.sol#L431C77-L431C86). Note that all other calls to the `requiredCredit` function remain the same with respect to staleness tolerance.


C) Currently the perp markets do no support 0 fee trading if a referrer is set up. This is addressed in this [PR](https://github.com/Synthetixio/synthetix-v3/pull/2110) which results in zero'ing out referrer fees in the situation where the the trader fee is set to zero.
C) Currently the perp markets do no support 0 fee in trading, because of a `_checkZeroAddressOrAmount` check done upon withdrawing collateral from core contracts. This is addressed in this [PR](https://github.com/Synthetixio/synthetix-v3/pull/2110) which results in skipping over the fee distribution, in case the amount zero.

## Motivation

Expand Down

0 comments on commit 07307b6

Please sign in to comment.