From 100d10c9c5803833ca0845bd64706da5c3322bd1 Mon Sep 17 00:00:00 2001 From: Leonardo Massazza Date: Tue, 14 Nov 2023 16:15:04 -0300 Subject: [PATCH] use synthetixio-auxilary/op-gas-price-oracle --- tomls/markets/perps/btc.toml | 2 +- tomls/markets/perps/eth.toml | 2 +- tomls/markets/perps/link.toml | 2 +- tomls/markets/perps/ltc.toml | 2 +- tomls/markets/perps/op.toml | 2 +- tomls/markets/perps/snx.toml | 2 +- tomls/markets/perps/xrp.toml | 2 +- .../perps/global.toml | 39 ++++++++++++------- .../perps/global.toml | 4 +- .../perps/global.toml | 4 +- tomls/oracles/perps-keeper-cost.toml | 12 +++--- 11 files changed, 42 insertions(+), 31 deletions(-) diff --git a/tomls/markets/perps/btc.toml b/tomls/markets/perps/btc.toml index c3b5eeb16..57eff0b08 100644 --- a/tomls/markets/perps/btc.toml +++ b/tomls/markets/perps/btc.toml @@ -42,7 +42,7 @@ func = "updatePriceData" args = [ "<%= settings.btcPerpsMarketId %>", "<%= extras.btc_oracle_id %>", - "<%= settings.perpsStrictStalenessTolerance %>" + "<%= settings.perps_StrictStalenessTolerance %>" ] depends = ["invoke.createBtcPerpsMarket", "invoke.registerBtcOracleNode"] diff --git a/tomls/markets/perps/eth.toml b/tomls/markets/perps/eth.toml index 31d79b635..9e6950e4d 100644 --- a/tomls/markets/perps/eth.toml +++ b/tomls/markets/perps/eth.toml @@ -50,7 +50,7 @@ func = "updatePriceData" args = [ "<%= settings.ethPerpsMarketId %>", "<%= extras.eth_oracle_id %>", - "<%= settings.perpsStrictStalenessTolerance %>" + "<%= settings.perps_StrictStalenessTolerance %>" ] depends = ["invoke.createEthPerpsMarket", "invoke.registerEthOracleNode"] diff --git a/tomls/markets/perps/link.toml b/tomls/markets/perps/link.toml index 98af616e2..d3391d329 100644 --- a/tomls/markets/perps/link.toml +++ b/tomls/markets/perps/link.toml @@ -46,7 +46,7 @@ func = "updatePriceData" args = [ "<%= settings.linkPerpsMarketId %>", "<%= extras.link_oracle_id %>", - "<%= settings.perpsStrictStalenessTolerance %>" + "<%= settings.perps_StrictStalenessTolerance %>" ] depends = ["invoke.createLinkPerpsMarket", "invoke.registerLinkOracleNode"] diff --git a/tomls/markets/perps/ltc.toml b/tomls/markets/perps/ltc.toml index 1b76d52b6..44de07f45 100644 --- a/tomls/markets/perps/ltc.toml +++ b/tomls/markets/perps/ltc.toml @@ -52,7 +52,7 @@ func = "updatePriceData" args = [ "<%= settings.ltcPerpsMarketId %>", "<%= extras.ltc_oracle_id %>", - "<%= settings.perpsStrictStalenessTolerance %>" + "<%= settings.perps_StrictStalenessTolerance %>" ] depends = ["invoke.createLtcPerpsMarket", "invoke.registerLtcOracleNode"] diff --git a/tomls/markets/perps/op.toml b/tomls/markets/perps/op.toml index eda28f41b..9df84636a 100644 --- a/tomls/markets/perps/op.toml +++ b/tomls/markets/perps/op.toml @@ -52,7 +52,7 @@ func = "updatePriceData" args = [ "<%= settings.opPerpsMarketId %>", "<%= extras.op_oracle_id %>", - "<%= settings.perpsStrictStalenessTolerance %>" + "<%= settings.perps_StrictStalenessTolerance %>" ] depends = ["invoke.createOpPerpsMarket", "invoke.registerOpOracleNode"] diff --git a/tomls/markets/perps/snx.toml b/tomls/markets/perps/snx.toml index cd79344f1..d662a46b2 100644 --- a/tomls/markets/perps/snx.toml +++ b/tomls/markets/perps/snx.toml @@ -52,7 +52,7 @@ func = "updatePriceData" args = [ "<%= settings.snxPerpsMarketId %>", "<%= extras.snx_oracle_id %>", - "<%= settings.perpsStrictStalenessTolerance %>" + "<%= settings.perps_StrictStalenessTolerance %>" ] depends = ["invoke.createSnxPerpsMarket", "invoke.registerSnxOracleNode"] diff --git a/tomls/markets/perps/xrp.toml b/tomls/markets/perps/xrp.toml index 3b93ed8c3..5446da024 100644 --- a/tomls/markets/perps/xrp.toml +++ b/tomls/markets/perps/xrp.toml @@ -52,7 +52,7 @@ func = "updatePriceData" args = [ "<%= settings.xrpPerpsMarketId %>", "<%= extras.xrp_oracle_id %>", - "<%= settings.perpsStrictStalenessTolerance %>" + "<%= settings.perps_StrictStalenessTolerance %>" ] depends = ["invoke.createXrpPerpsMarket", "invoke.registerXrpOracleNode"] diff --git a/tomls/omnibus-base-goerli-andromeda/perps/global.toml b/tomls/omnibus-base-goerli-andromeda/perps/global.toml index a95571185..07b2da186 100644 --- a/tomls/omnibus-base-goerli-andromeda/perps/global.toml +++ b/tomls/omnibus-base-goerli-andromeda/perps/global.toml @@ -1,32 +1,41 @@ # GLOBAL PERPS SETTINGS -[setting.perpsMinLiquidationReward] +[setting.perps_MinLiquidationReward] defaultValue = "1" -[setting.perpsMaxLiquidationReward] +[setting.perps_MaxLiquidationReward] defaultValue = "500" -[setting.perpsStrictStalenessTolerance] +[setting.perps_StrictStalenessTolerance] defaultValue = "60" -[setting.perpsKeeperCostOracleNodeAddress] -defaultValue = "0x9E3AD6FD3069A04DE804445DA24D0fF75Ba65EbF" +[setting.perps_KeeperL1CostSettleGasUnits] +defaultValue = "0" -[setting.perpsKeeperL1CostSettleGasUnits] +[setting.perps_KeeperL2CostSettleGasUnits] defaultValue = "0" -[setting.perpsKeeperL2CostSettleGasUnits] +[setting.perps_KeeperL1CostFlagGasUnits] defaultValue = "0" -[setting.perpsKeeperL1CostFlagGasUnits] +[setting.perps_KeeperL2CostFlagGasUnits] defaultValue = "0" -[setting.perpsKeeperL2CostFlagGasUnits] +[setting.perps_KeeperL1CostLiquidateGasUnits] defaultValue = "0" -[setting.perpsKeeperL1CostLiquidateGasUnits] +[setting.perps_KeeperL2CostLiquidateGasUnits] defaultValue = "0" -[setting.perpsKeeperL2CostLiquidateGasUnits] +[setting.perps_liquidation_minKeeperRewardUsd] +defaultValue = "1" + +[setting.perps_liquidation_minKeeperProfitRatioD18] +defaultValue = "0" + +[setting.perps_liquidation_maxKeeperRewardUsd] +defaultValue = "500" + +[setting.perps_liquidation_maxKeeperScalingRatioD18] defaultValue = "0" # ------------------------------ @@ -35,10 +44,10 @@ target = ["perpsFactory.PerpsMarketProxy"] fromCall.func = "owner" func = "setKeeperRewardGuards" args = [ - "<%= parseEther('1') %>", - "<%= parseEther('0') %>", - "<%= parseEther('500') %>", - "<%= parseEther('0') %>" + "<%= parseEther(settings.perps_liquidation_minKeeperRewardUsd) %>", + "<%= parseEther(settings.perps_liquidation_minKeeperProfitRatioD18) %>", + "<%= parseEther(settings.perps_liquidation_maxKeeperRewardUsd) %>", + "<%= parseEther(settings.perps_liquidation_maxKeeperScalingRatioD18) %>" ] depends = ["provision.perpsFactory"] diff --git a/tomls/omnibus-base-goerli-competition/perps/global.toml b/tomls/omnibus-base-goerli-competition/perps/global.toml index 50ab934e2..ec1280337 100644 --- a/tomls/omnibus-base-goerli-competition/perps/global.toml +++ b/tomls/omnibus-base-goerli-competition/perps/global.toml @@ -1,8 +1,8 @@ # GLOBAL PERPS SETTINGS -[setting.perpsMinLiquidationReward] +[setting.perps_MinLiquidationReward] defaultValue = "1" -[setting.perpsMaxLiquidationReward] +[setting.perps_MaxLiquidationReward] defaultValue = "500" # ------------------------------ diff --git a/tomls/omnibus-optimism-goerli-dev/perps/global.toml b/tomls/omnibus-optimism-goerli-dev/perps/global.toml index 4fa226b4d..9aef98f9a 100644 --- a/tomls/omnibus-optimism-goerli-dev/perps/global.toml +++ b/tomls/omnibus-optimism-goerli-dev/perps/global.toml @@ -1,8 +1,8 @@ # GLOBAL PERPS SETTINGS -[setting.perpsMinLiquidationReward] +[setting.perps_MinLiquidationReward] defaultValue = "1" -[setting.perpsMaxLiquidationReward] +[setting.perps_MaxLiquidationReward] defaultValue = "500" # ------------------------------ diff --git a/tomls/oracles/perps-keeper-cost.toml b/tomls/oracles/perps-keeper-cost.toml index 0ef5f1b15..e5a01091c 100644 --- a/tomls/oracles/perps-keeper-cost.toml +++ b/tomls/oracles/perps-keeper-cost.toml @@ -1,22 +1,24 @@ include = ["../core.toml"] -[setting.perpsKeeperCostOracleNodeAddress] +[provision.perps_gas_oracle_node] +source = "op-gas-price-oracle" -[invoke.registerPerpsKeeperCostEthOracleNode] +# sourcePreset = "andromeda" +[invoke.registerPerps_KeeperCostEthOracleNode] target = ["system.oracle_manager.Proxy"] func = "registerNode" args = [ # 2 = external node 2, # 7 parameters: 1 is the external node contract address, 2 to 7 gas units - "<%= defaultAbiCoder.encode(['address', 'uint256', 'uint256', 'uint256', 'uint256', 'uint256', 'uint256'], [settings.perpsKeeperCostOracleNodeAddress, settings.perpsKeeperL1CostSettleGasUnits, settings.perpsKeeperL2CostSettleGasUnits, settings.perpsKeeperL1CostFlagGasUnits, settings.perpsKeeperL2CostFlagGasUnits, settings.perpsKeeperL1CostLiquidateGasUnits, settings.perpsKeeperL2CostLiquidateGasUnits]) %>", + "<%= defaultAbiCoder.encode(['address', 'uint256', 'uint256', 'uint256', 'uint256', 'uint256', 'uint256'], [imports.perps_gas_oracle_node.contracts.OpGasPriceOracle.address, settings.perps_KeeperL1CostSettleGasUnits, settings.perps_KeeperL2CostSettleGasUnits, settings.perps_KeeperL1CostFlagGasUnits, settings.perps_KeeperL2CostFlagGasUnits, settings.perps_KeeperL1CostLiquidateGasUnits, settings.perps_KeeperL2CostLiquidateGasUnits]) %>", [] ] extra.perps_keeper_cost_eth_oracle_id.event = "NodeRegistered" extra.perps_keeper_cost_eth_oracle_id.arg = 0 depends = ["provision.system"] -[invoke.registerPerpsKeeperCostUsdOracleNode] +[invoke.registerPerps_KeeperCostUsdOracleNode] target = ["system.oracle_manager.Proxy"] func = "registerNode" args = [ @@ -32,5 +34,5 @@ extra.perps_keeper_cost_usd_oracle_id.arg = 0 depends = [ "provision.system", "invoke.registerEthOracleNode", - "invoke.registerPerpsKeeperCostEthOracleNode" + "invoke.registerPerps_KeeperCostEthOracleNode" ]