Struct levana_perpswap_cosmos::contracts::market::spot_price::SpotPriceFeed
source · pub struct SpotPriceFeed {
pub data: SpotPriceFeedData,
pub inverted: bool,
pub volatile: Option<bool>,
}
Expand description
An individual feed used to compose a final spot price
Fields§
§data: SpotPriceFeedData
The data for this price feed
inverted: bool
is this price feed inverted
volatile: Option<bool>
Is this a volatile feed?
Volatile feeds are expected to have frequent and significant price swings. By contrast, a non-volatile feed may be a redemption rate, which will slowly update over time. The purpose of volatility is to determine whether the publich time for a composite spot price should include the individual feed or not. For example, if we have a market like StakedETH_BTC, we would have a StakedETH redemption rate, the price of ETH, and the price of BTC. We’d mark ETH and BTC as volatile, and the redemption rate as non-volatile. Then the publish time would be the earlier of the ETH and BTC publish time.
This field is optional. If omitted, it will use a default based on
the data
field, specifically: Pyth and Sei variants are considered volatile,
Constant, Stride, and Simple are non-volatile.
Trait Implementations§
source§impl Clone for SpotPriceFeed
impl Clone for SpotPriceFeed
source§fn clone(&self) -> SpotPriceFeed
fn clone(&self) -> SpotPriceFeed
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for SpotPriceFeed
impl Debug for SpotPriceFeed
source§impl<'de> Deserialize<'de> for SpotPriceFeed
impl<'de> Deserialize<'de> for SpotPriceFeed
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<SpotPriceFeed> for SpotPriceFeedInit
impl From<SpotPriceFeed> for SpotPriceFeedInit
source§fn from(src: SpotPriceFeed) -> Self
fn from(src: SpotPriceFeed) -> Self
source§impl JsonSchema for SpotPriceFeed
impl JsonSchema for SpotPriceFeed
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 SpotPriceFeed
impl PartialEq for SpotPriceFeed
source§fn eq(&self, other: &SpotPriceFeed) -> bool
fn eq(&self, other: &SpotPriceFeed) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for SpotPriceFeed
impl Serialize for SpotPriceFeed
impl StructuralPartialEq for SpotPriceFeed
Auto Trait Implementations§
impl Freeze for SpotPriceFeed
impl RefUnwindSafe for SpotPriceFeed
impl Send for SpotPriceFeed
impl Sync for SpotPriceFeed
impl Unpin for SpotPriceFeed
impl UnwindSafe for SpotPriceFeed
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