From 07307b65f854a1ea98edffa2a288864eed0343bd Mon Sep 17 00:00:00 2001 From: kaleb Date: Fri, 19 Apr 2024 17:18:50 +0200 Subject: [PATCH] Update sip-378.md --- content/sips/sip-378.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/sips/sip-378.md b/content/sips/sip-378.md index 368c85678..18fd7d333 100644 --- a/content/sips/sip-378.md +++ b/content/sips/sip-378.md @@ -26,12 +26,12 @@ C) Allow for 0 fee perp trading -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