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 22, 2024
1 parent 07307b6 commit 28b9f15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion content/sips/sip-378.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 28b9f15

Please sign in to comment.