Skip to content

marsfoundation/xchain-ssr-oracle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XChain SSR Oracle

Reports the Sky Savings Rate (SSR) values across various bridges. This is primarily used as an exchange rate between USDS (USD) and sUSDS for use by DEXs+PSMs in capital efficiency liquidity amplification. Provided the three sUSDS values (ssr, chi and rho) are synced you can extrapolate an exact exchange rate to any point in the future for as long as the ssr value does not get updated on mainnet. Because this oracle does not need to be synced unless the ssr changes, it can use the chain's canonical bridge for maximum security.

Contracts

SSROracleBase

Common functionality shared between the Mainnet and XChain instances of the oracle. Contains convenience functions to fetch the conversion rate at various levels of precision trading off gas efficiency. sUSDS data is compressed into a single word to save SLOAD gas cost.

SSRMainnetOracle

Mainnet instance pulls data directly from the sUSDS as it is on the same chain. It's not clear the use case for this beyond consistency and some gas savings, but it was included none-the-less.

SSRAuthOracle

Oracle receives data from an authorized data provider. This is intended to be one or more bridges which publish data to the oracle. Application-level sanity checks are included when new data is proposed to minimize damage in the event of a bridge being compromised. These sanity checks also enforce event ordering in case messages are relayed out of order. maxSSR is used as an upper bound to prevent exchange rates that are wildly different from reality. It is recommended to sync this oracle somewhat frequently to minimize the damage of a compromised bridge.

Forwarders + Receivers

These are bridge-specific messaging contracts. Forwarders permissionlessly relay sUSDS data. Receivers decode this message and forward it to the SSRAuthOracle. Please note that receivers are generic and part of the xchain-helpers repository.

Supported Chains

  • Optimism
  • Base
  • World Chain
  • Aribitrum One
  • Gnosis Chain

Deployment Instructions

Run make deploy-XXX where XXX is one of the supported networks. Be sure to have the ETH_FROM environment variable set to the deployer address as well as the relevant environment variables set for RPCs and contract verification. You can see contract verification api key names in foundry.toml.

Deployments (USDS)

Base

Forwarder (Ethereum): 0xB2833392527f41262eB0E3C7b47AFbe030ef188E
AuthOracle (Base): 0x65d946e533748A998B1f0E430803e39A6388f7a1
Receiver (Base): 0x212871A1C235892F86cAB30E937e18c94AEd8474
Balancer Rate Provider (Base): 0x49aF4eE75Ae62C2229bb2486a59Aa1a999f050f0

Legacy Deployments (DAI)

World Chain

Forwarder (Ethereum): 0xA34437dAAE56A7CC6DC757048933D7777b3e547B
AuthOracle (World Chain): 0x779053E25267B591Dcfbb20b2397462aaaD6B776
Receiver (World Chain): 0x33a3aB524A43E69f30bFd9Ae97d1Ec679FF00B64
Balancer Rate Provider (World Chain): 0xE206AEbca7B28e3E8d6787df00B010D4a77c32F3

Optimism

Forwarder (Ethereum): 0x4042127DecC0cF7cc0966791abebf7F76294DeF3
AuthOracle (Optimism): 0x33a3aB524A43E69f30bFd9Ae97d1Ec679FF00B64
Receiver (Optimism): 0xE206AEbca7B28e3E8d6787df00B010D4a77c32F3
Balancer Rate Provider (Optimism): 0x15ACEE5F73b36762Ab1a6b7C98787b8148447898

Base

Forwarder (Ethereum): 0x8Ed551D485701fe489c215E13E42F6fc59563e0e
AuthOracle (Base): 0x2Dd2a2Fe346B5704380EfbF6Bd522042eC3E8FAe
Receiver (Base): 0xaDEAf02Ddb5Bed574045050B8096307bE66E0676
Balancer Rate Provider (Base): 0xeC0C14Ea7fF20F104496d960FDEBF5a0a0cC14D0

Arbitrum

Forwarder (Ethereum): 0x7F36E7F562Ee3f320644F6031e03E12a02B85799
AuthOracle (Arbitrum): 0xE206AEbca7B28e3E8d6787df00B010D4a77c32F3
Receiver (Arbitrum): 0xcA61540eC2AC74E6954FA558B4aF836d95eCb91b
Balancer Rate Provider (Arbitrum): 0x73750DbD85753074e452B2C27fB9e3B0E75Ff3B8


The IP in this repository was assigned to Mars SPC Limited in respect of the MarsOne SP