# Switchboard

## [<mark style="color:blue;">Why Switchboard ?</mark>](https://docs.switchboard.xyz/)

Switchboard provides a trusted execution environment to ensure off-chain oracles are not tempered with.It also allows for developers to deploy custom oracles.

## <mark style="color:blue;">Interface</mark>

### Structs

```rust
struct AggregatorKey has copy, drop, store {}
```

A dynamic field key to store the address of the `switchboard::aggregator::Aggregator` that can that provide data to the oracle.

```rust
 struct SwitchboardFeed has drop {}
```

A witness that is added to the `suitears::oracle::Request` to prove that it collected data from Coin X Oracle's Pyth Network module.&#x20;

### Functions

#### <mark style="color:blue;">report</mark>

**It requests a price from Pyth Network and submits the information to a Coin X oracle request.**&#x20;

```rust
public fun report<Witness: drop>(oracle: &Oracle<Witness>, request: &mut Request, aggregator: &Aggregator)
```

* **@param self.** A `suiterars::oracle::Oracle` with this module's witness.
* **@param request.** A hot potato issued from the `self` to create a `suiterars::oracle::Price`.
* **@param aggregator.** `switchboard::aggregator::Aggregator` that the `self` will use to fetch the price.

**Aborts**

* the `aggregator` is not whitelisted.
* the `aggregator` price is negative or zero.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.interestprotocol.com/overview/deprecated/coin-x-oracle/switchboard.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
