Oracle

The Oracle exists as a separate contract deployed to it's own network address (VolOracle), that is updated by crank controlled by Imperial and will eventually be updated by some federated system yet devised. For each underlying asset, there is a singleton Oracle, updated with the same Imperial admin authority. These are used by the other Imperial contract (VolPerp) for scoring Positions.

#[account]
pub struct OracleAccount {
    pub data: Oracle,
}

#[derive(Debug, Clone, PartialEq, AnchorSerialize, AnchorDeserialize)]
pub struct Oracle {
    pub name: String,
    pub admin: Pubkey,
    pub volatility_values: Vec<VolatilityIndex>,
    pub last_updated: i64,
}

#[derive(Debug, Clone, PartialEq, AnchorSerialize, AnchorDeserialize)]
pub struct VolatilityIndex {
    /// Denominated to the 10,000th place, i.e. 1.23 = 12300
    pub implied_volatility: i32,
    /// Denominated to the 10,000th place, i.e. 1.23 = 12300
    pub realized_volatility: i32,
    pub time_window: String,
    pub iv_timestamp: i64,
    pub rv_timestamp: i64,
}

Last updated