Skip to content

Commit

Permalink
use synthetixio-auxilary/op-gas-price-oracle
Browse files Browse the repository at this point in the history
  • Loading branch information
leomassazza committed Nov 14, 2023
1 parent bea716c commit 100d10c
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 31 deletions.
2 changes: 1 addition & 1 deletion tomls/markets/perps/btc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func = "updatePriceData"
args = [
"<%= settings.btcPerpsMarketId %>",
"<%= extras.btc_oracle_id %>",
"<%= settings.perpsStrictStalenessTolerance %>"
"<%= settings.perps_StrictStalenessTolerance %>"
]
depends = ["invoke.createBtcPerpsMarket", "invoke.registerBtcOracleNode"]

Expand Down
2 changes: 1 addition & 1 deletion tomls/markets/perps/eth.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func = "updatePriceData"
args = [
"<%= settings.ethPerpsMarketId %>",
"<%= extras.eth_oracle_id %>",
"<%= settings.perpsStrictStalenessTolerance %>"
"<%= settings.perps_StrictStalenessTolerance %>"
]
depends = ["invoke.createEthPerpsMarket", "invoke.registerEthOracleNode"]

Expand Down
2 changes: 1 addition & 1 deletion tomls/markets/perps/link.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func = "updatePriceData"
args = [
"<%= settings.linkPerpsMarketId %>",
"<%= extras.link_oracle_id %>",
"<%= settings.perpsStrictStalenessTolerance %>"
"<%= settings.perps_StrictStalenessTolerance %>"
]
depends = ["invoke.createLinkPerpsMarket", "invoke.registerLinkOracleNode"]

Expand Down
2 changes: 1 addition & 1 deletion tomls/markets/perps/ltc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func = "updatePriceData"
args = [
"<%= settings.ltcPerpsMarketId %>",
"<%= extras.ltc_oracle_id %>",
"<%= settings.perpsStrictStalenessTolerance %>"
"<%= settings.perps_StrictStalenessTolerance %>"
]
depends = ["invoke.createLtcPerpsMarket", "invoke.registerLtcOracleNode"]

Expand Down
2 changes: 1 addition & 1 deletion tomls/markets/perps/op.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func = "updatePriceData"
args = [
"<%= settings.opPerpsMarketId %>",
"<%= extras.op_oracle_id %>",
"<%= settings.perpsStrictStalenessTolerance %>"
"<%= settings.perps_StrictStalenessTolerance %>"
]
depends = ["invoke.createOpPerpsMarket", "invoke.registerOpOracleNode"]

Expand Down
2 changes: 1 addition & 1 deletion tomls/markets/perps/snx.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func = "updatePriceData"
args = [
"<%= settings.snxPerpsMarketId %>",
"<%= extras.snx_oracle_id %>",
"<%= settings.perpsStrictStalenessTolerance %>"
"<%= settings.perps_StrictStalenessTolerance %>"
]
depends = ["invoke.createSnxPerpsMarket", "invoke.registerSnxOracleNode"]

Expand Down
2 changes: 1 addition & 1 deletion tomls/markets/perps/xrp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func = "updatePriceData"
args = [
"<%= settings.xrpPerpsMarketId %>",
"<%= extras.xrp_oracle_id %>",
"<%= settings.perpsStrictStalenessTolerance %>"
"<%= settings.perps_StrictStalenessTolerance %>"
]
depends = ["invoke.createXrpPerpsMarket", "invoke.registerXrpOracleNode"]

Expand Down
39 changes: 24 additions & 15 deletions tomls/omnibus-base-goerli-andromeda/perps/global.toml
Original file line number Diff line number Diff line change
@@ -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"

# ------------------------------
Expand All @@ -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"]

Expand Down
4 changes: 2 additions & 2 deletions tomls/omnibus-base-goerli-competition/perps/global.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# GLOBAL PERPS SETTINGS
[setting.perpsMinLiquidationReward]
[setting.perps_MinLiquidationReward]
defaultValue = "1"

[setting.perpsMaxLiquidationReward]
[setting.perps_MaxLiquidationReward]
defaultValue = "500"

# ------------------------------
Expand Down
4 changes: 2 additions & 2 deletions tomls/omnibus-optimism-goerli-dev/perps/global.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# GLOBAL PERPS SETTINGS
[setting.perpsMinLiquidationReward]
[setting.perps_MinLiquidationReward]
defaultValue = "1"

[setting.perpsMaxLiquidationReward]
[setting.perps_MaxLiquidationReward]
defaultValue = "500"

# ------------------------------
Expand Down
12 changes: 7 additions & 5 deletions tomls/oracles/perps-keeper-cost.toml
Original file line number Diff line number Diff line change
@@ -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 = [
Expand All @@ -32,5 +34,5 @@ extra.perps_keeper_cost_usd_oracle_id.arg = 0
depends = [
"provision.system",
"invoke.registerEthOracleNode",
"invoke.registerPerpsKeeperCostEthOracleNode"
"invoke.registerPerps_KeeperCostEthOracleNode"
]

0 comments on commit 100d10c

Please sign in to comment.