pub enum SpotPriceConfig {
Manual {
admin: Addr,
},
Oracle {
pyth: Option<PythConfig>,
stride: Option<StrideConfig>,
feeds: Vec<SpotPriceFeed>,
feeds_usd: Vec<SpotPriceFeed>,
volatile_diff_seconds: Option<u32>,
},
}
Expand description
Spot price config
Variants§
Manual
Manual spot price
Oracle
External oracle
Fields
pyth: Option<PythConfig>
Pyth configuration, required on chains that use pyth feeds
stride: Option<StrideConfig>
Stride configuration, required on chains that use stride
feeds: Vec<SpotPriceFeed>
sequence of spot price feeds which are composed to generate a single spot price
feeds_usd: Vec<SpotPriceFeed>
if necessary, sequence of spot price feeds which are composed to generate a single USD spot price
volatile_diff_seconds: Option<u32>
How many seconds the publish time of volatile feeds are allowed to diverge from each other
An attacker can, in theory, selectively choose two different publish times for a pair of assets and manipulate the combined price. This value allows us to say that the publish time cannot diverge by too much. As opposed to age tolerance, this allows for latency in getting transactions to land on-chain after publish time, and therefore can be a much tighter value.
By default, we use 5 seconds.
Trait Implementations§
source§impl Clone for SpotPriceConfig
impl Clone for SpotPriceConfig
source§fn clone(&self) -> SpotPriceConfig
fn clone(&self) -> SpotPriceConfig
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for SpotPriceConfig
impl Debug for SpotPriceConfig
source§impl<'de> Deserialize<'de> for SpotPriceConfig
impl<'de> Deserialize<'de> for SpotPriceConfig
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl From<SpotPriceConfig> for SpotPriceConfigInit
impl From<SpotPriceConfig> for SpotPriceConfigInit
source§fn from(src: SpotPriceConfig) -> Self
fn from(src: SpotPriceConfig) -> Self
source§impl JsonSchema for SpotPriceConfig
impl JsonSchema for SpotPriceConfig
source§fn schema_name() -> String
fn schema_name() -> String
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read moresource§impl PartialEq for SpotPriceConfig
impl PartialEq for SpotPriceConfig
source§fn eq(&self, other: &SpotPriceConfig) -> bool
fn eq(&self, other: &SpotPriceConfig) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for SpotPriceConfig
impl Serialize for SpotPriceConfig
impl StructuralPartialEq for SpotPriceConfig
Auto Trait Implementations§
impl Freeze for SpotPriceConfig
impl RefUnwindSafe for SpotPriceConfig
impl Send for SpotPriceConfig
impl Sync for SpotPriceConfig
impl Unpin for SpotPriceConfig
impl UnwindSafe for SpotPriceConfig
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
self
to type T
. The semantics of numeric casting with the as
operator are followed, so <T as As>::as_::<U>
can be used in the same way as T as U
for numeric conversions. Read moresource§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more