diff --git a/e2e/tests/omnibus-base-sepolia-andromeda.toml/Liquidation_Rewards_Registrations.e2e.js b/e2e/tests/omnibus-base-sepolia-andromeda.toml/Liquidation_Rewards_Registrations.e2e.js new file mode 100644 index 000000000..4238e35cd --- /dev/null +++ b/e2e/tests/omnibus-base-sepolia-andromeda.toml/Liquidation_Rewards_Registrations.e2e.js @@ -0,0 +1,170 @@ +const crypto = require('crypto'); +const assert = require('assert'); +const { ethers } = require('ethers'); +require('../../inspect'); +const log = require('debug')(`e2e:${require('path').basename(__filename, '.e2e.js')}`); + +const { getEthBalance } = require('../../tasks/getEthBalance'); +const { setEthBalance } = require('../../tasks/setEthBalance'); +const { syncTime } = require('../../tasks/syncTime'); +const { contractRead } = require('../../tasks/contractRead'); +const { getAccountOwner } = require('../../tasks/getAccountOwner'); +const { createAccount } = require('../../tasks/createAccount'); +const { getAvailableRewards } = require('../../tasks/getAvailableRewards'); + +describe(require('path').basename(__filename, '.e2e.js'), function () { + const provider = new ethers.providers.JsonRpcProvider( + process.env.RPC_URL || 'http://127.0.0.1:8545' + ); + const accountId = parseInt(`1337${crypto.randomInt(1000)}`); + const wallet = ethers.Wallet.createRandom().connect(provider); + // const wallet = new ethers.Wallet('0xab', provider); + // const accountId = 1337; + const address = wallet.address; + const privateKey = wallet.privateKey; + const poolId = '1'; + + let registeredDistributors; + let liquidationDistributors; + let expectedDistributors; + + let snapshot; + before('Create snapshot', async () => { + snapshot = await provider.send('evm_snapshot', []); + log('Create snapshot', { snapshot }); + }); + after('Restore snapshot', async () => { + log('Restore snapshot', { snapshot }); + await provider.send('evm_revert', [snapshot]); + }); + + it('should sync time of the fork', async () => { + await syncTime(); + }); + + it('should collect all registered rewards distributors', async () => { + const cannon = require('../../deployments/cannon.json'); + + registeredDistributors = []; + // walk over all the registration invokes and set isRegistered flag for deployed distributors + for (const [key, value] of Object.entries(cannon?.state || {})) { + if (key.startsWith('invoke.')) { + const [, artifactName] = key.split('.'); + const events = value?.artifacts?.txns?.[artifactName]?.events?.RewardsDistributorRegistered; + if (events) { + for (const event of events) { + const [poolId, collateralType, distributor] = event.args; + registeredDistributors.push({ poolId, collateralType, distributor }); + } + } + } + } + log({ registeredDistributors }); + }); + + it('should collect all expected distributors for perps liquidations', async () => { + const supportedCollateralsIds = await contractRead({ + wallet, + contract: 'PerpsMarketProxy', + func: 'getSupportedCollaterals', + args: [], + }); + log({ supportedCollateralsIds }); + + const systemToken = require('../../deployments/systemToken.json'); + const synthTokens = require('../../deployments/synthTokens.json'); + + // We can only use synth tokens and system token as collaterals + // We do NOT need a rewards distributor for system token + const supportedCollaterals = supportedCollateralsIds + .map((id) => { + const synthMarketId = id.toString(); + if (synthMarketId === '0') { + return { + synthMarketId, + ...systemToken, + }; + } + return synthTokens.find((token) => token.synthMarketId === synthMarketId); + }) + .filter(Boolean); + log({ supportedCollaterals }); + + const liquidatableCollaterals = supportedCollaterals + // We do not need rewards distributor for system token + .filter((collateral) => collateral.address !== systemToken.address); + + expectedDistributors = []; + for (const liquidatableCollateral of liquidatableCollaterals) { + const { distributor, poolDelegatedCollateralTypes } = await contractRead({ + wallet, + contract: 'PerpsMarketProxy', + func: 'getRegisteredDistributor', + args: [liquidatableCollateral.synthMarketId], + }); + for (const collateralType of poolDelegatedCollateralTypes) { + expectedDistributors.push({ + poolId, + collateralType, + distributor, + }); + } + } + log({ expectedDistributors }); + }); + + it('should ensure each perps collateral has rewards distributor registered', async () => { + for (const expectedDistributor of expectedDistributors) { + const registeredDistributor = registeredDistributors.find( + ({ poolId, collateralType, distributor }) => + collateralType === expectedDistributor.collateralType && + distributor === expectedDistributor.distributor && + poolId === expectedDistributor.poolId + ); + log({ expectedDistributor, registeredDistributor }); + assert.ok( + registeredDistributor, + 'Every expected rewards distributor for liquidations is registered' + ); + } + }); + + it('should create new random wallet', async () => { + log({ wallet: wallet.address, pk: wallet.privateKey }); + assert.ok(wallet.address); + }); + + it('should set ETH balance to 100', async () => { + const address = wallet.address; + assert.equal(await getEthBalance({ address }), 0, 'New wallet has 0 ETH balance'); + await setEthBalance({ address, balance: 100 }); + assert.equal(await getEthBalance({ address }), 100); + }); + + it('should create user account', async () => { + assert.equal( + await getAccountOwner({ accountId }), + ethers.constants.AddressZero, + 'New wallet should not have an account yet' + ); + await createAccount({ wallet, accountId }); + assert.equal(await getAccountOwner({ accountId }), address); + }); + + it('should verify that new wallet has no liquidation rewards without "reward is not found" revert', async () => { + for (const rewardsDistributor of expectedDistributors) { + const collateralType = rewardsDistributor.collateralType; + const distributor = rewardsDistributor.distributor; + log({ accountId, poolId, collateralType, distributor }); + + const availableRewards = await getAvailableRewards({ + accountId, + poolId, + collateralType, + distributorAddress: distributor, + }); + log({ availableRewards }); + assert.equal(availableRewards, 0, 'new wallet should have no liquidation rewards'); + } + }); +}); diff --git a/omnibus-base-sepolia-andromeda.toml b/omnibus-base-sepolia-andromeda.toml index d238831a0..4af50fc7d 100644 --- a/omnibus-base-sepolia-andromeda.toml +++ b/omnibus-base-sepolia-andromeda.toml @@ -11,19 +11,32 @@ include = [ "tomls/omnibus-base-sepolia-andromeda/perps/feeCollector.toml", # System collaterals - "tomls/omnibus-base-sepolia-andromeda/collaterals/sUSDC.toml", - "tomls/omnibus-base-sepolia-andromeda/collaterals/sstataUSDC.toml", - - # LP Rewards - "tomls/omnibus-base-sepolia-andromeda/rewards/snx_rewards_for_sc_pool.toml", - "tomls/omnibus-base-sepolia-andromeda/rewards/usdc_rewards_for_sc_pool.toml", + "tomls/omnibus-base-sepolia-andromeda/collaterals/cbbtc.toml", + "tomls/omnibus-base-sepolia-andromeda/collaterals/cbeth.toml", + "tomls/omnibus-base-sepolia-andromeda/collaterals/wsteth.toml", + "tomls/omnibus-base-sepolia-andromeda/collaterals/weth.toml", + "tomls/omnibus-base-sepolia-andromeda/collaterals/synth-usdc.toml", + "tomls/omnibus-base-sepolia-andromeda/collaterals/synth-stata-usdc.toml", + "tomls/omnibus-base-sepolia-andromeda/collaterals/synth-cbbtc.toml", + "tomls/omnibus-base-sepolia-andromeda/collaterals/synth-cbeth.toml", + "tomls/omnibus-base-sepolia-andromeda/collaterals/synth-wsteth.toml", + "tomls/omnibus-base-sepolia-andromeda/collaterals/synth-weth.toml", # Spot Markets "tomls/omnibus-base-sepolia-andromeda/spot/USDC.toml", "tomls/omnibus-base-sepolia-andromeda/spot/stataUSDC.toml", + "tomls/omnibus-base-sepolia-andromeda/spot/cbbtc.toml", + "tomls/omnibus-base-sepolia-andromeda/spot/cbeth.toml", + "tomls/omnibus-base-sepolia-andromeda/spot/wsteth.toml", + "tomls/omnibus-base-sepolia-andromeda/spot/weth.toml", - # stataUSDC - "tomls/omnibus-base-sepolia-andromeda/oracles/stataUSDC-USDC.toml", + # Perps Liquidation rewards + "tomls/omnibus-base-sepolia-andromeda/rewards/snx_rewards_for_sc_pool.toml", + "tomls/omnibus-base-sepolia-andromeda/rewards/usdc_rewards_for_sc_pool.toml", + "tomls/omnibus-base-sepolia-andromeda/rewards/scbbtc_perps_liquidations_rewards.toml", + "tomls/omnibus-base-sepolia-andromeda/rewards/scbeth_perps_liquidations_rewards.toml", + "tomls/omnibus-base-sepolia-andromeda/rewards/swsteth_perps_liquidations_rewards.toml", + "tomls/omnibus-base-sepolia-andromeda/rewards/sweth_perps_liquidations_rewards.toml", # Pyth oracles "tomls/omnibus-base-sepolia-andromeda/oracles/pyth-aave.toml", @@ -43,6 +56,8 @@ include = [ "tomls/omnibus-base-sepolia-andromeda/oracles/pyth-bome.toml", "tomls/omnibus-base-sepolia-andromeda/oracles/pyth-bonk.toml", "tomls/omnibus-base-sepolia-andromeda/oracles/pyth-btc.toml", + "tomls/omnibus-base-sepolia-andromeda/oracles/pyth-cbbtc.toml", + "tomls/omnibus-base-sepolia-andromeda/oracles/pyth-cbeth.toml", "tomls/omnibus-base-sepolia-andromeda/oracles/pyth-comp.toml", "tomls/omnibus-base-sepolia-andromeda/oracles/pyth-crv.toml", "tomls/omnibus-base-sepolia-andromeda/oracles/pyth-doge.toml", @@ -105,10 +120,12 @@ include = [ "tomls/omnibus-base-sepolia-andromeda/oracles/pyth-w.toml", "tomls/omnibus-base-sepolia-andromeda/oracles/pyth-wif.toml", "tomls/omnibus-base-sepolia-andromeda/oracles/pyth-wld.toml", + "tomls/omnibus-base-sepolia-andromeda/oracles/pyth-wsteth.toml", "tomls/omnibus-base-sepolia-andromeda/oracles/pyth-xlm.toml", "tomls/omnibus-base-sepolia-andromeda/oracles/pyth-xrp.toml", "tomls/omnibus-base-sepolia-andromeda/oracles/pyth-yfi.toml", "tomls/omnibus-base-sepolia-andromeda/oracles/pyth-zro.toml", + "tomls/omnibus-base-sepolia-andromeda/oracles/stataUSDC-USDC.toml", # # Perps @@ -116,6 +133,7 @@ include = [ # Margin Collateral "tomls/omnibus-base-sepolia-andromeda/perps/collaterals/usd.toml", + "tomls/omnibus-base-sepolia-andromeda/perps/collaterals/cbbtc.toml", # Perps Settings "tomls/omnibus-base-sepolia-andromeda/perps/perps-keeper-cost.toml", @@ -209,6 +227,13 @@ include = [ "tomls/omnibus-base-sepolia-andromeda/perps/markets/xrp.toml", "tomls/omnibus-base-sepolia-andromeda/perps/markets/yfi.toml", "tomls/omnibus-base-sepolia-andromeda/perps/markets/zro.toml", + + # Margin Collateral (Synths) + "tomls/omnibus-base-sepolia-andromeda/perps/collaterals/cbbtc.toml", + "tomls/omnibus-base-sepolia-andromeda/perps/collaterals/cbeth.toml", + "tomls/omnibus-base-sepolia-andromeda/perps/collaterals/wsteth.toml", + "tomls/omnibus-base-sepolia-andromeda/perps/collaterals/weth.toml", + ] [setting.snx_package] @@ -294,6 +319,15 @@ defaultValue = "2" [setting.settlement_reward] defaultValue = "<%= parseEther('1') %>" +[setting.settlement_minimum_usd_exchange_amount] +defaultValue = "<%= parseEther('0.000001') %>" + +[setting.settlement_max_rounding_loss] +defaultValue = "<%= parseEther('0.000001') %>" + +[setting.price_deviation_tolerance] +defaultValue = "<%= parseEther('1') %>" + [setting.pool_owner] defaultValue = "0x48914229deDd5A9922f44441ffCCfC2Cb7856Ee9" @@ -301,6 +335,40 @@ defaultValue = "0x48914229deDd5A9922f44441ffCCfC2Cb7856Ee9" defaultValue = "<%= imports.erc_4626_to_assets_ratio_oracle.imports.statausdc_token_mock.contracts.Token.address %>" description = "We use the mock generated by erc-4626-to-assets-ratio-oracle package in statausdc-usdc.toml" +[provision.cbbtc_mock_collateral] +source = "mintable-token:1.8" +target = "synthetix-mock-tokens:1.8@cbbtc" +options.name = "Fake Coinbase Bitcoin" +options.symbol = "cbBTC" +options.owner = "<%= settings.owner %>" +options.decimals = "18" + +[provision.cbeth_mock_collateral] +source = "mintable-token:1.8" +target = "synthetix-mock-tokens:1.8@cbeth" +options.name = "Fake Coinbase Wrapped Staked ETH" +options.symbol = "cbETH" +options.owner = "<%= settings.owner %>" +options.decimals = "18" + +[provision.wsteth_mock_collateral] +source = "mintable-token:1.8" +target = "synthetix-mock-tokens:1.8@wsteth" +options.name = "Fake Lido Wrapped Staked Eth" +options.symbol = "wstETH" +options.owner = "<%= settings.owner %>" +options.decimals = "18" + +[var.token_addresses] +cbbtc_address = "<%= imports.cbbtc_mock_collateral.contracts.MintableToken.address %>" +cbeth_address = "<%= imports.cbeth_mock_collateral.contracts.MintableToken.address %>" +wsteth_address = "<%= imports.wsteth_mock_collateral.contracts.MintableToken.address %>" +weth_address = "0x4200000000000000000000000000000000000006" + +[setting.pyth_feed_url] +defaultValue = "https://api.synthetix.io/pyth-mainnet/api/get_vaa_ccip?data={data}" +description = "Pyth settlement strategy config" + [var.pyth_feeds] description = "https://pyth.network/developers/price-feed-ids#pyth-evm-mainnet" pyth_feed_id_aave = "0x2b9ab1e972a281585084148ba1389800799bd4be63b957507db1349314e47445" @@ -320,6 +388,8 @@ pyth_feed_id_bnb = "0x2f95862b045670cd22bee3114c39763a4a08beeb663b145d283c31d7d1 pyth_feed_id_bome = "0x30e4780570973e438fdb3f1b7ad22618b2fc7333b65c7853a7ca144c39052f7a" pyth_feed_id_bonk = "0x72b021217ca3fe68922a19aaf990109cb9d84e9ad004b4d2025ad6f529314419" pyth_feed_id_btc = "0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43" +pyth_feed_id_cbbtc = "0x2817d7bfe5c64b8ea956e9a26f573ef64e72e4d7891f2d6af9bcc93f7aff9a97" +pyth_feed_id_cbeth = "0x15ecddd26d49e1a8f1de9376ebebc03916ede873447c1255d2d5891b92ce5717" pyth_feed_id_comp = "0x4a8e42861cabc5ecb50996f92e7cfa2bce3fd0a2423b0c44c9b423fb2bd25478" pyth_feed_id_crv = "0xa19d04ac696c7a6616d291c7e5d1377cc8be437c327b75adb5dc1bad745fcae8" pyth_feed_id_doge = "0xdcef50dd0a4cd2dcc17e45df1676dcb336a11a61c69df7a0299b0150c672d25c" @@ -379,8 +449,10 @@ pyth_feed_id_ton = "0x8963217838ab4cf5cadc172203c1f0b763fbaa45f346d8ee50ba994bbc pyth_feed_id_trx = "0x67aed5a24fdad045475e7195c98a98aea119c763f272d4523f5bac93a4f33c2b" pyth_feed_id_uni = "0x78d185a741d07edb3412b09008b7c5cfb9bbbd7d568bf00ba737b456ba171501" pyth_feed_id_w = "0xeff7446475e218517566ea99e72a4abec2e1bd8498b43b7d8331e29dcb059389" +pyth_feed_id_weth = "0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace" pyth_feed_id_wif = "0x4ca4beeca86f0d164160323817a4e42b10010a724c2217c6ee41b54cd4cc61fc" pyth_feed_id_wld = "0xd6835ad1f773de4a378115eb6824bd0c0e42d84d1c84d9750e853fb6b6c7794a" +pyth_feed_id_wsteth = "0x6df640f3b8963d8f8358f791f352b8364513f6ab1cca5ed3f1f7b5448980e784" pyth_feed_id_xlm = "0xb7a8eba68a997cd0210c2e1e4ee811ad2d174b3611c22d9ebf16f4cb7e9ba850" pyth_feed_id_xrp = "0xec5d399846a9209f3fe5881d70aae9268c94339ff9817e8d18ff19fa05eea1c8" pyth_feed_id_yfi = "0x425f4b198ab2504936886c1e93511bb6720fbcf2045a4f3c0723bb213846022f" diff --git a/tomls/omnibus-base-sepolia-andromeda/collaterals/cbbtc.toml b/tomls/omnibus-base-sepolia-andromeda/collaterals/cbbtc.toml new file mode 100644 index 000000000..70a6edea8 --- /dev/null +++ b/tomls/omnibus-base-sepolia-andromeda/collaterals/cbbtc.toml @@ -0,0 +1,31 @@ +[var.cbbtc_synth_config] +cbbtc_issuance_ratio = "<%= parseEther('10') %>" +cbbtc_liquidation_ratio = "<%= parseEther('1.5') %>" +cbbtc_liquidation_reward = "<%= parseEther('0.0001') %>" +cbbtc_min_delegation = "<%= parseEther('0.1') %>" +cbbtc_max_collateral_limit = "<%= parseEther('100') %>" + +[invoke.CoreProxy_configureCollateral_cbbtc] +target = ["system.CoreProxy"] +fromCall.func = "owner" +func = "configureCollateral" # "args" see below in the multiline block + +[[invoke.CoreProxy_configureCollateral_cbbtc.args]] +tokenAddress = "<%= settings.cbbtc_address %>" +oracleNodeId = "<%= extras.cbbtc_oracle_id %>" +issuanceRatioD18 = "<%= settings.cbbtc_issuance_ratio %>" +liquidationRatioD18 = "<%= settings.cbbtc_liquidation_ratio %>" +liquidationRewardD18 = "<%= settings.cbbtc_liquidation_reward %>" +minDelegationD18 = "<%= settings.cbbtc_min_delegation %>" +depositingEnabled = false + +[invoke.CoreProxy_setPoolCollateralConfiguration_cbbtc] +target = ["system.CoreProxy"] +fromCall.func = "getPoolOwner" +fromCall.args = ["<%= settings.sc_pool_id %>"] +func = "setPoolCollateralConfiguration" +args = [ + "<%= settings.sc_pool_id %>", + "<%= settings.cbbtc_address %>", + { collateralLimitD18 = "<%= settings.cbbtc_max_collateral_limit %>", issuanceRatioD18 = 0 }, +] diff --git a/tomls/omnibus-base-sepolia-andromeda/collaterals/cbeth.toml b/tomls/omnibus-base-sepolia-andromeda/collaterals/cbeth.toml new file mode 100644 index 000000000..3f4e889fb --- /dev/null +++ b/tomls/omnibus-base-sepolia-andromeda/collaterals/cbeth.toml @@ -0,0 +1,31 @@ +[var.cbeth_synth_config] +cbeth_issuance_ratio = "<%= parseEther('2') %>" +cbeth_liquidation_ratio = "<%= parseEther('1.1') %>" +cbeth_liquidation_reward = "<%= parseEther('0.0001') %>" +cbeth_min_delegation = "<%= parseEther('0.1') %>" +cbeth_max_collateral_limit = "<%= parseEther('1750') %>" + +[invoke.CoreProxy_configureCollateral_cbeth] +target = ["system.CoreProxy"] +fromCall.func = "owner" +func = "configureCollateral" # "args" see below in the multiline block + +[[invoke.CoreProxy_configureCollateral_cbeth.args]] +tokenAddress = "<%= settings.cbeth_address %>" +oracleNodeId = "<%= extras.cbeth_oracle_id %>" +issuanceRatioD18 = "<%= settings.cbeth_issuance_ratio %>" +liquidationRatioD18 = "<%= settings.cbeth_liquidation_ratio %>" +liquidationRewardD18 = "<%= settings.cbeth_liquidation_reward %>" +minDelegationD18 = "<%= settings.cbeth_min_delegation %>" +depositingEnabled = false + +[invoke.CoreProxy_setPoolCollateralConfiguration_cbeth] +target = ["system.CoreProxy"] +fromCall.func = "getPoolOwner" +fromCall.args = ["<%= settings.sc_pool_id %>"] +func = "setPoolCollateralConfiguration" +args = [ + "<%= settings.sc_pool_id %>", + "<%= settings.cbeth_address %>", + { collateralLimitD18 = "<%= settings.cbeth_max_collateral_limit %>", issuanceRatioD18 = 0 }, +] diff --git a/tomls/omnibus-base-sepolia-andromeda/collaterals/synth-cbbtc.toml b/tomls/omnibus-base-sepolia-andromeda/collaterals/synth-cbbtc.toml new file mode 100644 index 000000000..6d1bf80f2 --- /dev/null +++ b/tomls/omnibus-base-sepolia-andromeda/collaterals/synth-cbbtc.toml @@ -0,0 +1,19 @@ +[var.scbbtc_synth_config] +scbbtc_issuance_ratio = "<%= parseEther('2') %>" +scbbtc_liquidation_ratio = "<%= parseEther('1.1') %>" +scbbtc_liquidation_reward = "<%= parseEther('0.0001') %>" +scbbtc_min_delegation = "<%= parseEther('0.1') %>" + +[invoke.configure_scbbtc_collateral] +target = ["system.CoreProxy"] +fromCall.func = "owner" +func = "configureCollateral" # "args" see below in the multiline block + +[[invoke.configure_scbbtc_collateral.args]] +tokenAddress = "<%= extras.synth_cbbtc_token_address %>" +oracleNodeId = "<%= extras.cbbtc_oracle_id %>" +issuanceRatioD18 = "<%= settings.scbbtc_issuance_ratio %>" +liquidationRatioD18 = "<%= settings.scbbtc_liquidation_ratio %>" +liquidationRewardD18 = "<%= settings.scbbtc_liquidation_reward %>" +minDelegationD18 = "<%= settings.scbbtc_min_delegation %>" +depositingEnabled = false diff --git a/tomls/omnibus-base-sepolia-andromeda/collaterals/synth-cbeth.toml b/tomls/omnibus-base-sepolia-andromeda/collaterals/synth-cbeth.toml new file mode 100644 index 000000000..e56494a63 --- /dev/null +++ b/tomls/omnibus-base-sepolia-andromeda/collaterals/synth-cbeth.toml @@ -0,0 +1,19 @@ +[var.scbeth_synth_config] +scbeth_issuance_ratio = "<%= parseEther('2') %>" +scbeth_liquidation_ratio = "<%= parseEther('1.1') %>" +scbeth_liquidation_reward = "<%= parseEther('0.0001') %>" +scbeth_min_delegation = "<%= parseEther('0.1') %>" + +[invoke.configure_scbeth_collateral] +target = ["system.CoreProxy"] +fromCall.func = "owner" +func = "configureCollateral" # "args" see below in the multiline block + +[[invoke.configure_scbeth_collateral.args]] +tokenAddress = "<%= extras.synth_cbeth_token_address %>" +oracleNodeId = "<%= extras.cbeth_oracle_id %>" +issuanceRatioD18 = "<%= settings.scbeth_issuance_ratio %>" +liquidationRatioD18 = "<%= settings.scbeth_liquidation_ratio %>" +liquidationRewardD18 = "<%= settings.scbeth_liquidation_reward %>" +minDelegationD18 = "<%= settings.scbeth_min_delegation %>" +depositingEnabled = false diff --git a/tomls/omnibus-base-sepolia-andromeda/collaterals/sstataUSDC.toml b/tomls/omnibus-base-sepolia-andromeda/collaterals/synth-stata-usdc.toml similarity index 67% rename from tomls/omnibus-base-sepolia-andromeda/collaterals/sstataUSDC.toml rename to tomls/omnibus-base-sepolia-andromeda/collaterals/synth-stata-usdc.toml index 4ee54cae0..6fd37e08a 100644 --- a/tomls/omnibus-base-sepolia-andromeda/collaterals/sstataUSDC.toml +++ b/tomls/omnibus-base-sepolia-andromeda/collaterals/synth-stata-usdc.toml @@ -1,14 +1,8 @@ -[setting.sstatausdc_issuance_ratio] -defaultValue = "<%= MaxUint256 %>" - -[setting.sstatausdc_liquidation_ratio] -defaultValue = "<%= parseEther('1.1') %>" - -[setting.sstatausdc_liquidation_reward] -defaultValue = "<%= parseEther('1') %>" - -[setting.sstatausdc_min_delegation] -defaultValue = "<%= parseEther('100') %>" +[var.sstatausdc_synth_config] +sstatausdc_issuance_ratio = "<%= MaxUint256 %>" +sstatausdc_liquidation_ratio = "<%= parseEther('1.1') %>" +sstatausdc_liquidation_reward = "<%= parseEther('1') %>" +sstatausdc_min_delegation = "<%= parseEther('100') %>" [invoke.configure_sstatausdc_collateral] target = ["system.CoreProxy"] diff --git a/tomls/omnibus-base-sepolia-andromeda/collaterals/sUSDC.toml b/tomls/omnibus-base-sepolia-andromeda/collaterals/synth-usdc.toml similarity index 67% rename from tomls/omnibus-base-sepolia-andromeda/collaterals/sUSDC.toml rename to tomls/omnibus-base-sepolia-andromeda/collaterals/synth-usdc.toml index e2cc278ae..5993f3833 100644 --- a/tomls/omnibus-base-sepolia-andromeda/collaterals/sUSDC.toml +++ b/tomls/omnibus-base-sepolia-andromeda/collaterals/synth-usdc.toml @@ -1,14 +1,8 @@ -[setting.susdc_issuance_ratio] -defaultValue = "<%= MaxUint256 %>" - -[setting.susdc_liquidation_ratio] -defaultValue = "<%= parseEther('1.005') %>" - -[setting.susdc_liquidation_reward] -defaultValue = "<%= parseEther('1') %>" - -[setting.susdc_min_delegation] -defaultValue = "<%= parseEther('100') %>" +[var.susdc_synth_config] +susdc_issuance_ratio = "<%= MaxUint256 %>" +susdc_liquidation_ratio = "<%= parseEther('1.005') %>" +susdc_liquidation_reward = "<%= parseEther('1') %>" +susdc_min_delegation = "<%= parseEther('100') %>" [invoke.configure_susdc_collateral] target = ["system.CoreProxy"] diff --git a/tomls/omnibus-base-sepolia-andromeda/collaterals/synth-weth.toml b/tomls/omnibus-base-sepolia-andromeda/collaterals/synth-weth.toml new file mode 100644 index 000000000..aa6fca5da --- /dev/null +++ b/tomls/omnibus-base-sepolia-andromeda/collaterals/synth-weth.toml @@ -0,0 +1,19 @@ +[var.sweth_synth_config] +sweth_issuance_ratio = "<%= parseEther('2') %>" +sweth_liquidation_ratio = "<%= parseEther('1.1') %>" +sweth_liquidation_reward = "<%= parseEther('0.0001') %>" +sweth_min_delegation = "<%= parseEther('0.1') %>" + +[invoke.configure_sweth_collateral] +target = ["system.CoreProxy"] +fromCall.func = "owner" +func = "configureCollateral" # "args" see below in the multiline block + +[[invoke.configure_sweth_collateral.args]] +tokenAddress = "<%= extras.synth_weth_token_address %>" +oracleNodeId = "<%= extras.eth_oracle_id %>" +issuanceRatioD18 = "<%= settings.sweth_issuance_ratio %>" +liquidationRatioD18 = "<%= settings.sweth_liquidation_ratio %>" +liquidationRewardD18 = "<%= settings.sweth_liquidation_reward %>" +minDelegationD18 = "<%= settings.sweth_min_delegation %>" +depositingEnabled = false diff --git a/tomls/omnibus-base-sepolia-andromeda/collaterals/synth-wsteth.toml b/tomls/omnibus-base-sepolia-andromeda/collaterals/synth-wsteth.toml new file mode 100644 index 000000000..6d28ff055 --- /dev/null +++ b/tomls/omnibus-base-sepolia-andromeda/collaterals/synth-wsteth.toml @@ -0,0 +1,19 @@ +[var.swsteth_synth_config] +swsteth_issuance_ratio = "<%= parseEther('2') %>" +swsteth_liquidation_ratio = "<%= parseEther('1.1') %>" +swsteth_liquidation_reward = "<%= parseEther('0.0001') %>" +swsteth_min_delegation = "<%= parseEther('0.1') %>" + +[invoke.configure_swsteth_collateral] +target = ["system.CoreProxy"] +fromCall.func = "owner" +func = "configureCollateral" # "args" see below in the multiline block + +[[invoke.configure_swsteth_collateral.args]] +tokenAddress = "<%= extras.synth_wsteth_token_address %>" +oracleNodeId = "<%= extras.wsteth_oracle_id %>" +issuanceRatioD18 = "<%= settings.swsteth_issuance_ratio %>" +liquidationRatioD18 = "<%= settings.swsteth_liquidation_ratio %>" +liquidationRewardD18 = "<%= settings.swsteth_liquidation_reward %>" +minDelegationD18 = "<%= settings.swsteth_min_delegation %>" +depositingEnabled = false diff --git a/tomls/omnibus-base-sepolia-andromeda/collaterals/weth.toml b/tomls/omnibus-base-sepolia-andromeda/collaterals/weth.toml new file mode 100644 index 000000000..1409e0108 --- /dev/null +++ b/tomls/omnibus-base-sepolia-andromeda/collaterals/weth.toml @@ -0,0 +1,31 @@ +[var.weth_synth_config] +weth_issuance_ratio = "<%= parseEther('2') %>" +weth_liquidation_ratio = "<%= parseEther('1.1') %>" +weth_liquidation_reward = "<%= parseEther('0.0001') %>" +weth_min_delegation = "<%= parseEther('0.1') %>" +weth_max_collateral_limit = "<%= parseEther('1750') %>" + +[invoke.CoreProxy_configureCollateral_weth] +target = ["system.CoreProxy"] +fromCall.func = "owner" +func = "configureCollateral" # "args" see below in the multiline block + +[[invoke.CoreProxy_configureCollateral_weth.args]] +tokenAddress = "<%= settings.weth_address %>" +oracleNodeId = "<%= extras.eth_oracle_id %>" +issuanceRatioD18 = "<%= settings.weth_issuance_ratio %>" +liquidationRatioD18 = "<%= settings.weth_liquidation_ratio %>" +liquidationRewardD18 = "<%= settings.weth_liquidation_reward %>" +minDelegationD18 = "<%= settings.weth_min_delegation %>" +depositingEnabled = false + +[invoke.CoreProxy_setPoolCollateralConfiguration_weth] +target = ["system.CoreProxy"] +fromCall.func = "getPoolOwner" +fromCall.args = ["<%= settings.sc_pool_id %>"] +func = "setPoolCollateralConfiguration" +args = [ + "<%= settings.sc_pool_id %>", + "<%= settings.weth_address %>", + { collateralLimitD18 = "<%= settings.weth_max_collateral_limit %>", issuanceRatioD18 = 0 }, +] diff --git a/tomls/omnibus-base-sepolia-andromeda/collaterals/wsteth.toml b/tomls/omnibus-base-sepolia-andromeda/collaterals/wsteth.toml new file mode 100644 index 000000000..f9fa52108 --- /dev/null +++ b/tomls/omnibus-base-sepolia-andromeda/collaterals/wsteth.toml @@ -0,0 +1,31 @@ +[var.wsteth_synth_config] +wsteth_issuance_ratio = "<%= parseEther('2') %>" +wsteth_liquidation_ratio = "<%= parseEther('1.1') %>" +wsteth_liquidation_reward = "<%= parseEther('0.0001') %>" +wsteth_min_delegation = "<%= parseEther('0.1') %>" +wsteth_max_collateral_limit = "<%= parseEther('1750') %>" + +[invoke.CoreProxy_configureCollateral_wsteth] +target = ["system.CoreProxy"] +fromCall.func = "owner" +func = "configureCollateral" # "args" see below in the multiline block + +[[invoke.CoreProxy_configureCollateral_wsteth.args]] +tokenAddress = "<%= settings.wsteth_address %>" +oracleNodeId = "<%= extras.wsteth_oracle_id %>" +issuanceRatioD18 = "<%= settings.wsteth_issuance_ratio %>" +liquidationRatioD18 = "<%= settings.wsteth_liquidation_ratio %>" +liquidationRewardD18 = "<%= settings.wsteth_liquidation_reward %>" +minDelegationD18 = "<%= settings.wsteth_min_delegation %>" +depositingEnabled = false + +[invoke.CoreProxy_setPoolCollateralConfiguration_wsteth] +target = ["system.CoreProxy"] +fromCall.func = "getPoolOwner" +fromCall.args = ["<%= settings.sc_pool_id %>"] +func = "setPoolCollateralConfiguration" +args = [ + "<%= settings.sc_pool_id %>", + "<%= settings.wsteth_address %>", + { collateralLimitD18 = "<%= settings.wsteth_max_collateral_limit %>", issuanceRatioD18 = 0 }, +] diff --git a/tomls/omnibus-base-sepolia-andromeda/oracles/pyth-cbbtc.toml b/tomls/omnibus-base-sepolia-andromeda/oracles/pyth-cbbtc.toml new file mode 100644 index 000000000..68c4c9f98 --- /dev/null +++ b/tomls/omnibus-base-sepolia-andromeda/oracles/pyth-cbbtc.toml @@ -0,0 +1,39 @@ +# This registers a staleness node that looks to Pyth for a fresh enough price, or otherwise reverts with an ERC-7412 compatible error +# Latest Pyth Price +[invoke.registerPythCbbtcOracleNode] +target = ["system.oracle_manager.Proxy"] +func = "registerNode" +args = [ + 5, # 5 = pyth aggregator type + "<%= defaultAbiCoder.encode(['address', 'bytes32', 'bool'], [settings.pyth_price_verification_address, settings.pyth_feed_id_cbbtc, false]) %>", + [ + ], +] +extra.cbbtc_pyth_oracle_id.event = "NodeRegistered" +extra.cbbtc_pyth_oracle_id.arg = 0 +# Pyth Off-chain Lookup +[invoke.registerLookupCbbtcOracleNode] +target = ["system.oracle_manager.Proxy"] +func = "registerNode" +args = [ + 9, # 9 = PythOffchainLookupNode + "<%= defaultAbiCoder.encode(['address', 'bytes32', 'uint256'], [imports.pyth_erc7412_wrapper.contracts.PythERC7412Wrapper.address, settings.pyth_feed_id_cbbtc, settings.default_staleness_tolerance]) %>", + [ + ], +] +extra.cbbtc_lookup_oracle_id.event = "NodeRegistered" +extra.cbbtc_lookup_oracle_id.arg = 0 +# Staleness Node +[invoke.registerCbbtcOracleNode] +target = ["system.oracle_manager.Proxy"] +func = "registerNode" +args = [ + 7, # 7 = staleness circuit breaker + "<%= defaultAbiCoder.encode(['uint256'], [settings.default_staleness_tolerance]) %>", + [ + "<%= extras.cbbtc_pyth_oracle_id %>", + "<%= extras.cbbtc_lookup_oracle_id %>", + ], +] +extra.cbbtc_oracle_id.event = "NodeRegistered" +extra.cbbtc_oracle_id.arg = 0 diff --git a/tomls/omnibus-base-sepolia-andromeda/oracles/pyth-cbeth.toml b/tomls/omnibus-base-sepolia-andromeda/oracles/pyth-cbeth.toml new file mode 100644 index 000000000..ec616da7b --- /dev/null +++ b/tomls/omnibus-base-sepolia-andromeda/oracles/pyth-cbeth.toml @@ -0,0 +1,39 @@ +# This registers a staleness node that looks to Pyth for a fresh enough price, or otherwise reverts with an ERC-7412 compatible error +# Latest Pyth Price +[invoke.registerPythCbethOracleNode] +target = ["system.oracle_manager.Proxy"] +func = "registerNode" +args = [ + 5, # 5 = pyth aggregator type + "<%= defaultAbiCoder.encode(['address', 'bytes32', 'bool'], [settings.pyth_price_verification_address, settings.pyth_feed_id_cbeth, false]) %>", + [ + ], +] +extra.cbeth_pyth_oracle_id.event = "NodeRegistered" +extra.cbeth_pyth_oracle_id.arg = 0 +# Pyth Off-chain Lookup +[invoke.registerLookupCbethOracleNode] +target = ["system.oracle_manager.Proxy"] +func = "registerNode" +args = [ + 9, # 9 = PythOffchainLookupNode + "<%= defaultAbiCoder.encode(['address', 'bytes32', 'uint256'], [imports.pyth_erc7412_wrapper.contracts.PythERC7412Wrapper.address, settings.pyth_feed_id_cbeth, settings.default_staleness_tolerance]) %>", + [ + ], +] +extra.cbeth_lookup_oracle_id.event = "NodeRegistered" +extra.cbeth_lookup_oracle_id.arg = 0 +# Staleness Node +[invoke.registerCbethOracleNode] +target = ["system.oracle_manager.Proxy"] +func = "registerNode" +args = [ + 7, # 7 = staleness circuit breaker + "<%= defaultAbiCoder.encode(['uint256'], [settings.default_staleness_tolerance]) %>", + [ + "<%= extras.cbeth_pyth_oracle_id %>", + "<%= extras.cbeth_lookup_oracle_id %>", + ], +] +extra.cbeth_oracle_id.event = "NodeRegistered" +extra.cbeth_oracle_id.arg = 0 diff --git a/tomls/omnibus-base-sepolia-andromeda/oracles/pyth-wsteth.toml b/tomls/omnibus-base-sepolia-andromeda/oracles/pyth-wsteth.toml index d59585977..6d8456baa 100644 --- a/tomls/omnibus-base-sepolia-andromeda/oracles/pyth-wsteth.toml +++ b/tomls/omnibus-base-sepolia-andromeda/oracles/pyth-wsteth.toml @@ -1,15 +1,11 @@ # This registers a staleness node that looks to Pyth for a fresh enough price, or otherwise reverts with an ERC-7412 compatible error - -[setting.pythWstEthFeedId] -defaultValue = '0x6df640f3b8963d8f8358f791f352b8364513f6ab1cca5ed3f1f7b5448980e784' - # Latest Pyth Price [invoke.registerPythWstEthOracleNode] target = ["system.oracle_manager.Proxy"] func = "registerNode" args = [ 5, # 5 = pyth aggregator type - "<%= defaultAbiCoder.encode(['address', 'bytes32', 'bool'], [settings.pyth_price_verification_address, settings.pythWstEthFeedId, false]) %>", + "<%= defaultAbiCoder.encode(['address', 'bytes32', 'bool'], [settings.pyth_price_verification_address, settings.pyth_feed_id_wsteth, false]) %>", [ ], ] @@ -21,7 +17,7 @@ target = ["system.oracle_manager.Proxy"] func = "registerNode" args = [ 9, # 9 = PythOffchainLookupNode - "<%= defaultAbiCoder.encode(['address', 'bytes32', 'uint256'], [imports.pyth_erc7412_wrapper.contracts.PythERC7412Wrapper.address, settings.pythWstEthFeedId, settings.default_staleness_tolerance]) %>", + "<%= defaultAbiCoder.encode(['address', 'bytes32', 'uint256'], [imports.pyth_erc7412_wrapper.contracts.PythERC7412Wrapper.address, settings.pyth_feed_id_wsteth, settings.default_staleness_tolerance]) %>", [ ], ] diff --git a/tomls/omnibus-base-sepolia-andromeda/perps/collaterals/cbbtc.toml b/tomls/omnibus-base-sepolia-andromeda/perps/collaterals/cbbtc.toml new file mode 100644 index 000000000..e27b493fe --- /dev/null +++ b/tomls/omnibus-base-sepolia-andromeda/perps/collaterals/cbbtc.toml @@ -0,0 +1,27 @@ +[var.perps_collateral_synth_cbbtc_settings] +synth_cbbtc_upper_limit_discount = "<%= parseEther('0.075') %>" +synth_cbbtc_lower_limit_discount = "<%= parseEther('0.010') %>" +synth_cbbtc_discount_scalar = "<%= parseEther('1') %>" + +[invoke.PerpsMarketProxy_setCollateralConfiguration_synth_cbbtc] +target = ["perpsFactory.PerpsMarketProxy"] +fromCall.func = "owner" +func = "setCollateralConfiguration" +args = [ + "<%= extras.synth_cbbtc_market_id %>", + "<%= settings.synth_cbbtc_max_collateral_amount %>", + "<%= settings.synth_cbbtc_upper_limit_discount %>", + "<%= settings.synth_cbbtc_lower_limit_discount %>", + "<%= settings.synth_cbbtc_discount_scalar %>", +] + +[invoke.CoreProxy_configureMaximumMarketCollateral_Perps_synth_cbbtc] +target = ["system.CoreProxy"] +fromCall.func = "owner" +fromCall.args = [] +func = "configureMaximumMarketCollateral" +args = [ + "<%= imports.perpsFactory.extras.superMarketId %>", + "<%= extras.synth_cbbtc_token_address %>", + "<%= settings.synth_cbbtc_max_collateral_amount %>", +] diff --git a/tomls/omnibus-base-sepolia-andromeda/perps/collaterals/cbeth.toml b/tomls/omnibus-base-sepolia-andromeda/perps/collaterals/cbeth.toml new file mode 100644 index 000000000..e88c3816e --- /dev/null +++ b/tomls/omnibus-base-sepolia-andromeda/perps/collaterals/cbeth.toml @@ -0,0 +1,27 @@ +[var.perps_collateral_synth_cbeth_settings] +synth_cbeth_upper_limit_discount = "<%= parseEther('0.10') %>" +synth_cbeth_lower_limit_discount = "<%= parseEther('0.010') %>" +synth_cbeth_discount_scalar = "<%= parseEther('1') %>" + +[invoke.PerpsMarketProxy_setCollateralConfiguration_synth_cbeth] +target = ["perpsFactory.PerpsMarketProxy"] +fromCall.func = "owner" +func = "setCollateralConfiguration" +args = [ + "<%= extras.synth_cbeth_market_id %>", + "<%= settings.synth_cbeth_max_collateral_amount %>", + "<%= settings.synth_cbeth_upper_limit_discount %>", + "<%= settings.synth_cbeth_lower_limit_discount %>", + "<%= settings.synth_cbeth_discount_scalar %>", +] + +[invoke.CoreProxy_configureMaximumMarketCollateral_Perps_synth_cbeth] +target = ["system.CoreProxy"] +fromCall.func = "owner" +fromCall.args = [] +func = "configureMaximumMarketCollateral" +args = [ + "<%= imports.perpsFactory.extras.superMarketId %>", + "<%= extras.synth_cbeth_token_address %>", + "<%= settings.synth_cbeth_max_collateral_amount %>", +] diff --git a/tomls/omnibus-base-sepolia-andromeda/perps/collaterals/weth.toml b/tomls/omnibus-base-sepolia-andromeda/perps/collaterals/weth.toml new file mode 100644 index 000000000..99f7e2978 --- /dev/null +++ b/tomls/omnibus-base-sepolia-andromeda/perps/collaterals/weth.toml @@ -0,0 +1,27 @@ +[var.perps_collateral_synth_weth_settings] +synth_weth_upper_limit_discount = "<%= parseEther('0.10') %>" +synth_weth_lower_limit_discount = "<%= parseEther('0.010') %>" +synth_weth_discount_scalar = "<%= parseEther('1') %>" + +[invoke.PerpsMarketProxy_setCollateralConfiguration_synth_weth] +target = ["perpsFactory.PerpsMarketProxy"] +fromCall.func = "owner" +func = "setCollateralConfiguration" +args = [ + "<%= extras.synth_weth_market_id %>", + "<%= settings.synth_weth_max_collateral_amount %>", + "<%= settings.synth_weth_upper_limit_discount %>", + "<%= settings.synth_weth_lower_limit_discount %>", + "<%= settings.synth_weth_discount_scalar %>", +] + +[invoke.CoreProxy_configureMaximumMarketCollateral_Perps_synth_weth] +target = ["system.CoreProxy"] +fromCall.func = "owner" +fromCall.args = [] +func = "configureMaximumMarketCollateral" +args = [ + "<%= imports.perpsFactory.extras.superMarketId %>", + "<%= extras.synth_weth_token_address %>", + "<%= settings.synth_weth_max_collateral_amount %>", +] diff --git a/tomls/omnibus-base-sepolia-andromeda/perps/collaterals/wsteth.toml b/tomls/omnibus-base-sepolia-andromeda/perps/collaterals/wsteth.toml new file mode 100644 index 000000000..5250f833e --- /dev/null +++ b/tomls/omnibus-base-sepolia-andromeda/perps/collaterals/wsteth.toml @@ -0,0 +1,27 @@ +[var.perps_collateral_synth_wsteth_settings] +synth_wsteth_upper_limit_discount = "<%= parseEther('0.10') %>" +synth_wsteth_lower_limit_discount = "<%= parseEther('0.010') %>" +synth_wsteth_discount_scalar = "<%= parseEther('1') %>" + +[invoke.PerpsMarketProxy_setCollateralConfiguration_synth_wsteth] +target = ["perpsFactory.PerpsMarketProxy"] +fromCall.func = "owner" +func = "setCollateralConfiguration" +args = [ + "<%= extras.synth_wsteth_market_id %>", + "<%= settings.synth_wsteth_max_collateral_amount %>", + "<%= settings.synth_wsteth_upper_limit_discount %>", + "<%= settings.synth_wsteth_lower_limit_discount %>", + "<%= settings.synth_wsteth_discount_scalar %>", +] + +[invoke.CoreProxy_configureMaximumMarketCollateral_Perps_synth_wsteth] +target = ["system.CoreProxy"] +fromCall.func = "owner" +fromCall.args = [] +func = "configureMaximumMarketCollateral" +args = [ + "<%= imports.perpsFactory.extras.superMarketId %>", + "<%= extras.synth_wsteth_token_address %>", + "<%= settings.synth_wsteth_max_collateral_amount %>", +] diff --git a/tomls/omnibus-base-sepolia-andromeda/perps/global.toml b/tomls/omnibus-base-sepolia-andromeda/perps/global.toml index f7568d543..6466e751b 100644 --- a/tomls/omnibus-base-sepolia-andromeda/perps/global.toml +++ b/tomls/omnibus-base-sepolia-andromeda/perps/global.toml @@ -1,108 +1,53 @@ -[setting.settlementReward] -defaultValue = "1" - -[setting.perps_keeper_l1_cost_settle_gas_units] -defaultValue = "<%= String(23_000) %>" - -[setting.perps_keeper_l2_cost_settle_gas_units] -defaultValue = "<%= String(5_500_000) %>" - -[setting.perps_keeper_settle_tx_size] -defaultValue = "<%= String(5_000) %>" - -[setting.perps_keeper_l1_cost_flag_gas_units] -defaultValue = "<%= String(4_500) %>" - -[setting.perps_keeper_l2_cost_flag_gas_units] -defaultValue = "<%= String(450_000) %>" - -[setting.perps_keeper_flag_tx_size] -defaultValue = "<%= String(3_000) %>" - -[setting.perps_keeper_l1_cost_liquidate_gas_units] -defaultValue = "<%= String(26_600) %>" - -[setting.perps_keeper_l2_cost_liquidate_gas_units] -defaultValue = "<%= String(2_300_000) %>" - -[setting.perps_keeper_liquidate_tx_size] -defaultValue = "<%= String(5_050) %>" - -[setting.perps_liquidation_min_keeper_reward_usd] -defaultValue = "1" - -[setting.perps_liquidation_min_keeper_profit_ratio_d18] -defaultValue = "0.30" - -[setting.perps_liquidation_max_keeper_reward_usd] -defaultValue = "100" - -[setting.perps_liquidation_max_keeper_scaling_ratio_d18] -defaultValue = "0.3" - -[setting.perps_low_util_gradient] -defaultValue = "0.000025" - -[setting.perps_gradient_breakpoint] -defaultValue = "0.80" - -[setting.perps_high_util_gradient] -defaultValue = "0.01" - -[invoke.setPerpsLiquidationRewardGuards] +[var.perps_global_settings] +perps_liquidation_min_keeper_reward_usd = "<%= parseEther('1') %>" +perps_liquidation_min_keeper_profit_ratio_d18 = "<%= parseEther('0.30') %>" +perps_liquidation_max_keeper_reward_usd = "<%= parseEther('30') %>" +perps_liquidation_max_keeper_scaling_ratio_d18 = "<%= parseEther('0.3') %>" +perps_low_util_gradient = "<%= parseEther('0.000025') %>" +perps_gradient_breakpoint = "<%= parseEther('0.80') %>" +perps_high_util_gradient = "<%= parseEther('0.01') %>" +perps_collateral_liquidation_ratio = "<%= parseEther('0.0003') %>" +perps_max_positions_per_account = "10" +perps_max_collaterals_per_account = "3" + +[invoke.PerpsMarketProxy_setKeeperRewardGuards] target = ["perpsFactory.PerpsMarketProxy"] fromCall.func = "owner" func = "setKeeperRewardGuards" args = [ - "<%= parseEther(settings.perps_liquidation_min_keeper_reward_usd) %>", - "<%= parseEther(settings.perps_liquidation_min_keeper_profit_ratio_d18) %>", - "<%= parseEther(settings.perps_liquidation_max_keeper_reward_usd) %>", - "<%= parseEther(settings.perps_liquidation_max_keeper_scaling_ratio_d18) %>", + "<%= settings.perps_liquidation_min_keeper_reward_usd %>", + "<%= settings.perps_liquidation_min_keeper_profit_ratio_d18 %>", + "<%= settings.perps_liquidation_max_keeper_reward_usd %>", + "<%= settings.perps_liquidation_max_keeper_scaling_ratio_d18 %>", ] -depends = [ - 'provision.perpsFactory', - 'setting.perps_liquidation_min_keeper_reward_usd', - 'setting.perps_liquidation_min_keeper_profit_ratio_d18', - 'setting.perps_liquidation_max_keeper_reward_usd', - 'setting.perps_liquidation_max_keeper_scaling_ratio_d18', -] - -[invoke.setPerpsMaxCollateralForSnxUsd] -target = ["perpsFactory.PerpsMarketProxy"] -fromCall.func = "owner" -func = "setCollateralConfiguration" -args = ["0", "<%= MaxUint256 %>"] -[invoke.setPerpsSynthDeductionPriority] -target = ["perpsFactory.PerpsMarketProxy"] -fromCall.func = "owner" -func = "setSynthDeductionPriority" -args = [["0"]] - -[invoke.setPerAccountCapsPerps] +[invoke.PerpsMarketProxy_setPerAccountCaps] target = ["perpsFactory.PerpsMarketProxy"] fromCall.func = "owner" func = "setPerAccountCaps" -args = ["10", "1"] +args = [ + "<%= settings.perps_max_positions_per_account %>", + "<%= settings.perps_max_collaterals_per_account %>", +] -[invoke.setPerpsMarketKeeperCostNodeId] +[invoke.PerpsMarketProxy_updateKeeperCostNodeId] target = ["perpsFactory.PerpsMarketProxy"] fromCall.func = "owner" func = "updateKeeperCostNodeId" args = ["<%= extras.perps_keeper_cost_usd_oracle_id %>"] -[invoke.setInterestRateParams] +[invoke.PerpsMarketProxy_setInterestRateParameters] target = ["perpsFactory.PerpsMarketProxy"] fromCall.func = "owner" func = "setInterestRateParameters" args = [ - "<%= parseEther(settings.perps_low_util_gradient) %>", - "<%= parseEther(settings.perps_gradient_breakpoint) %>", - "<%= parseEther(settings.perps_high_util_gradient) %>", -] -depends = [ - 'provision.perpsFactory', - 'setting.perps_low_util_gradient', - 'setting.perps_gradient_breakpoint', - 'setting.perps_high_util_gradient', + "<%= settings.perps_low_util_gradient %>", + "<%= settings.perps_gradient_breakpoint %>", + "<%= settings.perps_high_util_gradient %>", ] + +[invoke.PerpsMarketProxy_setCollateralLiquidateRewardRatio] +target = ["perpsFactory.PerpsMarketProxy"] +fromCall.func = "owner" +func = "setCollateralLiquidateRewardRatio" +args = ["<%= settings.perps_collateral_liquidation_ratio %>"] diff --git a/tomls/omnibus-base-sepolia-andromeda/perps/perps-keeper-cost.toml b/tomls/omnibus-base-sepolia-andromeda/perps/perps-keeper-cost.toml index 602b92fc9..93a52562f 100644 --- a/tomls/omnibus-base-sepolia-andromeda/perps/perps-keeper-cost.toml +++ b/tomls/omnibus-base-sepolia-andromeda/perps/perps-keeper-cost.toml @@ -1,9 +1,20 @@ +[var.perps_keeper_settings] +perps_keeper_l1_cost_settle_gas_units = "<%= String(23_000) %>" +perps_keeper_l2_cost_settle_gas_units = "<%= String(5_500_000) %>" +perps_keeper_settle_tx_size = "<%= String(5_000) %>" +perps_keeper_l1_cost_flag_gas_units = "<%= String(4_500) %>" +perps_keeper_l2_cost_flag_gas_units = "<%= String(450_000) %>" +perps_keeper_flag_tx_size = "<%= String(3_000) %>" +perps_keeper_l1_cost_liquidate_gas_units = "<%= String(26_600) %>" +perps_keeper_l2_cost_liquidate_gas_units = "<%= String(2_300_000) %>" +perps_keeper_liquidate_tx_size = "<%= String(5_050) %>" + [provision.perps_gas_oracle_node] source = "<%= settings.perps_keeper_cost_package %>" targetPreset = "<%= settings.target_preset %>" options.salt = "<%= settings.salt %>" -[invoke.registerPerps_KeeperCostEthOracleNode] +[invoke.OracleManagerProxy_registerNode_keeper_cost_ETH] target = ["system.oracle_manager.Proxy"] func = "registerNode" args = [ @@ -16,21 +27,8 @@ args = [ ] extra.perps_keeper_cost_eth_oracle_id.event = "NodeRegistered" extra.perps_keeper_cost_eth_oracle_id.arg = 0 -depends = [ - 'provision.system', - 'provision.perps_gas_oracle_node', - 'setting.perps_keeper_l1_cost_settle_gas_units', - 'setting.perps_keeper_l2_cost_settle_gas_units', - 'setting.perps_keeper_l1_cost_flag_gas_units', - 'setting.perps_keeper_l2_cost_flag_gas_units', - 'setting.perps_keeper_l1_cost_liquidate_gas_units', - 'setting.perps_keeper_l2_cost_liquidate_gas_units', - 'setting.perps_keeper_settle_tx_size', - 'setting.perps_keeper_flag_tx_size', - 'setting.perps_keeper_liquidate_tx_size', -] -[invoke.registerPerps_KeeperCostUsdOracleNode] +[invoke.OracleManagerProxy_registerNode_keeper_cost_USD] target = ["system.oracle_manager.Proxy"] func = "registerNode" args = [ diff --git a/tomls/omnibus-base-sepolia-andromeda/rewards/scbbtc_perps_liquidations_rewards.toml b/tomls/omnibus-base-sepolia-andromeda/rewards/scbbtc_perps_liquidations_rewards.toml new file mode 100644 index 000000000..d42b844d4 --- /dev/null +++ b/tomls/omnibus-base-sepolia-andromeda/rewards/scbbtc_perps_liquidations_rewards.toml @@ -0,0 +1,46 @@ +[provision.RewardsDistributor_scbbtc_liquidation_rewards] +source = "synthetix-rewards-dist-ext:3.6.0" +target = "synthetix-rewards-dist-ext:3.6.0@perps-scbbtc" +options.salt = "<%= settings.salt %>-perps-scbbtc" +options.rewardManager = "<%= imports.system.contracts.CoreProxy.address %>" +options.poolId = "<%= settings.sc_pool_id %>" +options.payoutToken = "<%= extras.synth_cbbtc_token_address %>" +options.payoutTokenDecimals = "18" +options.name = "Perps Coinbase Wrapped Bitcoin Liquidation Rewards" +options.authorizedDistributor = "<%= imports.perpsFactory.contracts.PerpsMarketProxy.address %>" + +[invoke.PerpsMarketProxy_registerDistributor_synth_cbbtc_liquidations] +target = ["perpsFactory.PerpsMarketProxy"] +fromCall.func = "owner" +func = "registerDistributor" +args = [ + "<%= extras.synth_cbbtc_token_address %>", + "<%= imports.RewardsDistributor_scbbtc_liquidation_rewards.contracts.RewardsDistributorExternal.address %>", + "<%= extras.synth_cbbtc_market_id %>", + [ + "<%= extras.synth_usdc_token_address %>", + "<%= settings.synth_stata_usdc_token_address %>", + ], +] + +[invoke.CoreProxy_registerRewardsDistributor_scbbtc_liquidation_rewards_for_SpartanCouncilPool_usdc_lp] +target = ["system.CoreProxy"] +fromCall.func = "getPoolOwner" +fromCall.args = ["<%= settings.sc_pool_id %>"] +func = "registerRewardsDistributor" +args = [ + "<%= settings.sc_pool_id %>", + "<%= extras.synth_usdc_token_address %>", + "<%= imports.RewardsDistributor_scbbtc_liquidation_rewards.contracts.RewardsDistributorExternal.address %>", +] + +[invoke.CoreProxy_registerRewardsDistributor_scbbtc_liquidation_rewards_for_SpartanCouncilPool_stata_usdc_lp] +target = ["system.CoreProxy"] +fromCall.func = "getPoolOwner" +fromCall.args = ["<%= settings.sc_pool_id %>"] +func = "registerRewardsDistributor" +args = [ + "<%= settings.sc_pool_id %>", + "<%= settings.synth_stata_usdc_token_address %>", + "<%= imports.RewardsDistributor_scbbtc_liquidation_rewards.contracts.RewardsDistributorExternal.address %>", +] diff --git a/tomls/omnibus-base-sepolia-andromeda/rewards/scbeth_perps_liquidations_rewards.toml b/tomls/omnibus-base-sepolia-andromeda/rewards/scbeth_perps_liquidations_rewards.toml new file mode 100644 index 000000000..ecd4bdafb --- /dev/null +++ b/tomls/omnibus-base-sepolia-andromeda/rewards/scbeth_perps_liquidations_rewards.toml @@ -0,0 +1,46 @@ +[provision.RewardsDistributor_scbeth_liquidation_rewards] +source = "synthetix-rewards-dist-ext:3.6.0" +target = "synthetix-rewards-dist-ext:3.6.0@perps-scbeth" +options.salt = "<%= settings.salt %>-perps-scbeth" +options.rewardManager = "<%= imports.system.contracts.CoreProxy.address %>" +options.poolId = "<%= settings.sc_pool_id %>" +options.payoutToken = "<%= extras.synth_cbeth_token_address %>" +options.payoutTokenDecimals = "18" +options.name = "Perps Coinbase Wrapped Staked ETH Liquidation Rewards" +options.authorizedDistributor = "<%= imports.perpsFactory.contracts.PerpsMarketProxy.address %>" + +[invoke.PerpsMarketProxy_registerDistributor_synth_cbeth_liquidations] +target = ["perpsFactory.PerpsMarketProxy"] +fromCall.func = "owner" +func = "registerDistributor" +args = [ + "<%= extras.synth_cbeth_token_address %>", + "<%= imports.RewardsDistributor_scbeth_liquidation_rewards.contracts.RewardsDistributorExternal.address %>", + "<%= extras.synth_cbeth_market_id %>", + [ + "<%= extras.synth_usdc_token_address %>", + "<%= settings.synth_stata_usdc_token_address %>", + ], +] + +[invoke.CoreProxy_registerRewardsDistributor_scbeth_liquidation_rewards_for_SpartanCouncilPool_usdc_lp] +target = ["system.CoreProxy"] +fromCall.func = "getPoolOwner" +fromCall.args = ["<%= settings.sc_pool_id %>"] +func = "registerRewardsDistributor" +args = [ + "<%= settings.sc_pool_id %>", + "<%= extras.synth_usdc_token_address %>", + "<%= imports.RewardsDistributor_scbeth_liquidation_rewards.contracts.RewardsDistributorExternal.address %>", +] + +[invoke.CoreProxy_registerRewardsDistributor_scbeth_liquidation_rewards_for_SpartanCouncilPool_stata_usdc_lp] +target = ["system.CoreProxy"] +fromCall.func = "getPoolOwner" +fromCall.args = ["<%= settings.sc_pool_id %>"] +func = "registerRewardsDistributor" +args = [ + "<%= settings.sc_pool_id %>", + "<%= settings.synth_stata_usdc_token_address %>", + "<%= imports.RewardsDistributor_scbeth_liquidation_rewards.contracts.RewardsDistributorExternal.address %>", +] diff --git a/tomls/omnibus-base-sepolia-andromeda/rewards/sweth_perps_liquidations_rewards.toml b/tomls/omnibus-base-sepolia-andromeda/rewards/sweth_perps_liquidations_rewards.toml new file mode 100644 index 000000000..1809bd8be --- /dev/null +++ b/tomls/omnibus-base-sepolia-andromeda/rewards/sweth_perps_liquidations_rewards.toml @@ -0,0 +1,46 @@ +[provision.RewardsDistributor_sweth_liquidation_rewards] +source = "synthetix-rewards-dist-ext:3.6.0" +target = "synthetix-rewards-dist-ext:3.6.0@perps-sweth" +options.salt = "<%= settings.salt %>-perps-sweth" +options.rewardManager = "<%= imports.system.contracts.CoreProxy.address %>" +options.poolId = "<%= settings.sc_pool_id %>" +options.payoutToken = "<%= extras.synth_weth_token_address %>" +options.payoutTokenDecimals = "18" +options.name = "Perps Lido Wrapped ETH Liquidation Rewards" +options.authorizedDistributor = "<%= imports.perpsFactory.contracts.PerpsMarketProxy.address %>" + +[invoke.PerpsMarketProxy_registerDistributor_synth_weth_liquidations] +target = ["perpsFactory.PerpsMarketProxy"] +fromCall.func = "owner" +func = "registerDistributor" +args = [ + "<%= extras.synth_weth_token_address %>", + "<%= imports.RewardsDistributor_sweth_liquidation_rewards.contracts.RewardsDistributorExternal.address %>", + "<%= extras.synth_weth_market_id %>", + [ + "<%= extras.synth_usdc_token_address %>", + "<%= settings.synth_stata_usdc_token_address %>", + ], +] + +[invoke.CoreProxy_registerRewardsDistributor_sweth_liquidation_rewards_for_SpartanCouncilPool_usdc_lp] +target = ["system.CoreProxy"] +fromCall.func = "getPoolOwner" +fromCall.args = ["<%= settings.sc_pool_id %>"] +func = "registerRewardsDistributor" +args = [ + "<%= settings.sc_pool_id %>", + "<%= extras.synth_usdc_token_address %>", + "<%= imports.RewardsDistributor_sweth_liquidation_rewards.contracts.RewardsDistributorExternal.address %>", +] + +[invoke.CoreProxy_registerRewardsDistributor_sweth_liquidation_rewards_for_SpartanCouncilPool_stata_usdc_lp] +target = ["system.CoreProxy"] +fromCall.func = "getPoolOwner" +fromCall.args = ["<%= settings.sc_pool_id %>"] +func = "registerRewardsDistributor" +args = [ + "<%= settings.sc_pool_id %>", + "<%= settings.synth_stata_usdc_token_address %>", + "<%= imports.RewardsDistributor_sweth_liquidation_rewards.contracts.RewardsDistributorExternal.address %>", +] diff --git a/tomls/omnibus-base-sepolia-andromeda/rewards/swsteth_perps_liquidations_rewards.toml b/tomls/omnibus-base-sepolia-andromeda/rewards/swsteth_perps_liquidations_rewards.toml new file mode 100644 index 000000000..7cd36f98b --- /dev/null +++ b/tomls/omnibus-base-sepolia-andromeda/rewards/swsteth_perps_liquidations_rewards.toml @@ -0,0 +1,46 @@ +[provision.RewardsDistributor_swsteth_liquidation_rewards] +source = "synthetix-rewards-dist-ext:3.6.0" +target = "synthetix-rewards-dist-ext:3.6.0@perps-swsteth" +options.salt = "<%= settings.salt %>-perps-swsteth" +options.rewardManager = "<%= imports.system.contracts.CoreProxy.address %>" +options.poolId = "<%= settings.sc_pool_id %>" +options.payoutToken = "<%= extras.synth_wsteth_token_address %>" +options.payoutTokenDecimals = "18" +options.name = "Perps Lido Wrapped Staked ETH Liquidation Rewards" +options.authorizedDistributor = "<%= imports.perpsFactory.contracts.PerpsMarketProxy.address %>" + +[invoke.PerpsMarketProxy_registerDistributor_synth_wsteth_liquidations] +target = ["perpsFactory.PerpsMarketProxy"] +fromCall.func = "owner" +func = "registerDistributor" +args = [ + "<%= extras.synth_wsteth_token_address %>", + "<%= imports.RewardsDistributor_swsteth_liquidation_rewards.contracts.RewardsDistributorExternal.address %>", + "<%= extras.synth_wsteth_market_id %>", + [ + "<%= extras.synth_usdc_token_address %>", + "<%= settings.synth_stata_usdc_token_address %>", + ], +] + +[invoke.CoreProxy_registerRewardsDistributor_swsteth_liquidation_rewards_for_SpartanCouncilPool_usdc_lp] +target = ["system.CoreProxy"] +fromCall.func = "getPoolOwner" +fromCall.args = ["<%= settings.sc_pool_id %>"] +func = "registerRewardsDistributor" +args = [ + "<%= settings.sc_pool_id %>", + "<%= extras.synth_usdc_token_address %>", + "<%= imports.RewardsDistributor_swsteth_liquidation_rewards.contracts.RewardsDistributorExternal.address %>", +] + +[invoke.CoreProxy_registerRewardsDistributor_swsteth_liquidation_rewards_for_SpartanCouncilPool_stata_usdc_lp] +target = ["system.CoreProxy"] +fromCall.func = "getPoolOwner" +fromCall.args = ["<%= settings.sc_pool_id %>"] +func = "registerRewardsDistributor" +args = [ + "<%= settings.sc_pool_id %>", + "<%= settings.synth_stata_usdc_token_address %>", + "<%= imports.RewardsDistributor_swsteth_liquidation_rewards.contracts.RewardsDistributorExternal.address %>", +] diff --git a/tomls/omnibus-base-sepolia-andromeda/spot/cbbtc.toml b/tomls/omnibus-base-sepolia-andromeda/spot/cbbtc.toml new file mode 100644 index 000000000..5e276adc2 --- /dev/null +++ b/tomls/omnibus-base-sepolia-andromeda/spot/cbbtc.toml @@ -0,0 +1,92 @@ +[var.cbbtc_spot_settings] +synth_cbbtc_max_collateral_amount = "<%= parseEther(String(100)) %>" +synth_cbbtc_skew_scale = "<%= parseEther(String(35_000)) %>" + +[invoke.SpotMarketProxy_createSynth_cbbtc] +target = ["spotFactory.SpotMarketProxy"] +fromCall.func = "owner" +func = "createSynth" +args = ["Synthetic Coinbase Wrapped BTC", "scbBTC", "<%= settings.owner %>"] +extra.synth_cbbtc_market_id.event = "SynthRegistered" +extra.synth_cbbtc_market_id.arg = 0 +extra.synth_cbbtc_token_address.event = "SynthRegistered" +extra.synth_cbbtc_token_address.arg = 1 + +[invoke.SpotMarketProxy_updatePriceData_cbbtc] +target = ["spotFactory.SpotMarketProxy"] +fromCall.func = "getMarketOwner" +fromCall.args = ["<%= extras.synth_cbbtc_market_id %>"] +func = "updatePriceData" +args = [ + "<%= extras.synth_cbbtc_market_id %>", + "<%= extras.cbbtc_oracle_id %>", + "<%= extras.cbbtc_oracle_id %>", + "<%= settings.strict_staleness_tolerance %>", +] + +[invoke.CoreProxy_configureMaximumMarketCollateral_cbbtc] +target = ["system.CoreProxy"] +fromCall.func = "owner" +fromCall.args = [] +func = "configureMaximumMarketCollateral" +args = [ + "<%= extras.synth_cbbtc_market_id %>", + "<%= settings.cbbtc_address %>", + "<%= settings.synth_cbbtc_max_collateral_amount %>", +] + +[invoke.SpotMarketProxy_setMarketSkewScale_cbbtc] +target = ["spotFactory.SpotMarketProxy"] +fromCall.func = "getMarketOwner" +fromCall.args = ["<%= extras.synth_cbbtc_market_id %>"] +func = "setMarketSkewScale" +args = ["<%= extras.synth_cbbtc_market_id %>", "<%= settings.synth_cbbtc_skew_scale %>"] + +[invoke.SpotMarketProxy_setWrapper_cbbtc] +target = ["spotFactory.SpotMarketProxy"] +fromCall.func = "getMarketOwner" +fromCall.args = ["<%= extras.synth_cbbtc_market_id %>"] +func = "setWrapper" +args = [ + "<%= extras.synth_cbbtc_market_id %>", + "<%= settings.cbbtc_address %>", + "<%= settings.synth_cbbtc_max_collateral_amount %>", +] + +# NOTE set disabled = true to addSettlementStrategy call before initial mainnet deployment +[invoke.SpotMarketProxy_addSettlementStrategy_cbbtc] +target = ["spotFactory.SpotMarketProxy"] +fromCall.func = "getMarketOwner" +fromCall.args = ["<%= extras.synth_cbbtc_market_id %>"] +func = "addSettlementStrategy" +args = [ + "<%= extras.synth_cbbtc_market_id %>", + { strategyType = "1", settlementDelay = "0", settlementWindowDuration = "1", priceVerificationContract = "0x0000000000000000000000000000000000000000", feedId = "0x0000000000000000000000000000000000000000000000000000000000000000", url = "", settlementReward = 0, minimumUsdExchangeAmount = "0", maxRoundingLoss = "1", priceDeviationTolerance = "0", disabled = false }, +] +extra.synth_cbbtc_settlement_strategy_id.event = "SettlementStrategyAdded" +extra.synth_cbbtc_settlement_strategy_id.arg = 1 + +[invoke.SpotMarketProxy_setSettlementStrategy_cbbtc] +target = ["spotFactory.SpotMarketProxy"] +fromCall.func = "getMarketOwner" +fromCall.args = ["<%= extras.synth_cbbtc_market_id %>"] +func = "setSettlementStrategy" +args = [ + "<%= extras.synth_cbbtc_market_id %>", + "<%= extras.synth_cbbtc_settlement_strategy_id %>", + { strategyType = "1", settlementDelay = "<%= settings.settlement_delay %>", settlementWindowDuration = "<%= settings.settlement_window_duration %>", priceVerificationContract = "<%= imports.pyth_erc7412_wrapper.contracts.PythERC7412Wrapper.address %>", feedId = "<%= settings.pyth_feed_id_cbbtc %>", url = "<%= settings.pyth_feed_url %>", settlementReward = "<%= settings.settlement_reward %>", minimumUsdExchangeAmount = "<%= settings.settlement_minimum_usd_exchange_amount %>", maxRoundingLoss = "<%= settings.settlement_max_rounding_loss %>", priceDeviationTolerance = "<%= settings.price_deviation_tolerance %>", disabled = true }, +] + +[invoke.SpotMarketProxy_setAtomicFixedFee_cbbtc] +target = ["spotFactory.SpotMarketProxy"] +fromCall.func = "getMarketOwner" +fromCall.args = ["<%= extras.synth_cbbtc_market_id %>"] +func = "setAtomicFixedFee" +args = ["<%= extras.synth_cbbtc_market_id %>", "<%= parseEther(String(0.3)) %>"] + +[invoke.SpotMarketProxy_setCollateralLeverage_cbbtc] +target = ["spotFactory.SpotMarketProxy"] +fromCall.func = "getMarketOwner" +fromCall.args = ["<%= extras.synth_cbbtc_market_id %>"] +func = "setCollateralLeverage" +args = ["<%= extras.synth_cbbtc_market_id %>", "<%= parseEther('10') %>"] diff --git a/tomls/omnibus-base-sepolia-andromeda/spot/cbeth.toml b/tomls/omnibus-base-sepolia-andromeda/spot/cbeth.toml new file mode 100644 index 000000000..54b0dec69 --- /dev/null +++ b/tomls/omnibus-base-sepolia-andromeda/spot/cbeth.toml @@ -0,0 +1,92 @@ +[var.cbeth_spot_settings] +synth_cbeth_max_collateral_amount = "<%= parseEther(String(1_750)) %>" +synth_cbeth_skew_scale = "<%= parseEther(String(350_000)) %>" + +[invoke.SpotMarketProxy_createSynth_cbeth] +target = ["spotFactory.SpotMarketProxy"] +fromCall.func = "owner" +func = "createSynth" +args = ["Synthetic Coinbase Wrapped Staked ETH", "scbETH", "<%= settings.owner %>"] +extra.synth_cbeth_market_id.event = "SynthRegistered" +extra.synth_cbeth_market_id.arg = 0 +extra.synth_cbeth_token_address.event = "SynthRegistered" +extra.synth_cbeth_token_address.arg = 1 + +[invoke.SpotMarketProxy_updatePriceData_cbeth] +target = ["spotFactory.SpotMarketProxy"] +fromCall.func = "getMarketOwner" +fromCall.args = ["<%= extras.synth_cbeth_market_id %>"] +func = "updatePriceData" +args = [ + "<%= extras.synth_cbeth_market_id %>", + "<%= extras.cbeth_oracle_id %>", + "<%= extras.cbeth_oracle_id %>", + "<%= settings.strict_staleness_tolerance %>", +] + +[invoke.CoreProxy_configureMaximumMarketCollateral_cbeth] +target = ["system.CoreProxy"] +fromCall.func = "owner" +fromCall.args = [] +func = "configureMaximumMarketCollateral" +args = [ + "<%= extras.synth_cbeth_market_id %>", + "<%= settings.cbeth_address %>", + "<%= settings.synth_cbeth_max_collateral_amount %>", +] + +[invoke.SpotMarketProxy_setMarketSkewScale_cbeth] +target = ["spotFactory.SpotMarketProxy"] +fromCall.func = "getMarketOwner" +fromCall.args = ["<%= extras.synth_cbeth_market_id %>"] +func = "setMarketSkewScale" +args = ["<%= extras.synth_cbeth_market_id %>", "<%= settings.synth_cbeth_skew_scale %>"] + +[invoke.SpotMarketProxy_setWrapper_cbeth] +target = ["spotFactory.SpotMarketProxy"] +fromCall.func = "getMarketOwner" +fromCall.args = ["<%= extras.synth_cbeth_market_id %>"] +func = "setWrapper" +args = [ + "<%= extras.synth_cbeth_market_id %>", + "<%= settings.cbeth_address %>", + "<%= settings.synth_cbeth_max_collateral_amount %>", +] + +# NOTE set disabled = true to addSettlementStrategy call before initial mainnet deployment +[invoke.SpotMarketProxy_addSettlementStrategy_cbeth] +target = ["spotFactory.SpotMarketProxy"] +fromCall.func = "getMarketOwner" +fromCall.args = ["<%= extras.synth_cbeth_market_id %>"] +func = "addSettlementStrategy" +args = [ + "<%= extras.synth_cbeth_market_id %>", + { strategyType = "1", settlementDelay = "0", settlementWindowDuration = "1", priceVerificationContract = "0x0000000000000000000000000000000000000000", feedId = "0x0000000000000000000000000000000000000000000000000000000000000000", url = "", settlementReward = 0, minimumUsdExchangeAmount = "0", maxRoundingLoss = "1", priceDeviationTolerance = "0", disabled = false }, +] +extra.synth_cbeth_settlement_strategy_id.event = "SettlementStrategyAdded" +extra.synth_cbeth_settlement_strategy_id.arg = 1 + +[invoke.SpotMarketProxy_setSettlementStrategy_cbeth] +target = ["spotFactory.SpotMarketProxy"] +fromCall.func = "getMarketOwner" +fromCall.args = ["<%= extras.synth_cbeth_market_id %>"] +func = "setSettlementStrategy" +args = [ + "<%= extras.synth_cbeth_market_id %>", + "<%= extras.synth_cbeth_settlement_strategy_id %>", + { strategyType = "1", settlementDelay = "<%= settings.settlement_delay %>", settlementWindowDuration = "<%= settings.settlement_window_duration %>", priceVerificationContract = "<%= imports.pyth_erc7412_wrapper.contracts.PythERC7412Wrapper.address %>", feedId = "<%= settings.pyth_feed_id_cbeth %>", url = "<%= settings.pyth_feed_url %>", settlementReward = "<%= settings.settlement_reward %>", minimumUsdExchangeAmount = "<%= settings.settlement_minimum_usd_exchange_amount %>", maxRoundingLoss = "<%= settings.settlement_max_rounding_loss %>", priceDeviationTolerance = "<%= settings.price_deviation_tolerance %>", disabled = true }, +] + +[invoke.SpotMarketProxy_setAtomicFixedFee_cbeth] +target = ["spotFactory.SpotMarketProxy"] +fromCall.func = "getMarketOwner" +fromCall.args = ["<%= extras.synth_cbeth_market_id %>"] +func = "setAtomicFixedFee" +args = ["<%= extras.synth_cbeth_market_id %>", "<%= parseEther(String(0.3)) %>"] + +[invoke.SpotMarketProxy_setCollateralLeverage_cbeth] +target = ["spotFactory.SpotMarketProxy"] +fromCall.func = "getMarketOwner" +fromCall.args = ["<%= extras.synth_cbeth_market_id %>"] +func = "setCollateralLeverage" +args = ["<%= extras.synth_cbeth_market_id %>", "<%= parseEther('10') %>"] diff --git a/tomls/omnibus-base-sepolia-andromeda/spot/weth.toml b/tomls/omnibus-base-sepolia-andromeda/spot/weth.toml new file mode 100644 index 000000000..01290b5e0 --- /dev/null +++ b/tomls/omnibus-base-sepolia-andromeda/spot/weth.toml @@ -0,0 +1,92 @@ +[var.weth_spot_settings] +synth_weth_max_collateral_amount = "<%= parseEther(String(1_750)) %>" +synth_weth_skew_scale = "<%= parseEther(String(350_000)) %>" + +[invoke.SpotMarketProxy_createSynth_weth] +target = ["spotFactory.SpotMarketProxy"] +fromCall.func = "owner" +func = "createSynth" +args = ["Synthetic Wrapped ETH", "sWETH", "<%= settings.owner %>"] +extra.synth_weth_market_id.event = "SynthRegistered" +extra.synth_weth_market_id.arg = 0 +extra.synth_weth_token_address.event = "SynthRegistered" +extra.synth_weth_token_address.arg = 1 + +[invoke.SpotMarketProxy_updatePriceData_weth] +target = ["spotFactory.SpotMarketProxy"] +fromCall.func = "getMarketOwner" +fromCall.args = ["<%= extras.synth_weth_market_id %>"] +func = "updatePriceData" +args = [ + "<%= extras.synth_weth_market_id %>", + "<%= extras.eth_oracle_id %>", + "<%= extras.eth_oracle_id %>", + "<%= settings.strict_staleness_tolerance %>", +] + +[invoke.CoreProxy_configureMaximumMarketCollateral_weth] +target = ["system.CoreProxy"] +fromCall.func = "owner" +fromCall.args = [] +func = "configureMaximumMarketCollateral" +args = [ + "<%= extras.synth_weth_market_id %>", + "<%= settings.weth_address %>", + "<%= settings.synth_weth_max_collateral_amount %>", +] + +[invoke.SpotMarketProxy_setMarketSkewScale_weth] +target = ["spotFactory.SpotMarketProxy"] +fromCall.func = "getMarketOwner" +fromCall.args = ["<%= extras.synth_weth_market_id %>"] +func = "setMarketSkewScale" +args = ["<%= extras.synth_weth_market_id %>", "<%= settings.synth_weth_skew_scale %>"] + +[invoke.SpotMarketProxy_setWrapper_weth] +target = ["spotFactory.SpotMarketProxy"] +fromCall.func = "getMarketOwner" +fromCall.args = ["<%= extras.synth_weth_market_id %>"] +func = "setWrapper" +args = [ + "<%= extras.synth_weth_market_id %>", + "<%= settings.weth_address %>", + "<%= settings.synth_weth_max_collateral_amount %>", +] + +# NOTE set disabled = true to addSettlementStrategy call before initial mainnet deployment +[invoke.SpotMarketProxy_addSettlementStrategy_weth] +target = ["spotFactory.SpotMarketProxy"] +fromCall.func = "getMarketOwner" +fromCall.args = ["<%= extras.synth_weth_market_id %>"] +func = "addSettlementStrategy" +args = [ + "<%= extras.synth_weth_market_id %>", + { strategyType = "1", settlementDelay = "0", settlementWindowDuration = "1", priceVerificationContract = "0x0000000000000000000000000000000000000000", feedId = "0x0000000000000000000000000000000000000000000000000000000000000000", url = "", settlementReward = 0, minimumUsdExchangeAmount = "0", maxRoundingLoss = "1", priceDeviationTolerance = "0", disabled = false }, +] +extra.synth_weth_settlement_strategy_id.event = "SettlementStrategyAdded" +extra.synth_weth_settlement_strategy_id.arg = 1 + +[invoke.SpotMarketProxy_setSettlementStrategy_weth] +target = ["spotFactory.SpotMarketProxy"] +fromCall.func = "getMarketOwner" +fromCall.args = ["<%= extras.synth_weth_market_id %>"] +func = "setSettlementStrategy" +args = [ + "<%= extras.synth_weth_market_id %>", + "<%= extras.synth_weth_settlement_strategy_id %>", + { strategyType = "1", settlementDelay = "<%= settings.settlement_delay %>", settlementWindowDuration = "<%= settings.settlement_window_duration %>", priceVerificationContract = "<%= imports.pyth_erc7412_wrapper.contracts.PythERC7412Wrapper.address %>", feedId = "<%= settings.pyth_feed_id_weth %>", url = "<%= settings.pyth_feed_url %>", settlementReward = "<%= settings.settlement_reward %>", minimumUsdExchangeAmount = "<%= settings.settlement_minimum_usd_exchange_amount %>", maxRoundingLoss = "<%= settings.settlement_max_rounding_loss %>", priceDeviationTolerance = "<%= settings.price_deviation_tolerance %>", disabled = true }, +] + +[invoke.SpotMarketProxy_setAtomicFixedFee_weth] +target = ["spotFactory.SpotMarketProxy"] +fromCall.func = "getMarketOwner" +fromCall.args = ["<%= extras.synth_weth_market_id %>"] +func = "setAtomicFixedFee" +args = ["<%= extras.synth_weth_market_id %>", "<%= parseEther(String(0.3)) %>"] + +[invoke.SpotMarketProxy_setCollateralLeverage_weth] +target = ["spotFactory.SpotMarketProxy"] +fromCall.func = "getMarketOwner" +fromCall.args = ["<%= extras.synth_weth_market_id %>"] +func = "setCollateralLeverage" +args = ["<%= extras.synth_weth_market_id %>", "<%= parseEther('10') %>"] diff --git a/tomls/omnibus-base-sepolia-andromeda/spot/wsteth.toml b/tomls/omnibus-base-sepolia-andromeda/spot/wsteth.toml new file mode 100644 index 000000000..d57f61c74 --- /dev/null +++ b/tomls/omnibus-base-sepolia-andromeda/spot/wsteth.toml @@ -0,0 +1,92 @@ +[var.wsteth_spot_settings] +synth_wsteth_max_collateral_amount = "<%= parseEther(String(1_750)) %>" +synth_wsteth_skew_scale = "<%= parseEther(String(350_000)) %>" + +[invoke.SpotMarketProxy_createSynth_wsteth] +target = ["spotFactory.SpotMarketProxy"] +fromCall.func = "owner" +func = "createSynth" +args = ["Synthetic Lido Wrapped Staked ETH", "swstETH", "<%= settings.owner %>"] +extra.synth_wsteth_market_id.event = "SynthRegistered" +extra.synth_wsteth_market_id.arg = 0 +extra.synth_wsteth_token_address.event = "SynthRegistered" +extra.synth_wsteth_token_address.arg = 1 + +[invoke.SpotMarketProxy_updatePriceData_wsteth] +target = ["spotFactory.SpotMarketProxy"] +fromCall.func = "getMarketOwner" +fromCall.args = ["<%= extras.synth_wsteth_market_id %>"] +func = "updatePriceData" +args = [ + "<%= extras.synth_wsteth_market_id %>", + "<%= extras.wsteth_oracle_id %>", + "<%= extras.wsteth_oracle_id %>", + "<%= settings.strict_staleness_tolerance %>", +] + +[invoke.CoreProxy_configureMaximumMarketCollateral_wsteth] +target = ["system.CoreProxy"] +fromCall.func = "owner" +fromCall.args = [] +func = "configureMaximumMarketCollateral" +args = [ + "<%= extras.synth_wsteth_market_id %>", + "<%= settings.wsteth_address %>", + "<%= settings.synth_wsteth_max_collateral_amount %>", +] + +[invoke.SpotMarketProxy_setMarketSkewScale_wsteth] +target = ["spotFactory.SpotMarketProxy"] +fromCall.func = "getMarketOwner" +fromCall.args = ["<%= extras.synth_wsteth_market_id %>"] +func = "setMarketSkewScale" +args = ["<%= extras.synth_wsteth_market_id %>", "<%= settings.synth_wsteth_skew_scale %>"] + +[invoke.SpotMarketProxy_setWrapper_wsteth] +target = ["spotFactory.SpotMarketProxy"] +fromCall.func = "getMarketOwner" +fromCall.args = ["<%= extras.synth_wsteth_market_id %>"] +func = "setWrapper" +args = [ + "<%= extras.synth_wsteth_market_id %>", + "<%= settings.wsteth_address %>", + "<%= settings.synth_wsteth_max_collateral_amount %>", +] + +# NOTE set disabled = true to addSettlementStrategy call before initial mainnet deployment +[invoke.SpotMarketProxy_addSettlementStrategy_wsteth] +target = ["spotFactory.SpotMarketProxy"] +fromCall.func = "getMarketOwner" +fromCall.args = ["<%= extras.synth_wsteth_market_id %>"] +func = "addSettlementStrategy" +args = [ + "<%= extras.synth_wsteth_market_id %>", + { strategyType = "1", settlementDelay = "0", settlementWindowDuration = "1", priceVerificationContract = "0x0000000000000000000000000000000000000000", feedId = "0x0000000000000000000000000000000000000000000000000000000000000000", url = "", settlementReward = 0, minimumUsdExchangeAmount = "0", maxRoundingLoss = "1", priceDeviationTolerance = "0", disabled = false }, +] +extra.synth_wsteth_settlement_strategy_id.event = "SettlementStrategyAdded" +extra.synth_wsteth_settlement_strategy_id.arg = 1 + +[invoke.SpotMarketProxy_setSettlementStrategy_wsteth] +target = ["spotFactory.SpotMarketProxy"] +fromCall.func = "getMarketOwner" +fromCall.args = ["<%= extras.synth_wsteth_market_id %>"] +func = "setSettlementStrategy" +args = [ + "<%= extras.synth_wsteth_market_id %>", + "<%= extras.synth_wsteth_settlement_strategy_id %>", + { strategyType = "1", settlementDelay = "<%= settings.settlement_delay %>", settlementWindowDuration = "<%= settings.settlement_window_duration %>", priceVerificationContract = "<%= imports.pyth_erc7412_wrapper.contracts.PythERC7412Wrapper.address %>", feedId = "<%= settings.pyth_feed_id_wsteth %>", url = "<%= settings.pyth_feed_url %>", settlementReward = "<%= settings.settlement_reward %>", minimumUsdExchangeAmount = "<%= settings.settlement_minimum_usd_exchange_amount %>", maxRoundingLoss = "<%= settings.settlement_max_rounding_loss %>", priceDeviationTolerance = "<%= settings.price_deviation_tolerance %>", disabled = true }, +] + +[invoke.SpotMarketProxy_setAtomicFixedFee_wsteth] +target = ["spotFactory.SpotMarketProxy"] +fromCall.func = "getMarketOwner" +fromCall.args = ["<%= extras.synth_wsteth_market_id %>"] +func = "setAtomicFixedFee" +args = ["<%= extras.synth_wsteth_market_id %>", "<%= parseEther(String(0.3)) %>"] + +[invoke.SpotMarketProxy_setCollateralLeverage_wsteth] +target = ["spotFactory.SpotMarketProxy"] +fromCall.func = "getMarketOwner" +fromCall.args = ["<%= extras.synth_wsteth_market_id %>"] +func = "setCollateralLeverage" +args = ["<%= extras.synth_wsteth_market_id %>", "<%= parseEther('10') %>"]