Skip to content

Commit

Permalink
Merge branch 'main' into xchainxfers
Browse files Browse the repository at this point in the history
  • Loading branch information
barrasso authored Jul 11, 2023
2 parents 1822d78 + 773a2c8 commit 25d6a8d
Show file tree
Hide file tree
Showing 6 changed files with 161 additions and 15 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ _The --provider-url and --private-key parameters are unnecessary if using [Frame
- If you've updated the provisioned packages, verify your new contracts on Etherscan: `cannon verify synthetix-omnibus:<VERSION_NUMBER> --api-key <ETHERSCAN_API_KEY> --chain-id <CHAIN_ID>`
- Publish your new packages on the Cannon registry: `cannon publish synthetix-omnibus:<VERSION_NUMBER> --private-key <KEY_THAT_HAS_ETH_ON_MAINNET> --tags latest,3` (_The --private-key parameter is unnecessary if using [Frame](https://frame.sh/)_)
- Commit and merge the change to this repository.
- Run the [**Export ABIs** action](https://github.com/Synthetixio/v3-abi-exporter/actions/workflows/main.yml) in the `v3-abi-exporter` repository.
65 changes: 65 additions & 0 deletions omnibus-optimism-goerli.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,76 @@ defaultValue = "0xC16679B963CeB52089aD2d95312A5b85E318e9d2"
[setting.eth_aggregator_address]
defaultValue = "0x57241A37733983F97C4Ab06448F244A1E0Ca0ba8"

# Perps Global Configuration
# TODO: move these into perps-factory once settings support max uint
[invoke.setPerpsMaxCollateralForSnxUsd]
target = ["perpsFactory.PerpsMarketProxy"]
fromCall.func = "owner"
func = "setMaxCollateralAmount"
args = [
"0",
"<%= MaxUint256 %>"
]
depends = ["provision.perpsFactory"]

[invoke.setPerpsMaxCollateralForSynthMarketId]
target = ["perpsFactory.PerpsMarketProxy"]
fromCall.func = "owner"
func = "setMaxCollateralAmount"
args = [
"<%= extras.synth_eth_market_id %>",
"<%= MaxUint256 %>"
]
depends = ["invoke.createEthSynth", "provision.perpsFactory"]

[invoke.setPerpsSynthDeductionPriorityPerps]
target = ["perpsFactory.PerpsMarketProxy"]
fromCall.func = "owner"
func = "setSynthDeductionPriority"
args = [["0", "<%= extras.synth_eth_market_id %>"]]
depends = ["invoke.createEthSynth", "provision.perpsFactory"]

[setting.perpsMinLiquidationReward]
defaultValue = "100"

[setting.perpsMaxLiquidationReward]
defaultValue = "500"

# ETH Perps Configuration

[setting.perpsEthSkewScale]
defaultValue = "100000"

[setting.perpsEthMaxFundingVelocity]
defaultValue = "9"

[setting.perpsEthMakerFeeRatio]
defaultValue = "0.0007"

[setting.perpsEthTakerFeeRatio]
defaultValue = "0.0003"

[setting.perpsEthMaxMarketValue]
defaultValue = "10000"

[setting.perpsEthInitialMarginRatio]
defaultValue = "2"

[setting.perpsEthMaintenanceMarginFraction]
defaultValue = "1"

[setting.perpsEthLiquidationRewardRatioD18]
defaultValue = "0.01"

[setting.perpsEthMaxLiquidationLimitAccumulationMultiplier]
defaultValue = "1"

[setting.perpsEthMaxSecondsInLiquidationWindow]
defaultValue = "30"

[setting.perpsEthLockedOiPercent]
defaultValue = "0.1"

# ETH Synth Configuration

[setting.synthEthAsyncFixedFee]
Expand Down Expand Up @@ -99,6 +161,9 @@ defaultValue = "https://api.synthetix.io/pyth-testnet/api/get_vaa_ccip?data={dat
[setting.pythEthFeedId]
defaultValue = "0xca80ba6dc32e08d06f1aa886011eed1d77c77be9eb761cc10d72b7d0a2fd57a6"

[setting.priceWindowDuration]
defaultValue = "180"

[invoke.setScPoolConfig]
target = ["system.CoreProxy"]
fromCall.func = "getPoolOwner"
Expand Down
3 changes: 0 additions & 3 deletions tomls/markets/common/settlement-strategies/eth/pyth.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[setting.strategyType]
defaultValue = "1"

[setting.ethSettlementDelay]
defaultValue = "15"

Expand Down
10 changes: 10 additions & 0 deletions tomls/markets/perps-factory.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,13 @@ options.synthetixPackage = "<%= settings.snx_package %>"
options.spotMarketPackage = "<%= settings.spot_market_package %>"

depends = ["provision.spotFactory"]

[invoke.setPerpsLiquidationRewardLimits]
target = ["perpsFactory.PerpsMarketProxy"]
fromCall.func = "owner"
func = "setLiquidationRewardGuards"
args = [
"<%= parseEther(settings.perpsMinLiquidationReward) %>",
"<%= parseEther(settings.perpsMaxLiquidationReward) %>"
]
depends = ["provision.perpsFactory"]
93 changes: 81 additions & 12 deletions tomls/markets/perps/eth.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,28 @@ include = [

[setting.perpsEthMaxFundingVelocity]

[setting.perpsEthMakerFeeRatio]

[setting.perpsEthTakerFeeRatio]

[setting.perpsEthMaxMarketValue]

[setting.perpsEthInitialMarginRatio]

[setting.perpsEthMaintenanceMarginFraction]

[setting.perpsEthLiquidationRewardRatioD18]

[setting.perpsEthMaxLiquidationLimitAccumulationMultiplier]

[setting.perpsEthMaxSecondsInLiquidationWindow]

[setting.perpsEthLockedOiPercent]

# strategy type for Perps markets is 0, for spot markets is 1
[setting.strategyType]
defaultValue = "0"

[invoke.createEthPerpsMarket]
target = ["perpsFactory.PerpsMarketProxy"]
fromCall.func = "owner"
Expand All @@ -31,27 +53,74 @@ args = [
]
depends = ["invoke.createEthPerpsMarket", "invoke.registerEthOracleNode"]

#[invoke.setPerpsEthSettlementStrategy]
#target = ["perpsFactory.PerpsMarketProxy"]
#fromCall.func = "getMarketOwner"
#fromCall.args = ["<%= extras.perps_eth_market_id %>"]
#func = "addSettlementStrategy"
#args = [
# "<%= extras.perps_eth_market_id %>",
# { strategyType = "<%= settings.strategyType %>", settlementDelay = "<%= settings.ethSettlementDelay %>", settlementWindowDuration = "<%= settings.ethSettlementWindowDuration %>", priceWindowDuration = "<%= settings.ethPriceWindowDuration %>", priceVerificationContract = "<%= settings.pythPriceVerificationAddress %>", feedId = "<%= settings.pythEthFeedId %>", url = "<%= settings.pythFeedUrl %>", settlementReward = "<%= settings.settlementReward %>", priceDeviationTolerance = "<%= parseEther(settings.ethSettlementDeviationTolerance) %>", disabled = false }
#]
#depends = ["invoke.createEthPerpsMarket"]
[invoke.setPerpsEthSettlementStrategy]
target = ["perpsFactory.PerpsMarketProxy"]
fromCall.func = "getMarketOwner"
fromCall.args = ["<%= extras.perps_eth_market_id %>"]
func = "addSettlementStrategy"
args = [
"<%= extras.perps_eth_market_id %>",
{ strategyType = "<%= settings.strategyType %>", settlementDelay = "<%= settings.ethSettlementDelay %>", settlementWindowDuration = "<%= settings.ethSettlementWindowDuration %>", priceWindowDuration = "<%= settings.priceWindowDuration %>", priceVerificationContract = "<%= settings.pythPriceVerificationAddress %>", feedId = "<%= settings.pythEthFeedId %>", url = "<%= settings.pythFeedUrl %>", settlementReward = "<%= settings.settlementReward %>", priceDeviationTolerance = "<%= parseEther(settings.ethSettlementDeviationTolerance) %>", disabled = false }
]
depends = ["invoke.createEthPerpsMarket"]

[invoke.setPerpsEthFundingParameters]
target = ["perpsFactory.PerpsMarketProxy"]
fromCall.func = "getMarketOwner"
fromCall.args = ["<%= extras.perps_eth_market_id %>"]

func = "setFundingParameters"
args = [
"<%= extras.perps_eth_market_id %>",
"<%= parseEther(settings.perpsEthSkewScale) %>",
"<%= settings.perpsEthSkewScale %>"
"<%= parseEther(settings.perpsEthMaxFundingVelocity) %>"
]
depends = ["invoke.createEthPerpsMarket"]

[invoke.setPerpsEthOrderFees]
target = ["perpsFactory.PerpsMarketProxy"]
fromCall.func = "getMarketOwner"
fromCall.args = ["<%= extras.perps_eth_market_id %>"]
func = "setOrderFees"
args = [
"<%= extras.perps_eth_market_id %>",
"<%= parseEther(settings.perpsEthMakerFeeRatio) %>",
"<%= parseEther(settings.perpsEthTakerFeeRatio) %>"
]
depends = ["invoke.createEthPerpsMarket"]

[invoke.setPerpsEthMaxMarketValue]
target = ["perpsFactory.PerpsMarketProxy"]
fromCall.func = "getMarketOwner"
fromCall.args = ["<%= extras.perps_eth_market_id %>"]
func = "setMaxMarketValue"
args = [
"<%= extras.perps_eth_market_id %>",
"<%= parseEther(settings.perpsEthMaxMarketValue) %>"
]
depends = ["invoke.createEthPerpsMarket"]

[invoke.setPerpsEthLiquidationParameters]
target = ["perpsFactory.PerpsMarketProxy"]
fromCall.func = "getMarketOwner"
fromCall.args = ["<%= extras.perps_eth_market_id %>"]
func = "setLiquidationParameters"
args = [
"<%= extras.perps_eth_market_id %>",
"<%= parseEther(settings.perpsEthInitialMarginRatio) %>",
"<%= parseEther(settings.perpsEthMaintenanceMarginFraction) %>",
"<%= parseEther(settings.perpsEthLiquidationRewardRatioD18) %>",
"<%= parseEther(settings.perpsEthMaxLiquidationLimitAccumulationMultiplier) %>",
"<%= parseEther(settings.perpsEthMaxSecondsInLiquidationWindow) %>"
]
depends = ["invoke.createEthPerpsMarket"]

[invoke.setPerpsEthLockedOiPercent]
target = ["perpsFactory.PerpsMarketProxy"]
fromCall.func = "getMarketOwner"
fromCall.args = ["<%= extras.perps_eth_market_id %>"]
func = "setLockedOiPercent"
args = [
"<%= extras.perps_eth_market_id %>",
"<%= parseEther(settings.perpsEthLockedOiPercent) %>"
]
depends = ["invoke.createEthPerpsMarket"]
4 changes: 4 additions & 0 deletions tomls/markets/spot/eth.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ include = [

[setting.synthEthUnwrapFee]

# strategy type for Perps markets is 0, for spot markets is 1
[setting.strategyType]
defaultValue = "1"

[invoke.createEthSynth]
target = ["spotFactory.SpotMarketProxy"]
fromCall.func = "owner"
Expand Down

0 comments on commit 25d6a8d

Please sign in to comment.