As the current markets can't be made upgradable (to prevent committing to storage layout), future feature updates (e.g. synth margin) will require user initiated migrations,
The current contract system should support a minimal migration flow:
Market manager should be able to support two markets (old and new) for each asset, E.g. in a separate mapping (deprecatedMarketForAsset).
Market settings should be possible to set for both new and old market for an asset.
A minimal migration settings for the old market could be:
maxMarketSize to 0 to allow closing position only.
maxFundingRate to 100% to increase the rate at which abandoned positions are being liquidated.
skewScaleUSD to some low value (e.g. 1) to increase the skews for which max funding rate is applied.
After winding down an old market, when its debt reaches a negligible number - it can be paused and disconnected from market manager.
Of course separate tests for migration flow should be added to ensure that everything works as expected when migration will be needed.
As the current markets can't be made upgradable (to prevent committing to storage layout), future feature updates (e.g. synth margin) will require user initiated migrations,
The current contract system should support a minimal migration flow:
deprecatedMarketForAsset
).A minimal migration settings for the old market could be:
maxMarketSize
to 0 to allow closing position only.maxFundingRate
to 100% to increase the rate at which abandoned positions are being liquidated.skewScaleUSD
to some low value (e.g. 1) to increase the skews for which max funding rate is applied.After winding down an old market, when its debt reaches a negligible number - it can be paused and disconnected from market manager.
Of course separate tests for migration flow should be added to ensure that everything works as expected when migration will be needed.