Skip to content

Commit

Permalink
rename perps market proxy (#1768)
Browse files Browse the repository at this point in the history
Co-authored-by: Peiman <[email protected]>
  • Loading branch information
sunnyvempati and Rickk137 authored Aug 14, 2023
1 parent 08fd1fe commit 5e6e736
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
6 changes: 3 additions & 3 deletions markets/perps-market/cannonfile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ args = [
depends = [
"invoke.upgrade_proxy"
]
factory.AccountProxy.abiOf = ["synthetix.AccountRouter"]
factory.AccountProxy.event = "AssociatedSystemSet"
factory.AccountProxy.arg = 2
factory.PerpsAccountProxy.abiOf = ["synthetix.AccountRouter"]
factory.PerpsAccountProxy.event = "AssociatedSystemSet"
factory.PerpsAccountProxy.arg = 2

# add pool owner to feature flag allow list
[invoke.addPerpsMarketToFeatureFlag]
Expand Down
2 changes: 1 addition & 1 deletion markets/perps-market/contracts/storage/AsyncOrder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ library AsyncOrder {
/**
* @notice Thrown when fill price exceeds the acceptable price set at submission.
*/
error AcceptablePriceExceeded(uint256 acceptablePrice, uint256 fillPrice);
error AcceptablePriceExceeded(uint256 fillPrice, uint256 acceptablePrice);

/**
* @notice Gets thrown when pending orders exist and attempts to modify collateral.
Expand Down
26 changes: 18 additions & 8 deletions markets/perps-market/storage.dump.sol
Original file line number Diff line number Diff line change
Expand Up @@ -423,10 +423,16 @@ interface IAsyncOrderSettlementModule {
int128 newPositionSize;
int128 sizeDelta;
int256 pnl;
int256 accruedFunding;
uint256 pnlUint;
uint256 amountToDeduct;
uint256 settlementReward;
PerpsMarketFactory.Data factory;
uint256 fillPrice;
uint256 totalFees;
uint256 referralFees;
uint256 feeCollectorFees;
Position.Data newPosition;
PerpsMarket.MarketUpdateData updateData;
}
}

Expand Down Expand Up @@ -471,13 +477,8 @@ contract PerpsMarketFactoryModule {
// @custom:artifact contracts/storage/AsyncOrder.sol:AsyncOrder
library AsyncOrder {
struct Data {
uint128 accountId;
uint128 marketId;
int128 sizeDelta;
uint128 settlementStrategyId;
uint256 settlementTime;
uint256 acceptablePrice;
bytes32 trackingCode;
OrderCommitmentRequest request;
}
struct OrderCommitmentRequest {
uint128 marketId;
Expand All @@ -486,12 +487,18 @@ library AsyncOrder {
uint128 settlementStrategyId;
uint256 acceptablePrice;
bytes32 trackingCode;
address referrer;
}
struct SimulateDataRuntime {
int128 sizeDelta;
uint128 accountId;
uint128 marketId;
uint fillPrice;
uint orderFees;
uint availableMargin;
uint currentLiquidationMargin;
uint accumulatedLiquidationRewards;
uint currentLiquidationReward;
int128 newPositionSize;
uint newNotionalValue;
int currentAvailableMargin;
Expand Down Expand Up @@ -530,6 +537,8 @@ library GlobalPerpsMarket {
library GlobalPerpsMarketConfiguration {
bytes32 private constant _SLOT_GLOBAL_PERPS_MARKET_CONFIGURATION = keccak256(abi.encode("io.synthetix.perps-market.GlobalPerpsMarketConfiguration"));
struct Data {
address feeCollector;
mapping(address => uint256) referrerShare;
mapping(uint128 => uint) maxCollateralAmounts;
uint128[] synthDeductionPriority;
uint minLiquidationRewardUsd;
Expand Down Expand Up @@ -608,12 +617,13 @@ library PerpsMarketConfiguration {
uint256 maxFundingVelocity;
uint256 skewScale;
uint256 initialMarginRatioD18;
uint256 maintenanceMarginRatioD18;
uint256 maintenanceMarginScalarD18;
uint256 lockedOiRatioD18;
uint256 maxLiquidationLimitAccumulationMultiplier;
uint256 maxSecondsInLiquidationWindow;
uint256 liquidationRewardRatioD18;
uint256 minimumPositionMargin;
uint256 minimumInitialMarginRatioD18;
}
function load(uint128 marketId) internal pure returns (Data storage store) {
bytes32 s = keccak256(abi.encode("io.synthetix.perps-market.PerpsMarketConfiguration", marketId));
Expand Down

0 comments on commit 5e6e736

Please sign in to comment.