Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates spot-market to 3.10.2 with support of SIP 406 changes #593

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
6 changes: 3 additions & 3 deletions e2e/tests/omnibus-arbitrum-mainnet.toml/Perps_Trading.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ describe(require('path').basename(__filename, '.e2e.js'), function () {
);
});

it('should set tBTC balance to 10', async () => {
it('should set tBTC balance to 8', async () => {
const { tokenAddress } = await getCollateralConfig('tBTC');
assert.equal(
await getCollateralBalance({ address: wallet.address, symbol: 'tBTC' }),
Expand All @@ -192,11 +192,11 @@ describe(require('path').basename(__filename, '.e2e.js'), function () {
);
await setTokenBalance({
wallet,
balance: 10,
balance: 8,
tokenAddress: extras.tbtc_address,
friendlyWhale: '0xe9e6b9aAAfaf6816C3364345F6eF745CcFC8660a',
});
assert.equal(await getCollateralBalance({ address: wallet.address, symbol: 'tBTC' }), 10);
assert.equal(await getCollateralBalance({ address: wallet.address, symbol: 'tBTC' }), 8);
});

it('should approve tBTC spending for SpotMarket', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function round(val) {
return parseFloat(milli.slice(0, -3).concat('.').concat(milli.slice(-3)));
}

describe(require('path').basename(__filename, '.e2e.js'), function () {
describe.skip(require('path').basename(__filename, '.e2e.js'), function () {
const accountId = parseInt(`1337${crypto.randomInt(1000)}`);
const provider = new ethers.providers.JsonRpcProvider(
process.env.RPC_URL || 'http://127.0.0.1:8545'
Expand Down
2 changes: 1 addition & 1 deletion omnibus-arbitrum-mainnet.toml
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ defaultValue = "arbitrum-gas-price-oracle:3.10.0"
defaultValue = "oracle-manager:3.10.1"

[setting.spot_market_package]
defaultValue = "synthetix-spot-market:3.10.1"
defaultValue = "synthetix-spot-market:3.10.2"

[setting.perps_market_package]
defaultValue = "synthetix-perps-market:3.10.1"
Expand Down
4 changes: 2 additions & 2 deletions omnibus-arbitrum-sepolia.toml
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,10 @@ defaultValue = "oracle-manager:3.10.1"
defaultValue = "arbitrum-gas-price-oracle:3.10.0"

[setting.spot_market_package]
defaultValue = "synthetix-spot-market:3.10.1"
defaultValue = "synthetix-spot-market:3.10.2"

[setting.perps_market_package]
defaultValue = "synthetix-perps-market:3.10.1"
defaultValue = "synthetix-perps-market:3.10.2"

[setting.buyback_snx_package]
defaultValue = "buyback-snx:3.3.15"
Expand Down
6 changes: 3 additions & 3 deletions omnibus-base-mainnet-andromeda.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ deployers = [
include = [
"tomls/omnibus-base-mainnet-andromeda/core.toml",
"tomls/settings.toml",
"tomls/permissions.toml",
"tomls/omnibus-base-mainnet-andromeda/permissions.toml",
"tomls/omnibus-base-mainnet-andromeda/permit-deniers.toml",
"tomls/omnibus-base-mainnet-andromeda/pools/spartan-council.toml",
"tomls/markets/spot-factory.toml",
Expand Down Expand Up @@ -276,10 +276,10 @@ defaultValue = "op-gas-price-oracle:3.10.0"
defaultValue = "oracle-manager:3.10.1"

[setting.spot_market_package]
defaultValue = "synthetix-spot-market:3.10.1"
defaultValue = "synthetix-spot-market:3.10.2"

[setting.perps_market_package]
defaultValue = "synthetix-perps-market:3.10.1"
defaultValue = "synthetix-perps-market:3.10.2"

[setting.buyback_snx_package]
defaultValue = "buyback-snx:3.3.5" # Do not update! This package isn't upgradeable. A version change will deploy a new contract.
Expand Down
6 changes: 3 additions & 3 deletions omnibus-base-sepolia-andromeda.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ deployers = ["0x48914229deDd5A9922f44441ffCCfC2Cb7856Ee9"]
include = [
"tomls/omnibus-base-sepolia-andromeda/core.toml",
"tomls/markets/spot-factory.toml",
"tomls/permissions.toml",
"tomls/omnibus-base-sepolia-andromeda/permissions.toml",
"tomls/omnibus-base-sepolia-andromeda/permit-deniers.toml",
"tomls/omnibus-base-sepolia-andromeda/pools/spartan-council.toml",

Expand Down Expand Up @@ -271,10 +271,10 @@ defaultValue = "oracle-manager:3.10.1"
defaultValue = "op-gas-price-oracle:3.10.0"

[setting.spot_market_package]
defaultValue = "synthetix-spot-market:3.10.1"
defaultValue = "synthetix-spot-market:3.10.2"

[setting.perps_market_package]
defaultValue = "synthetix-perps-market:3.10.1"
defaultValue = "synthetix-perps-market:3.10.2"

[setting.buyback_snx_package]
defaultValue = "buyback-snx:3.3.14" # Do not update! This package isn't upgradeable. A version change will deploy a new contract.
Expand Down
6 changes: 6 additions & 0 deletions tomls/omnibus-arbitrum-mainnet/permissions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ func = "addToFeatureFlagAllowlist"
fromCall.func = "owner"
args = ["<%= formatBytes32String('createSynth') %>", "<%= settings.pdao %>"]

[invoke.SpotMarketProxy_setFeatureFlagAllowAll_spotMarketEnabled]
target = ["spotFactory.SpotMarketProxy"]
func = "setFeatureFlagAllowAll"
fromCall.func = "owner"
args = ["<%= formatBytes32String('spotMarketEnabled') %>", true]

[invoke.PerpsMarketProxy_addToFeatureFlagAllowlist_createMarket_pdao]
target = ["perpsFactory.PerpsMarketProxy"]
func = "addToFeatureFlagAllowlist"
Expand Down
18 changes: 18 additions & 0 deletions tomls/omnibus-arbitrum-mainnet/spot/eth.toml
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,21 @@ fromCall.func = "getMarketOwner"
fromCall.args = ["<%= extras.synth_eth_market_id %>"]
func = "setCollateralLeverage"
args = ["<%= extras.synth_eth_market_id %>", "<%= parseEther('10') %>"]

[invoke.SpotMarketProxy_setFeatureFlagAllowAll_atomicOrdersEnabled_sETH]
target = ["spotFactory.SpotMarketProxy"]
func = "setFeatureFlagAllowAll"
fromCall.func = "owner"
args = [
"<%= formatBytes32String('atomicOrdersEnabled' + extras.synth_eth_market_id.toString()) %>",
true,
]

[invoke.SpotMarketProxy_setFeatureFlagAllowAll_wrapperEnabled_sETH]
target = ["spotFactory.SpotMarketProxy"]
func = "setFeatureFlagAllowAll"
fromCall.func = "owner"
args = [
"<%= formatBytes32String('wrapperEnabled' + extras.synth_eth_market_id.toString()) %>",
true,
]
18 changes: 18 additions & 0 deletions tomls/omnibus-arbitrum-mainnet/spot/sol.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,21 @@ fromCall.func = "getMarketOwner"
fromCall.args = ["<%= extras.synth_sol_market_id %>"]
func = "setCollateralLeverage"
args = ["<%= extras.synth_sol_market_id %>", "<%= parseEther('10') %>"]

[invoke.SpotMarketProxy_setFeatureFlagAllowAll_atomicOrdersEnabled_sol]
target = ["spotFactory.SpotMarketProxy"]
func = "setFeatureFlagAllowAll"
fromCall.func = "owner"
args = [
"<%= formatBytes32String('atomicOrdersEnabled' + extras.synth_sol_market_id.toString()) %>",
true,
]

[invoke.SpotMarketProxy_setFeatureFlagAllowAll_wrapperEnabled_sol]
target = ["spotFactory.SpotMarketProxy"]
func = "setFeatureFlagAllowAll"
fromCall.func = "owner"
args = [
"<%= formatBytes32String('wrapperEnabled' + extras.synth_sol_market_id.toString()) %>",
true,
]
18 changes: 18 additions & 0 deletions tomls/omnibus-arbitrum-mainnet/spot/tbtc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,21 @@ fromCall.func = "getMarketOwner"
fromCall.args = ["<%= extras.synth_btc_market_id %>"]
func = "setCollateralLeverage"
args = ["<%= extras.synth_btc_market_id %>", "<%= parseEther('10') %>"]

[invoke.SpotMarketProxy_setFeatureFlagAllowAll_atomicOrdersEnabled_stBTC]
target = ["spotFactory.SpotMarketProxy"]
func = "setFeatureFlagAllowAll"
fromCall.func = "owner"
args = [
"<%= formatBytes32String('atomicOrdersEnabled' + extras.synth_btc_market_id.toString()) %>",
true,
]

[invoke.SpotMarketProxy_setFeatureFlagAllowAll_wrapperEnabled_stBTC]
target = ["spotFactory.SpotMarketProxy"]
func = "setFeatureFlagAllowAll"
fromCall.func = "owner"
args = [
"<%= formatBytes32String('wrapperEnabled' + extras.synth_btc_market_id.toString()) %>",
true,
]
18 changes: 18 additions & 0 deletions tomls/omnibus-arbitrum-mainnet/spot/usdc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,21 @@ fromCall.func = "getMarketOwner"
fromCall.args = ["<%= extras.synth_usdc_market_id %>"]
func = "setCollateralLeverage"
args = ["<%= extras.synth_usdc_market_id %>", "<%= parseEther('10') %>"]

[invoke.SpotMarketProxy_setFeatureFlagAllowAll_atomicOrdersEnabled_usdc]
target = ["spotFactory.SpotMarketProxy"]
func = "setFeatureFlagAllowAll"
fromCall.func = "owner"
args = [
"<%= formatBytes32String('atomicOrdersEnabled' + extras.synth_usdc_market_id.toString()) %>",
true,
]

[invoke.SpotMarketProxy_setFeatureFlagAllowAll_wrapperEnabled_usdc]
target = ["spotFactory.SpotMarketProxy"]
func = "setFeatureFlagAllowAll"
fromCall.func = "owner"
args = [
"<%= formatBytes32String('wrapperEnabled' + extras.synth_usdc_market_id.toString()) %>",
true,
]
18 changes: 18 additions & 0 deletions tomls/omnibus-arbitrum-mainnet/spot/usde.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,21 @@ fromCall.func = "getMarketOwner"
fromCall.args = ["<%= extras.synth_usde_market_id %>"]
func = "setCollateralLeverage"
args = ["<%= extras.synth_usde_market_id %>", "<%= parseEther('10') %>"]

[invoke.SpotMarketProxy_setFeatureFlagAllowAll_atomicOrdersEnabled_USDe]
target = ["spotFactory.SpotMarketProxy"]
func = "setFeatureFlagAllowAll"
fromCall.func = "owner"
args = [
"<%= formatBytes32String('atomicOrdersEnabled' + extras.synth_usde_market_id.toString()) %>",
true,
]

[invoke.SpotMarketProxy_setFeatureFlagAllowAll_wrapperEnabled_USDe]
target = ["spotFactory.SpotMarketProxy"]
func = "setFeatureFlagAllowAll"
fromCall.func = "owner"
args = [
"<%= formatBytes32String('wrapperEnabled' + extras.synth_usde_market_id.toString()) %>",
true,
]
6 changes: 6 additions & 0 deletions tomls/omnibus-arbitrum-sepolia/permissions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ func = "addToFeatureFlagAllowlist"
fromCall.func = "owner"
args = ["<%= formatBytes32String('createSynth') %>", "<%= settings.deployer %>"]

[invoke.SpotMarketProxy_setFeatureFlagAllowAll_spotMarketEnabled]
target = ["spotFactory.SpotMarketProxy"]
func = "setFeatureFlagAllowAll"
fromCall.func = "owner"
args = ["<%= formatBytes32String('spotMarketEnabled') %>", true]

[invoke.PerpsMarketProxy_addToFeatureFlagAllowlist_createMarket_deployer]
target = ["perpsFactory.PerpsMarketProxy"]
func = "addToFeatureFlagAllowlist"
Expand Down
18 changes: 18 additions & 0 deletions tomls/omnibus-arbitrum-sepolia/spot/dai.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,21 @@ fromCall.func = "getMarketOwner"
fromCall.args = ["<%= extras.synth_dai_market_id %>"]
func = "setCollateralLeverage"
args = ["<%= extras.synth_dai_market_id %>", "<%= parseEther('10') %>"]

[invoke.SpotMarketProxy_setFeatureFlagAllowAll_atomicOrdersEnabled_dai]
target = ["spotFactory.SpotMarketProxy"]
func = "setFeatureFlagAllowAll"
fromCall.func = "owner"
args = [
"<%= formatBytes32String('atomicOrdersEnabled' + extras.synth_dai_market_id.toString()) %>",
true,
]

[invoke.SpotMarketProxy_setFeatureFlagAllowAll_wrapperEnabled_dai]
target = ["spotFactory.SpotMarketProxy"]
func = "setFeatureFlagAllowAll"
fromCall.func = "owner"
args = [
"<%= formatBytes32String('wrapperEnabled' + extras.synth_dai_market_id.toString()) %>",
true,
]
18 changes: 18 additions & 0 deletions tomls/omnibus-arbitrum-sepolia/spot/sol.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,21 @@ fromCall.func = "getMarketOwner"
fromCall.args = ["<%= extras.synth_SOL_market_id %>"]
func = "setCollateralLeverage"
args = ["<%= extras.synth_SOL_market_id %>", "<%= parseEther('10') %>"]

[invoke.SpotMarketProxy_setFeatureFlagAllowAll_atomicOrdersEnabled_sSOL]
target = ["spotFactory.SpotMarketProxy"]
func = "setFeatureFlagAllowAll"
fromCall.func = "owner"
args = [
"<%= formatBytes32String('atomicOrdersEnabled' + extras.synth_SOL_market_id.toString()) %>",
true,
]

[invoke.SpotMarketProxy_setFeatureFlagAllowAll_wrapperEnabled_sSOL]
target = ["spotFactory.SpotMarketProxy"]
func = "setFeatureFlagAllowAll"
fromCall.func = "owner"
args = [
"<%= formatBytes32String('wrapperEnabled' + extras.synth_SOL_market_id.toString()) %>",
true,
]
18 changes: 18 additions & 0 deletions tomls/omnibus-arbitrum-sepolia/spot/usdc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,21 @@ fromCall.func = "getMarketOwner"
fromCall.args = ["<%= extras.synth_usdc_market_id %>"]
func = "setCollateralLeverage"
args = ["<%= extras.synth_usdc_market_id %>", "<%= parseEther('10') %>"]

[invoke.SpotMarketProxy_setFeatureFlagAllowAll_atomicOrdersEnabled_usdc]
target = ["spotFactory.SpotMarketProxy"]
func = "setFeatureFlagAllowAll"
fromCall.func = "owner"
args = [
"<%= formatBytes32String('atomicOrdersEnabled' + extras.synth_usdc_market_id.toString()) %>",
true,
]

[invoke.SpotMarketProxy_setFeatureFlagAllowAll_wrapperEnabled_usdc]
target = ["spotFactory.SpotMarketProxy"]
func = "setFeatureFlagAllowAll"
fromCall.func = "owner"
args = [
"<%= formatBytes32String('wrapperEnabled' + extras.synth_usdc_market_id.toString()) %>",
true,
]
18 changes: 18 additions & 0 deletions tomls/omnibus-arbitrum-sepolia/spot/usde.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,21 @@ fromCall.func = "getMarketOwner"
fromCall.args = ["<%= extras.synth_USDe_market_id %>"]
func = "setCollateralLeverage"
args = ["<%= extras.synth_USDe_market_id %>", "<%= parseEther('10') %>"]

[invoke.SpotMarketProxy_setFeatureFlagAllowAll_atomicOrdersEnabled_sUSDe]
target = ["spotFactory.SpotMarketProxy"]
func = "setFeatureFlagAllowAll"
fromCall.func = "owner"
args = [
"<%= formatBytes32String('atomicOrdersEnabled' + extras.synth_USDe_market_id.toString()) %>",
true,
]

[invoke.SpotMarketProxy_setFeatureFlagAllowAll_wrapperEnabled_sUSDe]
target = ["spotFactory.SpotMarketProxy"]
func = "setFeatureFlagAllowAll"
fromCall.func = "owner"
args = [
"<%= formatBytes32String('wrapperEnabled' + extras.synth_USDe_market_id.toString()) %>",
true,
]
18 changes: 18 additions & 0 deletions tomls/omnibus-arbitrum-sepolia/spot/wbtc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,21 @@ fromCall.func = "getMarketOwner"
fromCall.args = ["<%= extras.synth_btc_market_id %>"]
func = "setCollateralLeverage"
args = ["<%= extras.synth_btc_market_id %>", "<%= parseEther('10') %>"]

[invoke.SpotMarketProxy_setFeatureFlagAllowAll_atomicOrdersEnabled_btc]
target = ["spotFactory.SpotMarketProxy"]
func = "setFeatureFlagAllowAll"
fromCall.func = "owner"
args = [
"<%= formatBytes32String('atomicOrdersEnabled' + extras.synth_btc_market_id.toString()) %>",
true,
]

[invoke.SpotMarketProxy_setFeatureFlagAllowAll_wrapperEnabled_btc]
target = ["spotFactory.SpotMarketProxy"]
func = "setFeatureFlagAllowAll"
fromCall.func = "owner"
args = [
"<%= formatBytes32String('wrapperEnabled' + extras.synth_btc_market_id.toString()) %>",
true,
]
18 changes: 18 additions & 0 deletions tomls/omnibus-arbitrum-sepolia/spot/weth.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,21 @@ fromCall.func = "getMarketOwner"
fromCall.args = ["<%= extras.synth_eth_market_id %>"]
func = "setCollateralLeverage"
args = ["<%= extras.synth_eth_market_id %>", "<%= parseEther('10') %>"]

[invoke.SpotMarketProxy_setFeatureFlagAllowAll_atomicOrdersEnabled_sETH]
target = ["spotFactory.SpotMarketProxy"]
func = "setFeatureFlagAllowAll"
fromCall.func = "owner"
args = [
"<%= formatBytes32String('atomicOrdersEnabled' + extras.synth_eth_market_id.toString()) %>",
true,
]

[invoke.SpotMarketProxy_setFeatureFlagAllowAll_wrapperEnabled_sETH]
target = ["spotFactory.SpotMarketProxy"]
func = "setFeatureFlagAllowAll"
fromCall.func = "owner"
args = [
"<%= formatBytes32String('wrapperEnabled' + extras.synth_eth_market_id.toString()) %>",
true,
]
13 changes: 13 additions & 0 deletions tomls/omnibus-base-mainnet-andromeda/permissions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[setting.deployer]

[invoke.permitCreatePool]
target = ["system.CoreProxy"]
fromCall.func = "owner"
func = "addToFeatureFlagAllowlist"
args = ["<%= formatBytes32String('createPool') %>", "<%= settings.deployer %>"]

[invoke.SpotMarketProxy_setFeatureFlagAllowAll_spotMarketEnabled]
target = ["spotFactory.SpotMarketProxy"]
func = "setFeatureFlagAllowAll"
fromCall.func = "owner"
args = ["<%= formatBytes32String('spotMarketEnabled') %>", true]
Loading