[MRC-14] Mars Oracle Upgrade & stATOM Listing

Summary

The aim of this proposal is to enhance the functionality of the oracle contract to support pricing assets with time-weighted average prices (TWAP) derived from pools not paired with OSMO, which is currently not feasible.

In conjunction with this upgrade, this proposal covers the addition of Stride’s stATOM as a collateral asset in Red Bank.

Abstract

This proposal consists of two parts:

  1. Firstly, we propose an upgrade to the Mars oracle contract, which will enable the contract to price assets whose primary liquidity pool (and TWAP source) is not paired with OSMO, such as stATOM/ATOM.
  2. Secondly, we suggest listing Stride’s stATOM as a collateral asset on the Red Bank (more information about Stride here).

Motivation

This upgrade would make the oracle more flexible and allow more assets to be listed on the Red Bank.

Currently, the Red Bank normalizes all prices to OSMO. Given this, and the fact that most pools on Osmosis are paired with OSMO, the initial implementation of the oracle was able to handle only assets where the TWAP came from pools paired with OSMO (i.e. ATOM/OSMO or axlUSDC/OSMO).

Because of this initial implementation, the oracle is limited from reporting prices for assets paired with tokens like ATOM or axlUSDC. Given these limitations, we believe that upgrading the oracle is necessary for Mars at this point. By upgrading the oracle, the Red Bank will become more versatile, enabling it to cater to the diverse needs of users in the Cosmoverse.

With regards to stATOM, we believe this is an ideal asset to be used as collateral and would generate considerable organic demand for the Red Bank. The main reason for this is that, as a liquid staking derivative, stATOM allows users to effectively use a representation of ATOM across DeFi without sacrificing the staking rewards. As such, this removes the current cost of opportunity of using ATOM across DeFi and could catalyze more organic usage for the Red Bank.

Specification

The proposed oracle upgrade will calculate and denominate the price of stATOM back to OSMO using the following equation:

stATOM/OSMO = stATOM/ATOM * ATOM/OSMO

The price of stATOM/ATOM shall be sourced from the on chain geometric TWAP and the TWAP price of ATOM/OSMO shall be sourced from the existing Mars Oracle contract.

For example, if one stATOM is priced at 1.10 ATOM and one ATOM is priced at 13 OSMO, the oracle contract should multiply 1.10 by 13 and price stATOM at 14.3 OSMO.

Risks

As a Peer-to-Pool money market, every asset added to the Red Bank increases the risk to the protocol. Given that these risks could materialize in systemic ways, where one weak asset could have a significant negative impact on the whole protocol, we believe one of the most important tasks of the Martian Council is to balance the addition of new assets with the additional risk assumed by the protocol. As such, we firmly believe these decisions shouldn’t be taken lightly.

Having said that, we believe stATOM is worth incorporating into the Red Bank for the following reasons:

  1. Technical and Centralization Risks: As will be covered in the next sections, stATOM covers most minimum requirements in terms of technical and centralization risks, as suggested in the Risk Framework. The only requirement not met is having a bug bounty program, which the team has plans to implement with ImmuneFi but isn’t live yet.
  2. Oracle Risk: As will be covered in a section further below, we believe the current level of liquidity in the stATOM/ATOM pool, in addition with the proposed LTV for the asset, generate sufficient security guarantees for the price feed.
  3. Market Risk and Parameters: The suggested LTV, deposit cap and other risk parameters for the asset are conservative.
  4. Organic demand: As mentioned previously, we believe this asset will generate organic demand for the Red Bank.

Technical Risk

Metric Requirements Stride
Time Since Launch Minimum stATOM has been operational since September 2022. While it would be preferable for the asset to have been active for at least a year, there are no minimum prerequisites.
Custom Public Audit Ideal Stride has been independently audited by CertiK, Oak, and Informal Systems.
Recent Audit Ideal All of the above audits have occurred within the last 12 months.
No Critical Vulnerabilities Ideal No critical vulnerabilities have been exploited.
Bug Bounty Program Not Met Stride has plans for a 500k STRD Immunefi Bug Bounty program, however it is not live as of writing. Once live, this requirement would be Ideal as it is greater than 0.25% of overall TVL

Centralization Risk

Metric Requirements Stride
Owner Decentralization Minimum Owners can change validator weights, register new zones, and trigger ICQs for updating validator shares after a slashing. A council decides on the appropriate validator weights, and the Stride Foundation multisig (consisting of Aidan, Riley, and Vishal) implements the council’s recommendations.
Admin Decentralization Ideal No upgrade keys - STRD token holders vote for upgrades using the standard Cosmos chain upgrade process.
Other permissioned addresses Ideal No additional permissioned addresses

Market Risk

To use the Risk Framework to determine the LTV of stATOM, we first calculated several risk metrics:

  • Daily 95% Conditional Value-at-Risk (CVaR, 365-days): 10.95%
  • Maximum intraday drawdown (90-day): 10.87%
  • Median 24hr volume (365-day): $17.5k
  • Median 24hr market capitalization (7-day average, 90-days): $5.0m
  • Average high-low percent quoted spread (30-day): 3.08%
  • Amihud’s illiquidity measure (90-day): 0.000003

Based on these quantitative metrics, in the next section we propose the LTV and other associated risk parameters.

Risk Parameters Suggestion

Max Loan-to-Value: 54.5%

Liquidation Loan-to-Value: 55%

Liquidation Bonus: 15%

Deposit Cap: 45,000 stATOM

Borrow Cap: 0 stATOM (won’t be borrowable)

