# Market

## Oracles Implementation

### Gas Wallets

Gas wallets are used to push data to oracle contracts. To ensure uninterrupted oracle operation, Cooper Labs is maintaining sufficient gas in them. Anyone can monitor the wallets below to ensure they remain adequately funded at all times.

| Blockchain         | Contract Address                                                                                                         |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------ |
| Base               | [0x8cdc088a6b19f58f7613cb65af03c7496adad893](https://basescan.org/address/0x8cdc088a6b19f58f7613cb65af03c7496adad893)    |
| Sonic (Deprecated) | [0xd35087bb5fa7c4d1a87050cabf73ee4f1649f666](https://sonicscan.org/address/0xd35087bb5fa7c4d1a87050cabf73ee4f1649f666)   |
| HyperEVM           | [0x14566aeb825a3f0605eecd65144dacc52d675b36](https://hyperevmscan.io/address/0x14566aeb825a3f0605eecd65144dacc52d675b36) |
| Avalanche          | [0xe9847Afb5564B221A079f66F3EF9cBa6D4954a4b](https://snowscan.xyz/address/0xe9847Afb5564B221A079f66F3EF9cBa6D4954a4b)    |

### Oracles Configuration

Settings that dictate how the oracle computes and updates data.

|                                   |                                                                                                                                                                                                                              |
| --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Pricing Methodology               | Volume Weighted Average Price with Interquartile Range Filter (more details [here](https://www.diadata.org/docs/nexus/reference/pricing-methodologies/vwapir-volume-weighted-average-price-with-interquartile-range-filter)) |
| Deviation (%) & Refresh Frequency | 0.5% & 120 Seconds                                                                                                                                                                                                           |
| Heartbeat                         | 12 Hours                                                                                                                                                                                                                     |

### Assets Data

Available assets on the oracles and the Chainlink AggregatorV3Interface compatible contracts for each asset feed.

{% tabs %}
{% tab title="Avalanche" %}

| Price Feed   | Contract Address                                                                                                           | Type   | Deviation (%) & Refresh Frequency | Hearbeat |
| ------------ | -------------------------------------------------------------------------------------------------------------------------- | ------ | --------------------------------- | -------- |
| USDp/USD     | [0xd826C5F7be24b33Cc825A9b9E9AcD8C5a2bD71F7](https://snowscan.xyz/address/0xd826C5F7be24b33Cc825A9b9E9AcD8C5a2bD71F7#code) | Market | 0.5% & 120 Seconds                | 12 hours |
| sUSDp/USD    | [0x4D165058332a39F2E2C32F438f4897BcF7694Fbd](https://snowscan.xyz/address/0x4D165058332a39F2E2C32F438f4897BcF7694Fbd#code) | Market | 0.5% & 120 Seconds                | 12 hours |
| {% endtab %} |                                                                                                                            |        |                                   |          |

{% tab title="HyperEVM" %}

| Price Feed   | Contract Address                                                                                                              | Type   | Deviation (%) & Refresh Frequency | Hearbeat |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------- | ------ | --------------------------------- | -------- |
| USDp/USD     | [0x2189f3d9Be89808Dfe6C34446FE7aaDA7A5aD1b6](https://hyperevmscan.io/address/0x2189f3d9Be89808Dfe6C34446FE7aaDA7A5aD1b6#code) | Market | 0.5% & 120 Seconds                | 12 hours |
| sUSDp/USD    | [0xdcA437D1492Db6E9438A82Ad31Cab92E2eE159E1](https://hyperevmscan.io/address/0xdcA437D1492Db6E9438A82Ad31Cab92E2eE159E1#code) | Market | 0.5% & 120 Seconds                | 12 hours |
| {% endtab %} |                                                                                                                               |        |                                   |          |

{% tab title="Base" %}

| Price Feed   | Contract Address                                                                                                           | Type   | Deviation (%) & Refresh Frequency | Hearbeat |
| ------------ | -------------------------------------------------------------------------------------------------------------------------- | ------ | --------------------------------- | -------- |
| USDp/USD     | [0x048710167827e4bd7286384653baa0be7d22e638](https://basescan.org/address/0x048710167827e4bd7286384653baa0be7d22e638#code) | Market | 0.5% & 120 Seconds                | 12 hours |
| sUSDp/USD    | [0xA6c34e47088331C0348bFe58fe97314A4567071A](https://basescan.org/address/0xA6c34e47088331C0348bFe58fe97314A4567071A#code) | Market | 0.5% & 120 Seconds                | 12 hours |
| {% endtab %} |                                                                                                                            |        |                                   |          |

{% tab title="Sonic (Deprecated)" %}
{% hint style="warning" %}
USDp & sUSDp price feeds on Sonic are deprecated.
{% endhint %}

| Price Feed    | Contract Address                                                                                                            | Type   | Deviation (%) & Refresh Frequency | Hearbeat |
| ------------- | --------------------------------------------------------------------------------------------------------------------------- | ------ | --------------------------------- | -------- |
| USDp/USD      | [0xf20f32c481ae55531ec3d923c03306d2d6dc294e](https://sonicscan.org/address/0xf20f32c481ae55531ec3d923c03306d2d6dc294e#code) | Market | 0.5% & 120 Seconds                | 12 hours |
| sUSDp/USD     | [0x06d6c926EF90260B71Bb3d9431958b8DA0C365F5](https://sonicscan.org/address/0x06d6c926EF90260B71Bb3d9431958b8DA0C365F5#code) | Market | 0.5% & 120 Seconds                | 12 hours |
| {% endtab %}  |                                                                                                                             |        |                                   |          |
| {% endtabs %} |                                                                                                                             |        |                                   |          |

### Data Sources

{% tabs %}
{% tab title="Base" %}

| Price Feed   | API Endpoint                                                                                             |
| ------------ | -------------------------------------------------------------------------------------------------------- |
| USDp/USD     | [USDp on Base](https://www.diadata.org/app/price/asset/Base/0x76A9A0062ec6712b99B4f63bD2b4270185759dd5/) |
| sUSDp/USD    |                                                                                                          |
| {% endtab %} |                                                                                                          |

{% tab title="Sonic (Deprecated)" %}

| Price Feed | API Endpoint                                                                                               |
| ---------- | ---------------------------------------------------------------------------------------------------------- |
| USDp/USD   | [USDp on Sonic](https://www.diadata.org/app/price/asset/Sonic/0x08417cdb7F52a5021bB4eb6E0deAf3f295c3f182/) |
| sUSDp/USD  |                                                                                                            |

{% hint style="warning" %}
USDp & sUSDp price feeds on Sonic are deprecated.
{% endhint %}
{% endtab %}
{% endtabs %}

## How the Oracle Works

The market-based oracle aggregates trades from decentralized exchanges across multiple chains (Base, Sonic, etc.) using the VWAPIR methodology over a 1-hour window. Price updates are triggered when market prices deviate by 0.5% or every 12 hours as configured [here](#oracles-configuration).

{% hint style="info" %}
The sUSDp/USD value can also be retrieved using the chainlink-compatible adapter [smart contract](#assets-data) for sUSDp/USD.
{% endhint %}
