From 28b9f15b373d038c9eda3c6cb800d6871f815aa7 Mon Sep 17 00:00:00 2001 From: kaleb Date: Mon, 22 Apr 2024 18:52:39 +0200 Subject: [PATCH] Update sip-378.md --- content/sips/sip-378.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/sips/sip-378.md b/content/sips/sip-378.md index 18fd7d333..110ee9aa5 100644 --- a/content/sips/sip-378.md +++ b/content/sips/sip-378.md @@ -28,7 +28,7 @@ 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 (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. +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 incorporate a new staleness check requirement `INFINITE` which uses the last pushed price 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 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.