Skip to content

Commit

Permalink
progress
Browse files Browse the repository at this point in the history
  • Loading branch information
noahlitvin committed Nov 3, 2023
1 parent 7f71381 commit 0d2f4a2
Show file tree
Hide file tree
Showing 14 changed files with 684 additions and 568 deletions.
598 changes: 55 additions & 543 deletions omnibus-base-goerli-andromeda.toml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 0 additions & 12 deletions tomls/collaterals/usdc.toml

This file was deleted.

133 changes: 133 additions & 0 deletions tomls/markets/perps/ltc.toml
Original file line number Diff line number Diff line change
@@ -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"]
133 changes: 133 additions & 0 deletions tomls/markets/perps/xrp.toml
Original file line number Diff line number Diff line change
@@ -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"]
54 changes: 54 additions & 0 deletions tomls/omnibus-base-goerli-andromeda/perps/btc.toml
Original file line number Diff line number Diff line change
@@ -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"
Loading

0 comments on commit 0d2f4a2

Please sign in to comment.