Interest Rate Parameters:

  • Optimal Utilization: 60%
  • Base IR: 0%
  • Slope 1: 10%
  • Slope 2: 300%

Usable as collateral? Yes
Available to borrow? No

Oracle Risk

The prices for the geometric TWAP oracle are obtained directly on-chain and are exposed to the same centralization risks as the security of the Osmosis chain. In the event of an oracle attack, an attacker could deposit stATOM as collateral, inflate its price, and borrow other assets without any intention of repaying them. Conversely, the attacker could deflate the price of stATOM to borrow it at a lower value, also without any intention of repaying the borrowed asset. Both scenarios could result in bad debt for the protocol.

While some of these risks will always be present, we believe they are mitigated by:

  • There’s currently 12M in liquidity in the stATOM/ATOM pool on Osmosis, from where the price of stATOM will be retrieved (and an average of 8M over the last 60 days). We believe this level of liquidity, coupled with the proposed LTV, offers a sufficient level of manipulation resistance for the feed. For instance, a 30 block (~3 minutes, conservative) upwards price manipulation attack, without any arbitrage (very conservative as it makes the attack cheaper and there’s a clear arbitrage opportunity for stATOM) would require a minimum of ~100M USD worth of ATOM to perform profitably. Additionally, it would require that the attacker holds stATOM as collateral in excess of the current deposit cap.
  • The deposit cap both reduces the size of a potential attack and mitigates an attacker being able to amass a significant synthetic stATOM position by looping the asset multiple times (see here for an example of the attack).
  • Given that stATOM won’t be borrowable, the attack vector where the price is artificially reduced wouldn’t be exploitable.

For the above reasons, we believe the proposed oracle implementation for stATOM is robust.

Implementation

This is a signaling proposal. If passed, the Mars Builders Multisig will execute the following actions at the Osmosis Outpost:

  • Migrate the oracle contract to version v1.0.1, which adds the logic for calculating the price of Stride stAssets. Find the relevant source code here.

  • Execute the oracle contract with the following message to configure the price source for stATOM:

{

"set_price_source": {

"denom": "ibc/C140AFD542AE77BD7DCC83F13FDD8C5E5BB8C4929785E6EC2F4C636F98F17901",

"price_source": {

"staked_grometric_twap": {

"transitive_denom": "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2",

"pool_id": 803,

"window_size": 1800,

"downtime_detector": {

"downtime": "duration30m",

"recovery": 7200

}

}

}

}

}

* Execute [the Red Bank contract](https://www.mintscan.io/osmosis/wasm/contract/osmo1c3ljch9dfw5kf52nfwpxd2zmj2ese7agnx0p9tenkrryasrle5sqf3ftpg) with the following message to initialize the stATOM market:

{

"init_asset": {

"denom": "ibc/C140AFD542AE77BD7DCC83F13FDD8C5E5BB8C4929785E6EC2F4C636F98F17901",

"params": {

"reserve_factor": "0.2",

"max_loan_to_value": "0.545",

"liquidation_threshold": "0.55",

"liquidation_bonus": "0.15",

"interest_rate_model": {

"optimal_utilization_rate": "0.6",

"base": "0",

"slope_1": "0.1",

"slope_2": "3"

},

"deposit_enabled": true,

"borrow_enabled": false,

"deposit_cap": "45000000000"

}

}

}

Resources

The data from this proposal was sourced from CoinGecko, DefiLlama, and Osmosis.

Disclaimers/Disclosures

This proposal is being made by Delphi Labs Ltd., a British Virgin Islands limited company. Delphi Labs engages in incubation, investment, research and development relevant to multiple ecosystems and protocols, including the Mars Protocol. Delphi Labs and certain of its service providers and equity holders own MARS tokens and have financial interests related to this proposal. Additionally, Delphi Labs is one of several entities associated with one another under the “Delphi Digital” brand. Delphi Digital’s associated entities and/or equityholders or service providers of such entities may hold MARS and may have financial interests related to this proposal. All such entities, service providers, equity holders and other related persons may also have financial interests in complementary or competing projects or ecosystems, entities or tokens, including Osmosis/OSMO. These statements are intended to disclose relevant facts and to help identify potential conflicts of interest, and should not be misconstrued as a complete description of all relevant interests or conflicts of interests; nor should they be construed as a recommendation to purchase or acquire any token or security.

This proposal is also subject to and qualified by the Mars Disclaimers/Disclosures. Delphi Labs may lack access to all relevant facts or may have failed to give appropriate weighting to available facts. Delphi Labs is not making any representation, warranty or guarantee regarding the accuracy or completeness of the statements herein, and Delphi Labs shall have no liability in the event of losses or damages ensuing from approval or rejection or other handling of the proposal. Each user and voter should undertake their own research and make their own independent interpretation and analysis of all relevant facts and issues to arrive at their own personal determinations of how to vote on the proposal.

5 Likes

Agree with this due to the emergence of LSD protocols in Cosmos. With this in mind, would the above enable other LSD protocols to onboard to Mars in a similar manner?
One protocol ramping up that I know of is Quicksilver (qAssets). I’m sure there are more, and more will follow

3 Likes

Yeah exactly, this opens the door for other LSDs to be potentially incorporated to the Red Bank as well!

1 Like

Why not just add stOSMO too to this proposal?

1 Like

Unfortunately, stOSMO/OSMO pool is currently shallow in terms of liquidity (~$3.6M) to be used as the source for the TWAP.

1 Like

We are supporting this proposal as it eliminates the urge to compete with an assets’s native staking yield.