From 0d2f4a2e83e88f464d265ece412777f356209d7a Mon Sep 17 00:00:00 2001 From: Noah Litvin <335975+noahlitvin@users.noreply.github.com> Date: Fri, 3 Nov 2023 13:00:08 -0400 Subject: [PATCH] progress --- omnibus-base-goerli-andromeda.toml | 598 ++---------------- package.json | 4 +- tomls/collaterals/usdc.toml | 12 - tomls/markets/perps/ltc.toml | 133 ++++ tomls/markets/perps/xrp.toml | 133 ++++ .../perps/btc.toml | 54 ++ .../perps/eth.toml | 55 ++ .../perps/global.toml | 39 ++ .../perps/ltc.toml | 54 ++ .../perps/xrp.toml | 54 ++ .../spot/usdc.toml | 62 ++ tomls/oracles/pyth-ltc.toml | 16 + tomls/oracles/pyth-xrp.toml | 16 + yarn.lock | 22 +- 14 files changed, 684 insertions(+), 568 deletions(-) delete mode 100644 tomls/collaterals/usdc.toml create mode 100644 tomls/markets/perps/ltc.toml create mode 100644 tomls/markets/perps/xrp.toml create mode 100644 tomls/omnibus-base-goerli-andromeda/perps/btc.toml create mode 100644 tomls/omnibus-base-goerli-andromeda/perps/eth.toml create mode 100644 tomls/omnibus-base-goerli-andromeda/perps/global.toml create mode 100644 tomls/omnibus-base-goerli-andromeda/perps/ltc.toml create mode 100644 tomls/omnibus-base-goerli-andromeda/perps/xrp.toml create mode 100644 tomls/omnibus-base-goerli-andromeda/spot/usdc.toml create mode 100644 tomls/oracles/pyth-ltc.toml create mode 100644 tomls/oracles/pyth-xrp.toml diff --git a/omnibus-base-goerli-andromeda.toml b/omnibus-base-goerli-andromeda.toml index 60a975c3d..7b8b96233 100644 --- a/omnibus-base-goerli-andromeda.toml +++ b/omnibus-base-goerli-andromeda.toml @@ -1,585 +1,97 @@ name = "synthetix-omnibus" version = "3.3.3-dev.e141cd8c" description = "Andromeda" +include = [ + "tomls/settings-testnet.toml", + "tomls/core.toml", + "tomls/permissions.toml", # Allow deployer to create pools + "tomls/pools/spartan-council.toml", # Create Spartan Council Pool + + # Mock USDC and sUSDC spot market/wrapper + "tomls/omnibus-base-goerli-andromeda/spot/usdc.toml", + + # the perps + "tomls/markets/perps/eth.toml", + "tomls/markets/perps/btc.toml", + "tomls/markets/perps/ltc.toml", + "tomls/markets/perps/xrp.toml", + + # overrides for the oracles + "tomls/oracles/pyth-eth.toml", + "tomls/oracles/pyth-btc.toml", + "tomls/oracles/pyth-ltc.toml", + "tomls/oracles/pyth-xrp.toml", + # overrides for perp markets + "tomls/omnibus-base-goerli-andromeda/perps/global.toml", + "tomls/omnibus-base-goerli-andromeda/perps/btc.toml", + "tomls/omnibus-base-goerli-andromeda/perps/eth.toml", + "tomls/omnibus-base-goerli-andromeda/perps/xrp.toml", + "tomls/omnibus-base-goerli-andromeda/perps/ltc.toml", +] -# TODO: Remove unneccesary "depends" -[setting.owner] -defaultValue = "0x48914229deDd5A9922f44441ffCCfC2Cb7856Ee9" ## TBD - -## PROVISION CORE SYSTEM [setting.snx_package] defaultValue = "synthetix:3.3.3-dev.e141cd8c" [setting.target_preset] defaultValue = "andromeda" -[provision.system] -source = "<%= settings.snx_package %>" -targetPreset = "<%= settings.target_preset %>" -options.owner = "<%= settings.owner %>" -options.salt = "<%= settings.salt %>" -options.bundleSalt = "<%= settings.bundleSalt %>" - -## MAKE TOKEN NAME AND SYMBOL CONFIGURATION IN SYNTHETIX PACKAGE -## options.stablecoinName = "KAINSUSD" -## options.stablecoinSymbol = "USDK" -## SKIPPING CCIP CONFIG -[setting.minimum_liquidity_ratio] -defaultValue = "1250000000000000000" # 125% min market collateralization - -[setting.account_timeout_withdraw] -defaultValue = "86400" # 1 day withdrawal lock - -[invoke.setMinimumLiquidityRatio] -target = ["system.CoreProxy"] -fromCall.func = "owner" -func = "setMinLiquidityRatio(uint256)" -args = ["<%= settings.minimum_liquidity_ratio %>"] -depends = ["provision.system"] - -[invoke.setAccountTimeoutWithdraw] -target = ["system.CoreProxy"] -fromCall.func = "owner" -func = "setConfig" -args = [ - "<%= formatBytes32String('accountTimeoutWithdraw') %>", - "<%= hexZeroPad(hexlify(parseInt(settings.account_timeout_withdraw)), 32) %>" -] -depends = ["provision.system"] - -# ADD USDC AS COLLATERAL WITH CONSTANT PRICE OF 1 -[setting.usdc_address] -defaultValue = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" - -[invoke.registerUsdcOracleNode] -target = ["system.oracle_manager.Proxy"] -func = "registerNode" -args = [ - # 8 = CONSTANT NODE - 8, - "<%= defaultAbiCoder.encode(['int256'], [One]) %>", - [] -] -extra.usdc_oracle_id.event = "NodeRegistered" -extra.usdc_oracle_id.arg = 0 -depends = ["provision.system"] - -# VERIFY THIS IS ALL CONFIGURED CORRECTLY -# SHOULD BE: ISSUANCE: INFINITE, LIQUIDATION AT 100%, LIQUIDATION REWARD/MIN DELEGATION: $2 -[invoke.configureUsdcCollateral] -target = ["system.CoreProxy"] -fromCall.func = "owner" -func = "configureCollateral" -args = [ - { tokenAddress = "<%= settings.usdc_address %>", oracleNodeId = "<%= extras.usdc_oracle_id %>", issuanceRatioD18 = "<%= MaxUint256 %>", liquidationRatioD18 = "<%= parseEther('1.01') %>", liquidationRewardD18 = "<%= parseEther('2') %>", minDelegationD18 = "<%= parseEther('2') %>", depositingEnabled = true } - #TODO why is liquidationRatio 1.01 instead of 1.00 -] -depends = ["invoke.registerUsdcOracleNode"] - -# sUSDC WRAPPER SPOT MARKET -# No wrapper fee or skew scale, async settlement strategy, or atomic fee -# Just for USDC -> sUSDC -> kUSD and back, PnL is always 0 [setting.spot_market_package] defaultValue = "synthetix-spot-market:3.3.3-dev.e141cd8c" -[provision.spotFactory] -source = "<%= settings.spot_market_package %>" -targetPreset = "<%= settings.target_preset %>" -options.coreProxyOwner = "<%= settings.owner %>" -options.owner = "<%= settings.owner %>" -options.salt = "<%= settings.salt %>" -options.synthetixPackage = "<%= settings.snx_package %>" -options.synthetixPreset = "<%= settings.target_preset %>" -depends = ["provision.system"] - -[setting.synthUsdcMaxMarketCollateral] -defaultValue = "<%= parseEther('1000000') %>" # 1 million USDC max - -[invoke.createUsdcSynth] -target = ["spotFactory.SpotMarketProxy"] -fromCall.func = "owner" -func = "createSynth" -args = ["Synthetic USDC", "sUSDC", "<%= settings.owner %>"] -extra.synth_usdc_market_id.event = "SynthRegistered" -extra.synth_usdc_market_id.arg = 0 -extra.synth_usdc_token_address.event = "SynthRegistered" -extra.synth_usdc_token_address.arg = 1 -depends = ["provision.spotFactory"] - -[invoke.setSynthPriceUsdc] -target = ["spotFactory.SpotMarketProxy"] -fromCall.func = "getMarketOwner" -fromCall.args = ["<%= extras.synth_usdc_market_id %>"] -func = "updatePriceData" -args = [ - "<%= extras.synth_usdc_market_id %>", - "<%= extras.usdc_oracle_id %>", - "<%= extras.usdc_oracle_id %>" -] -depends = ["invoke.createUsdcSynth", "invoke.registerUsdcOracleNode"] - -[invoke.configureSynthWrapperUsdc] -target = ["spotFactory.SpotMarketProxy"] -fromCall.func = "getMarketOwner" -fromCall.args = ["<%= extras.synth_usdc_market_id %>"] -func = "setWrapper" -args = [ - "<%= extras.synth_usdc_market_id %>", - "<%= settings.usdc_address %>", - "<%= parseEther(settings.synthUsdcMaxMarketCollateral) %>" -] -depends = ["invoke.createUsdcSynth"] - -[invoke.setSynthMaxMarketCollateralUsdc] -target = ["system.CoreProxy"] -fromCall.func = "owner" -fromCall.args = [] -func = "configureMaximumMarketCollateral" -args = [ - "<%= extras.synth_usdc_market_id %>", - "<%= settings.usdc_address %>", - "<%= parseEther(settings.synthUsdcMaxMarketCollateral) %>" -] -depends = ["invoke.createUsdcSynth"] - -# SKIPPING ETH COLLATERAL IN FIRST RELEASE -# TODO add ETH in later releases as per governance -# PERPS [setting.perps_market_package] defaultValue = "synthetix-perps-market:3.3.3-dev.e141cd8c" -[provision.perpsFactory] -source = "<%= settings.perps_market_package %>" -targetPreset = "<%= settings.target_preset %>" -options.coreProxyOwner = "<%= settings.owner %>" -options.owner = "<%= settings.owner %>" -options.salt = "<%= settings.salt %>" -options.synthetixPackage = "<%= settings.snx_package %>" -options.spotMarketPackage = "<%= settings.spot_market_package %>" -options.synthetixPreset = "<%= settings.target_preset %>" -options.spotMarketPreset = "<%= settings.target_preset %>" -depends = ["provision.spotFactory"] - -[setting.perpsMinLiquidationReward] -defaultValue = "1" - -[setting.perpsMaxLiquidationReward] -defaultValue = "500" - -[invoke.setPerpsLiquidationRewardLimits] -target = ["perpsFactory.PerpsMarketProxy"] -fromCall.func = "owner" -func = "setLiquidationRewardGuards" -args = ["<%= parseEther('1') %>", "<%= parseEther('500') %>"] -depends = ["provision.perpsFactory"] - -[invoke.setPerpsMaxCollateralForSnxUsd] -target = ["perpsFactory.PerpsMarketProxy"] -fromCall.func = "owner" -func = "setMaxCollateralAmount" -args = ["0", "<%= MaxUint256 %>"] -depends = ["provision.perpsFactory"] - -[invoke.setPerAccountCapsPerps] -target = ["perpsFactory.PerpsMarketProxy"] -fromCall.func = "owner" -func = "setPerAccountCaps" -args = ["5", "3"] -depends = ["provision.perpsFactory"] +[setting.salt] +defaultValue = "andromeda" [setting.pythPriceVerificationAddress] -defaultValue = "0x8250f4aF4B972684F7b336503E2D6dFeDeB1487a" +defaultValue = "0x5955C1478F0dAD753C7E2B4dD1b4bC530C64749f" [setting.pythFeedUrl] -defaultValue = "https://api.synthetix.io/pyth-mainnet/api/get_vaa_ccip?data={data}" - -[setting.settlementReward] -defaultValue = "0" - -[setting.settlementMinimumUsdExchangeAmount] -defaultValue = "0.000001" - -[setting.settlementMaxRoundingLoss] -defaultValue = "0.000001" - -[setting.bigCapSettlementDelay] -defaultValue = "15" - -[setting.bigCapSettlementWindowDuration] -defaultValue = "60" - -[setting.bigCapPriceWindowDuration] -defaultValue = "600" - -# Bitcoin Perpetual Futures -[setting.btc_aggregator_address] -defaultValue = "0x71041dddad3595F9CEd3DcCFBe3D1F4b0a16Bb70" - -[invoke.registerBtcOracleNode] -target = ["system.oracle_manager.Proxy"] -func = "registerNode" -args = [ - # 3 = chainlink aggregator type - 3, - # 3 parameters are: address of the chainlink oracle - "<%= defaultAbiCoder.encode(['address', 'uint256', 'uint8'], [settings.btc_aggregator_address, 0, 8]) %>", - [] -] -extra.btc_oracle_id.event = "NodeRegistered" -extra.btc_oracle_id.arg = 0 -depends = ["provision.system"] - -# Perps Configuration -[setting.btcPerpsMarketId] -defaultValue = "200" - -[setting.perpsBtcSkewScale] -defaultValue = "1000000" - -[setting.perpsBtcMaxFundingVelocity] -defaultValue = "9" - -[setting.perpsBtcMakerFeeRatio] -defaultValue = "0.0007" - -[setting.perpsBtcTakerFeeRatio] -defaultValue = "0.0003" - -[setting.perpsBtcMaxMarketSize] -defaultValue = "100000" - -[setting.perpsBtcInitialMarginRatio] -defaultValue = "1" - -[setting.perpsBtcMaintenanceMarginScalar] -defaultValue = "0.5" - -[setting.perpsBtcMinimumInitialMarginRatio] -defaultValue = "0.02" - -[setting.perpsBtcLiquidationRewardRatioD18] -defaultValue = "0.01" - -[setting.perpsBtcMaxLiquidationLimitAccumulationMultiplier] -defaultValue = "0.5" - -[setting.perpsBtcMaxSecondsInLiquidationWindow] -defaultValue = "30" - -[setting.perpsBtcMinimumPositionMargin] -defaultValue = "0" - -[setting.perpsBtcLockedOiRatio] -defaultValue = "0.5" - -[setting.perpsBtcSynthMaxCollateralAmount] -defaultValue = "<%= MaxUint256 %>" - -[setting.perpsBtcMaxLiquidationPd] -defaultValue = "0.0016" +defaultValue = "https://api.synthetix.io/pyth-testnet/api/get_vaa_ccip?data={data}" -[setting.perpsBtcEndorsedLiquidator] -defaultValue = "0xae2Fc483527B8EF99EB5D9B44875F005ba1FaE13" # TODO - -[setting.pythBtcFeedId] -defaultValue = "0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43" - -[invoke.createBtcPerpsMarket] -target = ["perpsFactory.PerpsMarketProxy"] -fromCall.func = "owner" -func = "createMarket" -args = ["<%= settings.btcPerpsMarketId %>", "Bitcoin", "BTC"] -depends = ["provision.perpsFactory"] - -[invoke.setPerpsPriceBtc] -target = ["perpsFactory.PerpsMarketProxy"] -fromCall.func = "owner" -func = "updatePriceData" -args = ["<%= settings.btcPerpsMarketId %>", "<%= extras.btc_oracle_id %>"] -depends = ["invoke.createBtcPerpsMarket", "invoke.registerBtcOracleNode"] - -[invoke.setPerpsBtcSettlementStrategy] -target = ["perpsFactory.PerpsMarketProxy"] -fromCall.func = "owner" -func = "addSettlementStrategy" -args = [ - "<%= settings.btcPerpsMarketId %>", - # strategyType = 0 (pyth) - { strategyType = "0", settlementDelay = "<%= settings.bigCapSettlementDelay %>", settlementWindowDuration = "<%= settings.bigCapSettlementWindowDuration %>", priceWindowDuration = "<%= settings.bigCapPriceWindowDuration %>", priceVerificationContract = "<%= settings.pythPriceVerificationAddress %>", feedId = "<%= settings.pythBtcFeedId %>", url = "<%= settings.pythFeedUrl %>", settlementReward = "<%= settings.settlementReward %>", priceDeviationTolerance = "<%= parseEther('1') %>", disabled = false } -] -depends = ["invoke.createBtcPerpsMarket"] - -[invoke.setPerpsBtcFundingParameters] -target = ["perpsFactory.PerpsMarketProxy"] -fromCall.func = "owner" -func = "setFundingParameters" -args = [ - "<%= settings.btcPerpsMarketId %>", - "<%= parseEther(settings.perpsBtcSkewScale) %>", - "<%= parseEther(settings.perpsBtcMaxFundingVelocity) %>" -] -depends = ["invoke.createBtcPerpsMarket"] - -[invoke.setPerpsBtcOrderFees] -target = ["perpsFactory.PerpsMarketProxy"] -fromCall.func = "owner" -func = "setOrderFees" -args = [ - "<%= settings.btcPerpsMarketId %>", - "<%= parseEther(settings.perpsBtcMakerFeeRatio) %>", - "<%= parseEther(settings.perpsBtcTakerFeeRatio) %>" -] -depends = ["invoke.createBtcPerpsMarket"] - -[invoke.setPerpsBtcMaxMarketSize] -target = ["perpsFactory.PerpsMarketProxy"] -fromCall.func = "owner" -func = "setMaxMarketSize" -args = ["<%= settings.btcPerpsMarketId %>", "<%= parseEther(settings.perpsBtcMaxMarketSize) %>"] -depends = ["invoke.createBtcPerpsMarket"] - -[invoke.setPerpsBtcMaxLiquidationParameters] -target = ["perpsFactory.PerpsMarketProxy"] -fromCall.func = "owner" -func = "setMaxLiquidationParameters" -args = [ - "<%= settings.btcPerpsMarketId %>", - "<%= parseEther(settings.perpsBtcMaxLiquidationLimitAccumulationMultiplier) %>", - "<%= settings.perpsBtcMaxSecondsInLiquidationWindow %>", - "<%= parseEther(settings.perpsBtcMaxLiquidationPd) %>", - "<%= settings.perpsBtcEndorsedLiquidator %>" -] -depends = ["invoke.createBtcPerpsMarket"] - -[invoke.setPerpsBtcLiquidationParameters] -target = ["perpsFactory.PerpsMarketProxy"] -fromCall.func = "owner" -func = "setLiquidationParameters" -args = [ - "<%= settings.btcPerpsMarketId %>", - "<%= parseEther(settings.perpsBtcInitialMarginRatio) %>", - "<%= parseEther(settings.perpsBtcMinimumInitialMarginRatio) %>", - "<%= parseEther(settings.perpsBtcMaintenanceMarginScalar) %>", - "<%= parseEther(settings.perpsBtcLiquidationRewardRatioD18) %>", - "<%= parseEther(settings.perpsBtcMinimumPositionMargin) %>" -] -depends = ["invoke.createBtcPerpsMarket"] - -[invoke.setPerpsBtcLockedOiRatio] -target = ["perpsFactory.PerpsMarketProxy"] -fromCall.func = "owner" -func = "setLockedOiRatio" -args = ["<%= settings.btcPerpsMarketId %>", "<%= parseEther(settings.perpsBtcLockedOiRatio) %>"] -depends = ["invoke.createBtcPerpsMarket"] +[setting.owner] +defaultValue = "0x48914229deDd5A9922f44441ffCCfC2Cb7856Ee9" -# Ethereum Perpetual Futures [setting.eth_aggregator_address] -defaultValue = "0x71041dddad3595F9CEd3DcCFBe3D1F4b0a16Bb70" - -[invoke.registerEthOracleNode] -target = ["system.oracle_manager.Proxy"] -func = "registerNode" -args = [ - # 3 = chainlink aggregator type - 3, - # 3 parameters are: address of the chainlink oracle - "<%= defaultAbiCoder.encode(['address', 'uint256', 'uint8'], [settings.eth_aggregator_address, 0, 8]) %>", - [] -] -extra.eth_oracle_id.event = "NodeRegistered" -extra.eth_oracle_id.arg = 0 -depends = ["provision.system"] - -# Perps Configuration -[setting.ethPerpsMarketId] -defaultValue = "100" - -[setting.perpsEthSkewScale] -defaultValue = "1000000" - -[setting.perpsEthMaxFundingVelocity] -defaultValue = "9" +defaultValue = "0x9172995177A9A10FE1b7Df76E2A3266c0cFc71c7" -[setting.perpsEthMakerFeeRatio] -defaultValue = "0.0002" - -[setting.perpsEthTakerFeeRatio] -defaultValue = "0.0005" - -[setting.perpsEthMaxMarketSize] -defaultValue = "100000" - -[setting.perpsEthInitialMarginRatio] -defaultValue = "1" - -[setting.perpsEthMinimumInitialMarginRatio] -defaultValue = "0.02" - -[setting.perpsEthMaintenanceMarginScalar] -defaultValue = "0.5" - -[setting.perpsEthLiquidationRewardRatioD18] -defaultValue = "0.01" - -[setting.perpsEthMaxLiquidationLimitAccumulationMultiplier] -defaultValue = "1" - -[setting.perpsEthMaxSecondsInLiquidationWindow] -defaultValue = "30" - -[setting.perpsEthMinimumPositionMargin] -defaultValue = "0" - -[setting.perpsEthLockedOiRatio] -defaultValue = "0.5" - -[setting.perpsEthSynthMaxCollateralAmount] -defaultValue = "<%= MaxUint256 %>" - -[setting.perpsEthMaxLiquidationPd] -defaultValue = "0.0016" - -[setting.perpsEthEndorsedLiquidator] -defaultValue = "0xae2Fc483527B8EF99EB5D9B44875F005ba1FaE13" # TODO - -[setting.pythEthFeedId] -defaultValue = "0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43" - -[invoke.createEthPerpsMarket] -target = ["perpsFactory.PerpsMarketProxy"] -fromCall.func = "owner" -func = "createMarket" -args = ["<%= settings.ethPerpsMarketId %>", "Ethereum", "ETH"] -depends = ["provision.perpsFactory"] - -[invoke.setPerpsPriceEth] -target = ["perpsFactory.PerpsMarketProxy"] -fromCall.func = "owner" -func = "updatePriceData" -args = ["<%= settings.ethPerpsMarketId %>", "<%= extras.eth_oracle_id %>"] -depends = ["invoke.createEthPerpsMarket", "invoke.registerEthOracleNode"] - -[invoke.setPerpsEthSettlementStrategy] -target = ["perpsFactory.PerpsMarketProxy"] -fromCall.func = "owner" -func = "addSettlementStrategy" -args = [ - "<%= settings.ethPerpsMarketId %>", - # strategyType = 0 (pyth) - { strategyType = "0", settlementDelay = "<%= settings.bigCapSettlementDelay %>", settlementWindowDuration = "<%= settings.bigCapSettlementWindowDuration %>", priceWindowDuration = "<%= settings.bigCapPriceWindowDuration %>", priceVerificationContract = "<%= settings.pythPriceVerificationAddress %>", feedId = "<%= settings.pythEthFeedId %>", url = "<%= settings.pythFeedUrl %>", settlementReward = "<%= settings.settlementReward %>", priceDeviationTolerance = "<%= parseEther('1') %>", disabled = false } -] -depends = ["invoke.createEthPerpsMarket"] - -[invoke.setPerpsEthFundingParameters] -target = ["perpsFactory.PerpsMarketProxy"] -fromCall.func = "owner" -func = "setFundingParameters" -args = [ - "<%= settings.ethPerpsMarketId %>", - "<%= parseEther(settings.perpsEthSkewScale) %>", - "<%= parseEther(settings.perpsEthMaxFundingVelocity) %>" -] -depends = ["invoke.createEthPerpsMarket"] - -[invoke.setPerpsEthOrderFees] -target = ["perpsFactory.PerpsMarketProxy"] -fromCall.func = "owner" -func = "setOrderFees" -args = [ - "<%= settings.ethPerpsMarketId %>", - "<%= parseEther(settings.perpsEthMakerFeeRatio) %>", - "<%= parseEther(settings.perpsEthTakerFeeRatio) %>" -] -depends = ["invoke.createEthPerpsMarket"] +[setting.btc_aggregator_address] +defaultValue = "0x9172995177A9A10FE1b7Df76E2A3266c0cFc71c7" -[invoke.setPerpsEthMaxMarketSize] -target = ["perpsFactory.PerpsMarketProxy"] -fromCall.func = "owner" -func = "setMaxMarketSize" -args = ["<%= settings.ethPerpsMarketId %>", "<%= parseEther(settings.perpsEthMaxMarketSize) %>"] -depends = ["invoke.createEthPerpsMarket"] +[setting.ltc_aggregator_address] +defaultValue = "0x9172995177A9A10FE1b7Df76E2A3266c0cFc71c7" -[invoke.setPerpsEthMaxLiquidationParameters] -target = ["perpsFactory.PerpsMarketProxy"] -fromCall.func = "owner" -func = "setMaxLiquidationParameters" -args = [ - "<%= settings.ethPerpsMarketId %>", - "<%= parseEther(settings.perpsEthMaxLiquidationLimitAccumulationMultiplier) %>", - "<%= settings.perpsEthMaxSecondsInLiquidationWindow %>", - "<%= parseEther(settings.perpsEthMaxLiquidationPd) %>", - "<%= settings.perpsBtcEndorsedLiquidator %>" -] -depends = ["invoke.createEthPerpsMarket"] +[setting.xrp_aggregator_address] +defaultValue = "0x9172995177A9A10FE1b7Df76E2A3266c0cFc71c7" -[invoke.setPerpsEthLiquidationParameters] -target = ["perpsFactory.PerpsMarketProxy"] -fromCall.func = "owner" -func = "setLiquidationParameters" -args = [ - "<%= settings.ethPerpsMarketId %>", - "<%= parseEther(settings.perpsEthInitialMarginRatio) %>", - "<%= parseEther(settings.perpsEthMinimumInitialMarginRatio) %>", - "<%= parseEther(settings.perpsEthMaintenanceMarginScalar) %>", - "<%= parseEther(settings.perpsEthLiquidationRewardRatioD18) %>", - "<%= parseEther(settings.perpsEthMinimumPositionMargin) %>" -] -depends = ["invoke.createEthPerpsMarket"] +[setting.minimum_liquidity_ratio] +defaultValue = "1250000000000000000" # 125% min market collateralization -[invoke.setPerpsEthLockedOiRatio] -target = ["perpsFactory.PerpsMarketProxy"] -fromCall.func = "owner" -func = "setLockedOiRatio" -args = ["<%= settings.ethPerpsMarketId %>", "<%= parseEther(settings.perpsEthLockedOiRatio) %>"] -depends = ["invoke.createEthPerpsMarket"] +[setting.account_timeout_withdraw] +defaultValue = "86400" # 1 day -# Litecoin Perpetual Futures -# TODO -# XRP Perpetual Futures -# TODO -# CREATE POOL -[invoke.permitCreatePool] -target = ["system.CoreProxy"] -fromCall.func = "owner" -func = "addToFeatureFlagAllowlist" -args = ["<%= formatBytes32String('createPool') %>", "<%= settings.owner %>"] -depends = ["provision.system"] +[setting.deployer] +defaultValue = "0x48914229deDd5A9922f44441ffCCfC2Cb7856Ee9" -[setting.pool_id] +[setting.sc_pool_id] defaultValue = "1" -[invoke.createScPool] -target = ["system.CoreProxy"] -from = "<%= settings.owner %>" -func = "createPool" -args = ["<%= settings.pool_id %>", "<%= settings.owner %>"] -depends = ["invoke.permitCreatePool"] - -[invoke.setScPoolName] -target = ["system.CoreProxy"] -fromCall.func = "getPoolOwner" -fromCall.args = ["<%= settings.pool_id %>"] -func = "setPoolName" -args = ["<%= settings.pool_id %>", "Based Pool"] -depends = ["invoke.createScPool"] +[setting.pool_owner] +defaultValue = "0x48914229deDd5A9922f44441ffCCfC2Cb7856Ee9" -[invoke.setPreferredPool] -target = ["system.CoreProxy"] -fromCall.func = "owner" -func = "setPreferredPool" -args = ["<%= settings.pool_id %>"] -depends = ["invoke.createScPool"] - -# The pool doesn't back the spot market. Its PnL is always 0 [invoke.setScPoolConfig] target = ["system.CoreProxy"] fromCall.func = "getPoolOwner" -fromCall.args = ["<%= settings.pool_id %>"] +fromCall.args = ["<%= settings.sc_pool_id %>"] func = "setPoolConfiguration" args = [ - "<%= settings.pool_id %>", + "<%= settings.sc_pool_id %>", [ { marketId = "<%= imports.perpsFactory.extras.superMarketId %>", weightD18 = 1, maxDebtShareValueD18 = "<%= parseEther('1') %>" } ], ] -depends = ["invoke.createScPool", "provision.perpsFactory"] +depends = [ + "provision.perpsFactory" +] + diff --git a/package.json b/package.json index ed2f84476..9ec162234 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,8 @@ "devDependencies": { "@ethersproject/bytes": "^5.7.0", "@iarna/toml": "^3.0.0", - "@usecannon/builder": "^2.9.0", - "@usecannon/cli": "^2.9.1", + "@usecannon/builder": "^2.9.4", + "@usecannon/cli": "^2.9.5", "debug": "^4.3.4", "ethers": "^5.7.2", "hardhat": "^2.18.3", diff --git a/tomls/collaterals/usdc.toml b/tomls/collaterals/usdc.toml deleted file mode 100644 index e5929893c..000000000 --- a/tomls/collaterals/usdc.toml +++ /dev/null @@ -1,12 +0,0 @@ -include = ["../oracles/usdc.toml"] - -[setting.usdc_address] - -[invoke.configure_usdc_collateral] -target = ["system.CoreProxy"] -fromCall.func = "owner" -func = "configureCollateral" -args = [ - { tokenAddress = "<%= settings.usdc_address %>", oracleNodeId = "<%= extras.usdc_oracle_id %>", issuanceRatioD18 = "<%= parseEther('3') %>", liquidationRatioD18 = "<%= parseEther('1.5') %>", liquidationRewardD18 = "<%= parseEther('0.01') %>", minDelegationD18 = "<%= parseEther('0.01') %>", depositingEnabled = true } -] -depends = ["invoke.registerEthOracleNode"] diff --git a/tomls/markets/perps/ltc.toml b/tomls/markets/perps/ltc.toml new file mode 100644 index 000000000..3abd6c799 --- /dev/null +++ b/tomls/markets/perps/ltc.toml @@ -0,0 +1,133 @@ +include = [ + "../perps-factory.toml", + # TODO: this is a funny necessary dependency because the oracle manager is registering the same node twice + # however, it will not emit "NodeRegistered" the second time because its an unnecessary call + "../../oracles/pyth-ltc.toml", + "../common/bigcap-settings.toml", +] + +[setting.ltcPerpsMarketId] + +[setting.perpsLtcSkewScale] + +[setting.perpsLtcMaxFundingVelocity] + +[setting.perpsLtcMakerFeeRatio] + +[setting.perpsLtcTakerFeeRatio] + +[setting.perpsLtcMaxMarketSize] + +[setting.perpsLtcInitialMarginRatio] + +[setting.perpsLtcMaintenanceMarginFraction] + +[setting.perpsLtcLiquidationRewardRatioD18] + +[setting.perpsLtcMaxLiquidationLimitAccumulationMultiplier] + +[setting.perpsLtcMaxSecondsInLiquidationWindow] + +[setting.perpsLtcMinimumPositionMargin] + +[setting.perpsLtcLockedOiRatio] + +[setting.pythLtcFeedId] + +# strategy type for Perps markets is 0, for spot markets is 1 +[setting.strategyType] +defaultValue = "0" + +[invoke.createLTCPerpsMarket] +target = ["perpsFactory.PerpsMarketProxy"] +fromCall.func = "owner" +func = "createMarket" +args = ["<%= settings.ltcPerpsMarketId %>", "Litecoin", "LTC"] +depends = ["provision.perpsFactory"] + +[invoke.setPerpsPriceLtc] +target = ["perpsFactory.PerpsMarketProxy"] +fromCall.func = "owner" +func = "updatePriceData" +args = ["<%= settings.ltcPerpsMarketId %>", "<%= extras.ltc_oracle_id %>"] +depends = ["invoke.createLtcPerpsMarket", "invoke.registerLtcOracleNode"] + +[invoke.setPerpsLtcSettlementStrategy] +target = ["perpsFactory.PerpsMarketProxy"] +fromCall.func = "owner" +func = "addSettlementStrategy" +args = [ + "<%= settings.ltcPerpsMarketId %>", + { strategyType = "<%= settings.strategyType %>", settlementDelay = "<%= settings.bigCapSettlementDelay %>", settlementWindowDuration = "<%= settings.bigCapSettlementWindowDuration %>", priceWindowDuration = "<%= settings.bigCapPriceWindowDuration %>", priceVerificationContract = "<%= settings.pythPriceVerificationAddress %>", feedId = "<%= settings.pythLtcFeedId %>", url = "<%= settings.pythFeedUrl %>", settlementReward = "<%= settings.settlementReward %>", priceDeviationTolerance = "<%= parseEther('1') %>", disabled = false } +] +depends = ["invoke.createLtcPerpsMarket"] + +[invoke.setPerpsLtcFundingParameters] +target = ["perpsFactory.PerpsMarketProxy"] +fromCall.func = "owner" +func = "setFundingParameters" +args = [ + "<%= settings.ltcPerpsMarketId %>", + "<%= parseEther(settings.perpsLtcSkewScale) %>", + "<%= parseEther(settings.perpsLtcMaxFundingVelocity) %>" +] +depends = ["invoke.createLtcPerpsMarket"] + +[invoke.setPerpsLtcOrderFees] +target = ["perpsFactory.PerpsMarketProxy"] +fromCall.func = "owner" +func = "setOrderFees" +args = [ + "<%= settings.ltcPerpsMarketId %>", + "<%= parseEther(settings.perpsLtcMakerFeeRatio) %>", + "<%= parseEther(settings.perpsLtcTakerFeeRatio) %>" +] +depends = ["invoke.createLtcPerpsMarket"] + +[invoke.setPerpsLtcMaxMarketSize] +target = ["perpsFactory.PerpsMarketProxy"] +fromCall.func = "owner" +func = "setMaxMarketSize" +args = ["<%= settings.ltcPerpsMarketId %>", "<%= parseEther(settings.perpsLtcMaxMarketSize) %>"] +depends = ["invoke.createLtcPerpsMarket"] + +[invoke.setPerpsLtcMaxLiquidationParameters] +target = ["perpsFactory.PerpsMarketProxy"] +fromCall.func = "owner" +func = "setMaxLiquidationParameters" +args = [ + "<%= settings.ltcPerpsMarketId %>", + "<%= parseEther(settings.perpsLtcMaxLiquidationLimitAccumulationMultiplier) %>", + "<%= settings.perpsLtcMaxSecondsInLiquidationWindow %>", + "<%= parseEther(settings.perpsLtcMaxLiquidationPd) %>", + "<%= settings.perpsLtcEndorsedLiquidator %>" +] +depends = ["invoke.createLtcPerpsMarket"] + +[invoke.setPerpsLtcLiquidationParameters] +target = ["perpsFactory.PerpsMarketProxy"] +fromCall.func = "owner" +func = "setLiquidationParameters" +args = [ + "<%= settings.ltcPerpsMarketId %>", + "<%= parseEther(settings.perpsLtcInitialMarginRatio) %>", + "<%= parseEther(settings.perpsLtcMinimumInitialMarginRatio) %>", + "<%= parseEther(settings.perpsLtcMaintenanceMarginScalar) %>", + "<%= parseEther(settings.perpsLtcLiquidationRewardRatioD18) %>", + "<%= parseEther(settings.perpsLtcMinimumPositionMargin) %>" +] +depends = ["invoke.createLtcPerpsMarket"] + +[invoke.setPerpsLtcLockedOiRatio] +target = ["perpsFactory.PerpsMarketProxy"] +fromCall.func = "owner" +func = "setLockedOiRatio" +args = ["<%= settings.ltcPerpsMarketId %>", "<%= parseEther(settings.perpsLtcLockedOiRatio) %>"] +depends = ["invoke.createLtcPerpsMarket"] + +[invoke.setMaxCollateralAmountLtc] +target = ["perpsFactory.PerpsMarketProxy"] +fromCall.func = "owner" +func = "setMaxCollateralAmount" +args = ["<%= extras.synth_ltc_market_id %>", "<%= settings.perpsLtcSynthMaxCollateralAmount %>"] +depends = ["invoke.createLtcSynth", "provision.perpsFactory"] diff --git a/tomls/markets/perps/xrp.toml b/tomls/markets/perps/xrp.toml new file mode 100644 index 000000000..a904410f0 --- /dev/null +++ b/tomls/markets/perps/xrp.toml @@ -0,0 +1,133 @@ +include = [ + "../perps-factory.toml", + # TODO: this is a funny necessary dependency because the oracle manager is registering the same node twice + # however, it will not emit "NodeRegistered" the second time because its an unnecessary call + "../../oracles/pyth-xrp.toml", + "../common/bigcap-settings.toml", +] + +[setting.xrpPerpsMarketId] + +[setting.perpsXrpSkewScale] + +[setting.perpsXrpMaxFundingVelocity] + +[setting.perpsXrpMakerFeeRatio] + +[setting.perpsXrpTakerFeeRatio] + +[setting.perpsXrpMaxMarketSize] + +[setting.perpsXrpInitialMarginRatio] + +[setting.perpsXrpMaintenanceMarginFraction] + +[setting.perpsXrpLiquidationRewardRatioD18] + +[setting.perpsXrpMaxLiquidationLimitAccumulationMultiplier] + +[setting.perpsXrpMaxSecondsInLiquidationWindow] + +[setting.perpsXrpMinimumPositionMargin] + +[setting.perpsXrpLockedOiRatio] + +[setting.pythXrpFeedId] + +# strategy type for Perps markets is 0, for spot markets is 1 +[setting.strategyType] +defaultValue = "0" + +[invoke.createXrpPerpsMarket] +target = ["perpsFactory.PerpsMarketProxy"] +fromCall.func = "owner" +func = "createMarket" +args = ["<%= settings.xrpPerpsMarketId %>", "Ripple Token", "XRP"] +depends = ["provision.perpsFactory"] + +[invoke.setPerpsPriceXrp] +target = ["perpsFactory.PerpsMarketProxy"] +fromCall.func = "owner" +func = "updatePriceData" +args = ["<%= settings.xrpPerpsMarketId %>", "<%= extras.xrp_oracle_id %>"] +depends = ["invoke.createXrpPerpsMarket", "invoke.registerXrpOracleNode"] + +[invoke.setPerpsXrpSettlementStrategy] +target = ["perpsFactory.PerpsMarketProxy"] +fromCall.func = "owner" +func = "addSettlementStrategy" +args = [ + "<%= settings.xrpPerpsMarketId %>", + { strategyType = "<%= settings.strategyType %>", settlementDelay = "<%= settings.bigCapSettlementDelay %>", settlementWindowDuration = "<%= settings.bigCapSettlementWindowDuration %>", priceWindowDuration = "<%= settings.bigCapPriceWindowDuration %>", priceVerificationContract = "<%= settings.pythPriceVerificationAddress %>", feedId = "<%= settings.pythLtcFeedId %>", url = "<%= settings.pythFeedUrl %>", settlementReward = "<%= settings.settlementReward %>", priceDeviationTolerance = "<%= parseEther('1') %>", disabled = false } +] +depends = ["invoke.createXrpPerpsMarket"] + +[invoke.setPerpsXrpFundingParameters] +target = ["perpsFactory.PerpsMarketProxy"] +fromCall.func = "owner" +func = "setFundingParameters" +args = [ + "<%= settings.xrpPerpsMarketId %>", + "<%= parseEther(settings.perpsXrpSkewScale) %>", + "<%= parseEther(settings.perpsXrpMaxFundingVelocity) %>" +] +depends = ["invoke.createLtcPerpsMarket"] + +[invoke.setPerpsLtcOrderFees] +target = ["perpsFactory.PerpsMarketProxy"] +fromCall.func = "owner" +func = "setOrderFees" +args = [ + "<%= settings.ltcPerpsMarketId %>", + "<%= parseEther(settings.perpsXrpMakerFeeRatio) %>", + "<%= parseEther(settings.perpsXrpTakerFeeRatio) %>" +] +depends = ["invoke.createXrpPerpsMarket"] + +[invoke.setPerpsXrpMaxMarketSize] +target = ["perpsFactory.PerpsMarketProxy"] +fromCall.func = "owner" +func = "setMaxMarketSize" +args = ["<%= settings.xrpPerpsMarketId %>", "<%= parseEther(settings.perpsXrpMaxMarketSize) %>"] +depends = ["invoke.createXrpPerpsMarket"] + +[invoke.setPerpsXrpMaxLiquidationParameters] +target = ["perpsFactory.PerpsMarketProxy"] +fromCall.func = "owner" +func = "setMaxLiquidationParameters" +args = [ + "<%= settings.xrpPerpsMarketId %>", + "<%= parseEther(settings.perpsXrpMaxLiquidationLimitAccumulationMultiplier) %>", + "<%= settings.perpsXrpMaxSecondsInLiquidationWindow %>", + "<%= parseEther(settings.perpsXrpMaxLiquidationPd) %>", + "<%= settings.perpsXrpEndorsedLiquidator %>" +] +depends = ["invoke.createXrpPerpsMarket"] + +[invoke.setPerpsXrpLiquidationParameters] +target = ["perpsFactory.PerpsMarketProxy"] +fromCall.func = "owner" +func = "setLiquidationParameters" +args = [ + "<%= settings.opPerpsMarketId %>", + "<%= parseEther(settings.perpsXrpInitialMarginRatio) %>", + "<%= parseEther(settings.perpsXrpMinimumInitialMarginRatio) %>", + "<%= parseEther(settings.perpsXrpMaintenanceMarginScalar) %>", + "<%= parseEther(settings.perpsXrpLiquidationRewardRatioD18) %>", + "<%= parseEther(settings.perpsXrpMinimumPositionMargin) %>" +] +depends = ["invoke.createXrpPerpsMarket"] + +[invoke.setPerpsOpLockedOiRatio] +target = ["perpsFactory.PerpsMarketProxy"] +fromCall.func = "owner" +func = "setLockedOiRatio" +args = ["<%= settings.xrpPerpsMarketId %>", "<%= parseEther(settings.perpsXrpLockedOiRatio) %>"] +depends = ["invoke.createXrpPerpsMarket"] + +[invoke.setMaxCollateralAmountXrp] +target = ["perpsFactory.PerpsMarketProxy"] +fromCall.func = "owner" +func = "setMaxCollateralAmount" +args = ["<%= extras.synth_xrp_market_id %>", "<%= settings.perpsXrpSynthMaxCollateralAmount %>"] +depends = ["invoke.createXrpSynth", "provision.perpsFactory"] diff --git a/tomls/omnibus-base-goerli-andromeda/perps/btc.toml b/tomls/omnibus-base-goerli-andromeda/perps/btc.toml new file mode 100644 index 000000000..7c4833e03 --- /dev/null +++ b/tomls/omnibus-base-goerli-andromeda/perps/btc.toml @@ -0,0 +1,54 @@ +[setting.pythBtcFeedId] +defaultValue = "0xf9c0172ba10dfa4d19088d94f5bf61d3b54d5bd7483a322a982e1373ee8ea31b" + +# Perps Configuration +[setting.btcPerpsMarketId] +defaultValue = "200" + +[setting.perpsBtcSkewScale] +defaultValue = "1000000" + +[setting.perpsBtcMaxFundingVelocity] +defaultValue = "9" + +[setting.perpsBtcMakerFeeRatio] +defaultValue = "0.0007" + +[setting.perpsBtcTakerFeeRatio] +defaultValue = "0.0003" + +[setting.perpsBtcMaxMarketSize] +defaultValue = "100000" + +[setting.perpsBtcInitialMarginRatio] +defaultValue = "1" + +[setting.perpsBtcMaintenanceMarginScalar] +defaultValue = "0.5" + +[setting.perpsBtcMinimumInitialMarginRatio] +defaultValue = "0.02" + +[setting.perpsBtcLiquidationRewardRatioD18] +defaultValue = "0.01" + +[setting.perpsBtcMaxLiquidationLimitAccumulationMultiplier] +defaultValue = "0.5" + +[setting.perpsBtcMaxSecondsInLiquidationWindow] +defaultValue = "30" + +[setting.perpsBtcMinimumPositionMargin] +defaultValue = "0" + +[setting.perpsBtcLockedOiRatio] +defaultValue = "0.5" + +[setting.perpsBtcSynthMaxCollateralAmount] +defaultValue = "<%= MaxUint256 %>" + +[setting.perpsBtcMaxLiquidationPd] +defaultValue = "0.0016" + +[setting.perpsBtcEndorsedLiquidator] +defaultValue = "0xae2Fc483527B8EF99EB5D9B44875F005ba1FaE13" diff --git a/tomls/omnibus-base-goerli-andromeda/perps/eth.toml b/tomls/omnibus-base-goerli-andromeda/perps/eth.toml new file mode 100644 index 000000000..cb47e7ca2 --- /dev/null +++ b/tomls/omnibus-base-goerli-andromeda/perps/eth.toml @@ -0,0 +1,55 @@ +# Pyth settlement strategy config +[setting.pythEthFeedId] +defaultValue = "0xca80ba6dc32e08d06f1aa886011eed1d77c77be9eb761cc10d72b7d0a2fd57a6" + +# Perps Configuration +[setting.ethPerpsMarketId] +defaultValue = "100" + +[setting.perpsEthSkewScale] +defaultValue = "1000000" + +[setting.perpsEthMaxFundingVelocity] +defaultValue = "9" + +[setting.perpsEthMakerFeeRatio] +defaultValue = "0.0002" + +[setting.perpsEthTakerFeeRatio] +defaultValue = "0.0005" + +[setting.perpsEthMaxMarketSize] +defaultValue = "100000" + +[setting.perpsEthInitialMarginRatio] +defaultValue = "1" + +[setting.perpsEthMinimumInitialMarginRatio] +defaultValue = "0.02" + +[setting.perpsEthMaintenanceMarginScalar] +defaultValue = "0.5" + +[setting.perpsEthLiquidationRewardRatioD18] +defaultValue = "0.01" + +[setting.perpsEthMaxLiquidationLimitAccumulationMultiplier] +defaultValue = "1" + +[setting.perpsEthMaxSecondsInLiquidationWindow] +defaultValue = "30" + +[setting.perpsEthMinimumPositionMargin] +defaultValue = "0" + +[setting.perpsEthLockedOiRatio] +defaultValue = "0.5" + +[setting.perpsEthSynthMaxCollateralAmount] +defaultValue = "<%= MaxUint256 %>" + +[setting.perpsEthMaxLiquidationPd] +defaultValue = "0.0016" + +[setting.perpsEthEndorsedLiquidator] +defaultValue = "0xae2Fc483527B8EF99EB5D9B44875F005ba1FaE13" diff --git a/tomls/omnibus-base-goerli-andromeda/perps/global.toml b/tomls/omnibus-base-goerli-andromeda/perps/global.toml new file mode 100644 index 000000000..f3ff31dbd --- /dev/null +++ b/tomls/omnibus-base-goerli-andromeda/perps/global.toml @@ -0,0 +1,39 @@ +# GLOBAL PERPS SETTINGS +[setting.perpsMinLiquidationReward] +defaultValue = "1" + +[setting.perpsMaxLiquidationReward] +defaultValue = "500" + +# ------------------------------ +[invoke.setPerpsLiquidationRewardLimits] +target = ["perpsFactory.PerpsMarketProxy"] +fromCall.func = "owner" +func = "setLiquidationRewardGuards" +args = ["<%= parseEther('1') %>", "<%= parseEther('500') %>"] +depends = ["provision.perpsFactory"] + +[invoke.setPerpsMaxCollateralForSnxUsd] +target = ["perpsFactory.PerpsMarketProxy"] +fromCall.func = "owner" +func = "setMaxCollateralAmount" +args = ["0", "<%= MaxUint256 %>"] +depends = ["provision.perpsFactory"] + +[invoke.setPerpsSynthDeductionPriority] +target = ["perpsFactory.PerpsMarketProxy"] +fromCall.func = "owner" +func = "setSynthDeductionPriority" +args = [ + ["0"] +] +depends = [ + "provision.perpsFactory" +] + +[invoke.setPerAccountCapsPerps] +target = ["perpsFactory.PerpsMarketProxy"] +fromCall.func = "owner" +func = "setPerAccountCaps" +args = ["5", "3"] +depends = ["provision.perpsFactory"] diff --git a/tomls/omnibus-base-goerli-andromeda/perps/ltc.toml b/tomls/omnibus-base-goerli-andromeda/perps/ltc.toml new file mode 100644 index 000000000..0aaf7cb2f --- /dev/null +++ b/tomls/omnibus-base-goerli-andromeda/perps/ltc.toml @@ -0,0 +1,54 @@ +[setting.pythLtcFeedId] +defaultValue = "0xf9c0172ba10dfa4d19088d94f5bf61d3b54d5bd7483a322a982e1373ee8ea31b" + +# Perps Configuration +[setting.ltcPerpsMarketId] +defaultValue = "300" + +[setting.perpsLtcSkewScale] +defaultValue = "1000000" + +[setting.perpsLtcMaxFundingVelocity] +defaultValue = "9" + +[setting.perpsLtcMakerFeeRatio] +defaultValue = "0.0007" + +[setting.perpsLtcTakerFeeRatio] +defaultValue = "0.0003" + +[setting.perpsLtcMaxMarketSize] +defaultValue = "100000" + +[setting.perpsLtcInitialMarginRatio] +defaultValue = "1" + +[setting.perpsLtcMaintenanceMarginScalar] +defaultValue = "0.5" + +[setting.perpsLtcMinimumInitialMarginRatio] +defaultValue = "0.02" + +[setting.perpsLtcLiquidationRewardRatioD18] +defaultValue = "0.01" + +[setting.perpsLtcMaxLiquidationLimitAccumulationMultiplier] +defaultValue = "0.5" + +[setting.perpsLtcMaxSecondsInLiquidationWindow] +defaultValue = "30" + +[setting.perpsLtcMinimumPositionMargin] +defaultValue = "0" + +[setting.perpsLtcLockedOiRatio] +defaultValue = "0.5" + +[setting.perpsLtcSynthMaxCollateralAmount] +defaultValue = "<%= MaxUint256 %>" + +[setting.perpsLtcMaxLiquidationPd] +defaultValue = "0.0016" + +[setting.perpsLtcEndorsedLiquidator] +defaultValue = "0xae2Fc483527B8EF99EB5D9B44875F005ba1FaE13" diff --git a/tomls/omnibus-base-goerli-andromeda/perps/xrp.toml b/tomls/omnibus-base-goerli-andromeda/perps/xrp.toml new file mode 100644 index 000000000..f42497b98 --- /dev/null +++ b/tomls/omnibus-base-goerli-andromeda/perps/xrp.toml @@ -0,0 +1,54 @@ +[setting.pythXrpFeedId] +defaultValue = "0xf9c0172ba10dfa4d19088d94f5bf61d3b54d5bd7483a322a982e1373ee8ea31b" + +# Perps Configuration +[setting.xrpPerpsMarketId] +defaultValue = "400" + +[setting.perpsXrpSkewScale] +defaultValue = "1000000" + +[setting.perpsXrpMaxFundingVelocity] +defaultValue = "9" + +[setting.perpsXrpMakerFeeRatio] +defaultValue = "0.0007" + +[setting.perpsXrpTakerFeeRatio] +defaultValue = "0.0003" + +[setting.perpsXrpMaxMarketSize] +defaultValue = "100000" + +[setting.perpsXrpInitialMarginRatio] +defaultValue = "1" + +[setting.perpsXrpMaintenanceMarginScalar] +defaultValue = "0.5" + +[setting.perpsXrpMinimumInitialMarginRatio] +defaultValue = "0.02" + +[setting.perpsXrpLiquidationRewardRatioD18] +defaultValue = "0.01" + +[setting.perpsXrpMaxLiquidationLimitAccumulationMultiplier] +defaultValue = "0.5" + +[setting.perpsXrpMaxSecondsInLiquidationWindow] +defaultValue = "30" + +[setting.perpsXrpMinimumPositionMargin] +defaultValue = "0" + +[setting.perpsXrpLockedOiRatio] +defaultValue = "0.5" + +[setting.perpsXrpSynthMaxCollateralAmount] +defaultValue = "<%= MaxUint256 %>" + +[setting.perpsXrpMaxLiquidationPd] +defaultValue = "0.0016" + +[setting.perpsXrpEndorsedLiquidator] +defaultValue = "0xae2Fc483527B8EF99EB5D9B44875F005ba1FaE13" diff --git a/tomls/omnibus-base-goerli-andromeda/spot/usdc.toml b/tomls/omnibus-base-goerli-andromeda/spot/usdc.toml new file mode 100644 index 000000000..c5ed9565c --- /dev/null +++ b/tomls/omnibus-base-goerli-andromeda/spot/usdc.toml @@ -0,0 +1,62 @@ +[provision.usdc_mock_collateral] +source = "mintable-token" +sourcePreset="permissionless-mint" + +[setting.usdc_address] + +[setting.synthUsdcMaxMarketCollateral] + +[invoke.createUsdcSynth] +target = ["spotFactory.SpotMarketProxy"] +fromCall.func = "owner" +func = "createSynth" +args = ["Synthetic USD Coin", "sUSDC", "<%= settings.owner %>"] +extra.synth_usdc_market_id.event = "SynthRegistered" +extra.synth_usdc_market_id.arg = 0 +extra.synth_usdc_token_address.event = "SynthRegistered" +extra.synth_usdc_token_address.arg = 1 +depends = ["provision.spotFactory"] + +[invoke.setSynthPriceUsdc] +target = ["spotFactory.SpotMarketProxy"] +fromCall.func = "getMarketOwner" +fromCall.args = ["<%= extras.synth_usdc_market_id %>"] +func = "updatePriceData" +args = [ + "<%= extras.synth_usdc_market_id %>", + "<%= imports.system.extras.const_one_oracle_id %>", + "<%= imports.system.extras.const_one_oracle_id %>" +] +depends = ["invoke.createUsdcSynth", "invoke.registerUsdcOracleNode"] + +[invoke.setSynthMaxMarketCollateralUsdc] +target = ["system.CoreProxy"] +fromCall.func = "owner" +fromCall.args = [] +func = "configureMaximumMarketCollateral" +args = [ + "<%= extras.synth_usdc_market_id %>", + "<%= imports.usdc_mock_collateral.contracts.MintableToken.address %>", + "<%= parseEther(settings.synthUsdcMaxMarketCollateral) %>" +] +depends = ["invoke.createUsdcSynth"] + +[invoke.configureSynthWrapperUsdc] +target = ["spotFactory.SpotMarketProxy"] +fromCall.func = "getMarketOwner" +fromCall.args = ["<%= extras.synth_usdc_market_id %>"] +func = "setWrapper" +args = [ + "<%= extras.synth_usdc_market_id %>", + "<%= imports.usdc_mock_collateral.contracts.MintableToken.address %>", + "<%= parseEther(settings.synthUsdcMaxMarketCollateral) %>" +] +depends = ["invoke.createUsdcSynth"] + +[invoke.configure_susdc_collateral] +target = ["system.CoreProxy"] +fromCall.func = "owner" +func = "configureCollateral" +args = [ + { tokenAddress = "<%= imports.usdc_mock_collateral.contracts.MintableToken.address %>", oracleNodeId = "<%= imports.system.extras.const_one_oracle_id %>", issuanceRatioD18 = "<%= MaxUint256 %>", liquidationRatioD18 = "<%= parseEther('0.5') %>", liquidationRewardD18 = "<%= parseEther('0.01') %>", minDelegationD18 = "<%= parseEther('1') %>", depositingEnabled = true } +] \ No newline at end of file diff --git a/tomls/oracles/pyth-ltc.toml b/tomls/oracles/pyth-ltc.toml new file mode 100644 index 000000000..4b46d20f3 --- /dev/null +++ b/tomls/oracles/pyth-ltc.toml @@ -0,0 +1,16 @@ +include = ["../core.toml"] + +[setting.snx_aggregator_address] + +[invoke.registerSnxOracleNode] +target = ["system.oracle_manager.Proxy"] +func = "registerNode" +args = [ + # 2 = external aggregator type (later this will be PYTH) + 2, + "<%= defaultAbiCoder.encode(['address', 'bytes32', 'uint256'], [settings.snx_aggregator_address, settings.pythSnxFeedId, 30]) %>", + [] +] +extra.snx_oracle_id.event = "NodeRegistered" +extra.snx_oracle_id.arg = 0 +depends = ["provision.system"] diff --git a/tomls/oracles/pyth-xrp.toml b/tomls/oracles/pyth-xrp.toml new file mode 100644 index 000000000..4b46d20f3 --- /dev/null +++ b/tomls/oracles/pyth-xrp.toml @@ -0,0 +1,16 @@ +include = ["../core.toml"] + +[setting.snx_aggregator_address] + +[invoke.registerSnxOracleNode] +target = ["system.oracle_manager.Proxy"] +func = "registerNode" +args = [ + # 2 = external aggregator type (later this will be PYTH) + 2, + "<%= defaultAbiCoder.encode(['address', 'bytes32', 'uint256'], [settings.snx_aggregator_address, settings.pythSnxFeedId, 30]) %>", + [] +] +extra.snx_oracle_id.event = "NodeRegistered" +extra.snx_oracle_id.arg = 0 +depends = ["provision.system"] diff --git a/yarn.lock b/yarn.lock index 5e1c86959..32fc52055 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1049,9 +1049,9 @@ __metadata: languageName: node linkType: hard -"@usecannon/builder@npm:^2.9.0": - version: 2.9.0 - resolution: "@usecannon/builder@npm:2.9.0" +"@usecannon/builder@npm:^2.9.4": + version: 2.9.4 + resolution: "@usecannon/builder@npm:2.9.4" dependencies: "@synthetixio/router": ^3.3.0 axios: ^1.2.2 @@ -1065,17 +1065,17 @@ __metadata: zod: ^3.21.4 peerDependencies: ethers: ">=5.6.0 < 6.0.0" - checksum: 0b929aa7d90b1a74d551f1a8e9f8a54139f37cb315ca67d0064c8a32058f6e68ad76582b65ff27b32211974133d4cbad0274739d4adbdbdcacf9b7974638e5c5 + checksum: 7c607331dcba3c03601d535f5bcb2eb9d1e453d9347a684e5ed04a2baefaaeab933134a08ee0b0aa428602a2a4060d885cf29839673738d9cdf4915dc758cab4 languageName: node linkType: hard -"@usecannon/cli@npm:^2.9.1": - version: 2.9.1 - resolution: "@usecannon/cli@npm:2.9.1" +"@usecannon/cli@npm:^2.9.5": + version: 2.9.5 + resolution: "@usecannon/cli@npm:2.9.5" dependencies: "@iarna/toml": ^3.0.0 "@synthetixio/wei": ^2.74.1 - "@usecannon/builder": ^2.9.0 + "@usecannon/builder": ^2.9.4 chalk: ^4.1.2 commander: ^9.5.0 debug: ^4.3.4 @@ -1091,7 +1091,7 @@ __metadata: untildify: ^4.0.0 bin: cannon: bin/cannon.js - checksum: 852e7a5bb7501678550251664832d7bda0fbb38eda15698f6688905fd9bae0448d8f8f71baa0d72b76db7ffe3fc6a34d8f902f237012480ac2147437dc21b67b + checksum: 000fa1f9c61d946a851f9ea4063110066db9cf5f1660c4f03a7e4066cfc56eecbdfe8adab307f535c8cd6908cf63bbf9373130748430b550f366103e988ac01f languageName: node linkType: hard @@ -4076,8 +4076,8 @@ __metadata: dependencies: "@ethersproject/bytes": ^5.7.0 "@iarna/toml": ^3.0.0 - "@usecannon/builder": ^2.9.0 - "@usecannon/cli": ^2.9.1 + "@usecannon/builder": ^2.9.4 + "@usecannon/cli": ^2.9.5 debug: ^4.3.4 ethers: ^5.7.2 hardhat: ^2.18.3