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

redemption based pricing - base sepolia #542

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions omnibus-base-sepolia-andromeda.toml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ include = [
"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-wsteth-r.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",
Expand Down Expand Up @@ -465,6 +466,8 @@ pyth_feed_id_weth = "0xff61491a931112ddf1bd8147cd1b641375f79f5825126d66548087463
pyth_feed_id_wif = "0x4ca4beeca86f0d164160323817a4e42b10010a724c2217c6ee41b54cd4cc61fc"
pyth_feed_id_wld = "0xd6835ad1f773de4a378115eb6824bd0c0e42d84d1c84d9750e853fb6b6c7794a"
pyth_feed_id_wsteth = "0x6df640f3b8963d8f8358f791f352b8364513f6ab1cca5ed3f1f7b5448980e784"
pyth_feed_id_wsteth_steth_r = "0xf59ead01ed0faba85332a1e2feae8ddb14a1c94ebac259f1c982c92fc7ce333e"
pyth_feed_id_steth_eth_r = "0x3af6a3098c56f58ff47cc46dee4a5b1910e5c157f7f0b665952445867470d61f"
pyth_feed_id_xlm = "0xb7a8eba68a997cd0210c2e1e4ee811ad2d174b3611c22d9ebf16f4cb7e9ba850"
pyth_feed_id_xrp = "0xec5d399846a9209f3fe5881d70aae9268c94339ff9817e8d18ff19fa05eea1c8"
pyth_feed_id_yfi = "0x425f4b198ab2504936886c1e93511bb6720fbcf2045a4f3c0723bb213846022f"
Expand Down
113 changes: 113 additions & 0 deletions tomls/omnibus-base-sepolia-andromeda/oracles/pyth-wsteth-r.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
################################################################
# First step is registering the wsteth-steth redemption based feed
################################################################
[invoke.registerPythWstEthStethOracleNode]
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_wsteth_steth_r, false]) %>",
[
],
]
extra.wsteth_steth_r_pyth_oracle_id.event = "NodeRegistered"
extra.wsteth_steth_r_pyth_oracle_id.arg = 0
# Pyth Off-chain Lookup
[invoke.registerLookupWstEthStethOracleNode]
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_wsteth_steth_r, settings.default_staleness_tolerance]) %>",
[
],
]
extra.wsteth_steth_r_lookup_oracle_id.event = "NodeRegistered"
extra.wsteth_steth_r_lookup_oracle_id.arg = 0
# Staleness Node
[invoke.registerWstEthStethOracleNode]
target = ["system.oracle_manager.Proxy"]
func = "registerNode"
args = [
7, # 7 = staleness circuit breaker
"<%= defaultAbiCoder.encode(['uint256'], [settings.default_staleness_tolerance]) %>",
[
"<%= extras.wsteth_steth_r_pyth_oracle_id %>",
"<%= extras.wsteth_steth_r_lookup_oracle_id %>",
],
]
extra.wsteth_steth_r_oracle_id.event = "NodeRegistered"
extra.wsteth_steth_r_oracle_id.arg = 0

################################################################
# Second step is registering the steth-eth redemption based feed
################################################################
[invoke.registerPythStethEthOracleNode]
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_steth_eth_r, false]) %>",
[
],
]
extra.steth_eth_r_pyth_oracle_id.event = "NodeRegistered"
extra.steth_eth_r_pyth_oracle_id.arg = 0
# Pyth Off-chain Lookup
[invoke.registerLookupStethEthOracleNode]
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_steth_eth_r, settings.default_staleness_tolerance]) %>",
[
],
]
extra.steth_eth_r_lookup_oracle_id.event = "NodeRegistered"
extra.steth_eth_r_lookup_oracle_id.arg = 0
# Staleness Node
[invoke.registerStethEthOracleNode]
target = ["system.oracle_manager.Proxy"]
func = "registerNode"
args = [
7, # 7 = staleness circuit breaker
"<%= defaultAbiCoder.encode(['uint256'], [settings.default_staleness_tolerance]) %>",
[
"<%= extras.steth_eth_r_pyth_oracle_id %>",
"<%= extras.steth_eth_r_lookup_oracle_id %>",
],
]
extra.steth_eth_r_oracle_id.event = "NodeRegistered"
extra.steth_eth_r_oracle_id.arg = 0

# Third step combine wsteth/steth * steth/eth * eth/usd to get back the wsteth/usd redemption based price

# step a, do a wsteh/steth * steth/eth
[invoke.registerWstethEthRedemptionNode]
target = ["system.oracle_manager.Proxy"]
func = "registerNode"
args = [
# 1 = reducer node
1,
# 1 parameters: 1 operation = 7 for mul decimal
"<%= defaultAbiCoder.encode(['uint256'], [7]) %>",
# 2 parent: 1 is the eth txn price node id, 2 is the eth oracle node id
["<%= extras.wsteth_steth_r_oracle_id %>", "<%= extras.steth_eth_r_oracle_id %>"],
]
extra.wsteth_eth_r_oracle_id.event = "NodeRegistered"
extra.wsteth_eth_r_oracle_id.arg = 0

# step b, do a step 1 * eth/usd
[invoke.registerWstethUsdRedemptionNode]
target = ["system.oracle_manager.Proxy"]
func = "registerNode"
args = [
# 1 = reducer node
1,
# 1 parameters: 1 operation = 7 for mul decimal
"<%= defaultAbiCoder.encode(['uint256'], [7]) %>",
# 2 parent: 1 is the eth txn price node id, 2 is the eth oracle node id
["<%= extras.wsteth_eth_r_oracle_id %>", "<%= extras.eth_oracle_id %>"],
]
extra.wsteth_usd_r_oracle_id.event = "NodeRegistered"
extra.wsteth_usd_r_oracle_id.arg = 0
4 changes: 2 additions & 2 deletions tomls/omnibus-base-sepolia-andromeda/spot/wsteth.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ fromCall.args = ["<%= extras.synth_wsteth_market_id %>"]
func = "updatePriceData"
args = [
"<%= extras.synth_wsteth_market_id %>",
"<%= extras.wsteth_oracle_id %>",
"<%= extras.wsteth_oracle_id %>",
"<%= extras.wsteth_usd_r_oracle_id %>",
"<%= extras.wsteth_usd_r_oracle_id %>",
"<%= settings.strict_staleness_tolerance %>",
]

Expand Down