#[non_exhaustive]pub enum FeedSource {
Chainlink,
AavePriceCapStable {
source: Address,
underlying_proxy: Address,
price_cap: I256,
},
AaveRatioCap {
source: Address,
base_to_usd_proxy: Address,
ratio_provider: Address,
current_ratio: I256,
max_ratio: I256,
ratio_decimals: u8,
},
AaveSynchronicityPegToBase {
source: Address,
asset_to_peg_proxy: Address,
asset_to_peg_aggregator: Address,
asset_to_peg_answer: I256,
asset_to_peg_decimals: u8,
peg_to_base_proxy: Address,
peg_to_base_aggregator: Address,
peg_to_base_answer: I256,
peg_to_base_decimals: u8,
output_decimals: u8,
},
AaveFixedPrice {
source: Address,
price: I256,
},
MorphoChainlinkV2 {
source: Address,
base_vault_assets: I256,
quote_vault_assets: I256,
scale_factor: I256,
feeds: Vec<MorphoChainlinkFeed>,
},
EulerQuote {
source: Address,
base: Address,
quote: Address,
base_decimals: u8,
quote_decimals: u8,
leg: EulerQuoteLeg,
},
EulerCross {
source: Address,
base: Address,
cross: Address,
quote: Address,
base_decimals: u8,
cross_decimals: u8,
quote_decimals: u8,
base_cross: EulerQuoteLeg,
cross_quote: EulerQuoteLeg,
},
Pyth {
pyth: Address,
price_id: B256,
expo: i32,
conf: u64,
},
RedstonePush {
price_feed: Address,
adapter: Address,
data_feed_id: B256,
},
Custom(OracleSourceDescriptor),
}Expand description
Network source and transform for a registered feed.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Chainlink
Plain Chainlink-compatible proxy with identity answer transform.
AavePriceCapStable
Aave PriceCapAdapterStable source backed by an underlying Chainlink proxy.
Fields
AaveRatioCap
Aave ratio-cap/CAPO source backed by a base-to-USD Chainlink proxy.
Fields
AaveSynchronicityPegToBase
Aave Chainlink synchronicity adapter composing asset-to-peg and peg-to-base feeds.
Fields
AaveFixedPrice
Aave fixed-price source with no Chainlink dependency.
MorphoChainlinkV2
Morpho Blue MorphoChainlinkOracleV2 source composed from Chainlink feeds and optional vault conversions.
Fields
quote_vault_assets: I256Latest quote-vault conversion factor, or 1 when no quote vault is configured.
feeds: Vec<MorphoChainlinkFeed>Non-zero Chainlink feed dependencies.
EulerQuote
Euler quote source backed by a single leg.
Fields
leg: EulerQuoteLegQuote leg.
EulerCross
Euler CrossAdapter quote source backed by two quote legs.
Pyth
Pyth EVM price feed keyed by a shared Pyth contract and per-feed price id.
Fields
RedstonePush
redstone only.RedStone push price feed backed by an on-chain adapter/event source.
Fields
Custom(OracleSourceDescriptor)
Adapter-owned oracle source.
Implementations§
Source§impl FeedSource
impl FeedSource
Sourcepub fn aave_price_cap_stable(
source: Address,
underlying_proxy: Address,
price_cap: I256,
) -> Self
pub fn aave_price_cap_stable( source: Address, underlying_proxy: Address, price_cap: I256, ) -> Self
Construct an Aave capped stable source transform.
Sourcepub fn aave_ratio_cap(
source: Address,
base_to_usd_proxy: Address,
ratio_provider: Address,
current_ratio: I256,
max_ratio: I256,
ratio_decimals: u8,
) -> Self
pub fn aave_ratio_cap( source: Address, base_to_usd_proxy: Address, ratio_provider: Address, current_ratio: I256, max_ratio: I256, ratio_decimals: u8, ) -> Self
Construct an Aave ratio-cap/CAPO source transform.
Sourcepub fn aave_synchronicity_peg_to_base(
source: Address,
asset_to_peg_proxy: Address,
asset_to_peg_aggregator: Address,
asset_to_peg_answer: I256,
asset_to_peg_decimals: u8,
peg_to_base_proxy: Address,
peg_to_base_aggregator: Address,
peg_to_base_answer: I256,
peg_to_base_decimals: u8,
output_decimals: u8,
) -> Self
pub fn aave_synchronicity_peg_to_base( source: Address, asset_to_peg_proxy: Address, asset_to_peg_aggregator: Address, asset_to_peg_answer: I256, asset_to_peg_decimals: u8, peg_to_base_proxy: Address, peg_to_base_aggregator: Address, peg_to_base_answer: I256, peg_to_base_decimals: u8, output_decimals: u8, ) -> Self
Construct an Aave peg-to-base synchronicity source transform.
Sourcepub fn aave_fixed_price(source: Address, price: I256) -> Self
pub fn aave_fixed_price(source: Address, price: I256) -> Self
Construct an Aave fixed-price source.
Sourcepub fn morpho_chainlink_v2(
source: Address,
base_vault_assets: I256,
quote_vault_assets: I256,
scale_factor: I256,
feeds: Vec<MorphoChainlinkFeed>,
) -> Self
pub fn morpho_chainlink_v2( source: Address, base_vault_assets: I256, quote_vault_assets: I256, scale_factor: I256, feeds: Vec<MorphoChainlinkFeed>, ) -> Self
Construct a Morpho Blue Chainlink V2 source transform.
Sourcepub fn euler_quote(
source: Address,
base: Address,
quote: Address,
base_decimals: u8,
quote_decimals: u8,
leg: EulerQuoteLeg,
) -> Self
pub fn euler_quote( source: Address, base: Address, quote: Address, base_decimals: u8, quote_decimals: u8, leg: EulerQuoteLeg, ) -> Self
Construct an Euler quote source backed by one quote leg.
Sourcepub fn euler_cross(
source: Address,
base: Address,
cross: Address,
quote: Address,
base_decimals: u8,
cross_decimals: u8,
quote_decimals: u8,
base_cross: EulerQuoteLeg,
cross_quote: EulerQuoteLeg,
) -> Self
pub fn euler_cross( source: Address, base: Address, cross: Address, quote: Address, base_decimals: u8, cross_decimals: u8, quote_decimals: u8, base_cross: EulerQuoteLeg, cross_quote: EulerQuoteLeg, ) -> Self
Construct an Euler cross-adapter source backed by two quote legs.
Sourcepub fn pyth(pyth: Address, price_id: B256, expo: i32, conf: u64) -> Self
pub fn pyth(pyth: Address, price_id: B256, expo: i32, conf: u64) -> Self
Construct a Pyth EVM source.
Sourcepub fn redstone_push(
price_feed: Address,
adapter: Address,
data_feed_id: B256,
) -> Self
Available on crate feature redstone only.
pub fn redstone_push( price_feed: Address, adapter: Address, data_feed_id: B256, ) -> Self
redstone only.Construct a RedStone push source.
Sourcepub fn custom(descriptor: OracleSourceDescriptor) -> Self
pub fn custom(descriptor: OracleSourceDescriptor) -> Self
Construct an adapter-owned custom source.
Custom sources participate in Chainlink-style proxy reconciliation
by default: Self::supports_proxy_reconciliation returns true
for Custom, so reconciliation reads
OracleSourceDescriptor::read_proxy with latestRoundData() after
every accepted event (and during crate::OracleTracker::reconcile).
The read_proxy address therefore must answer latestRoundData()
or reconciliation will fail with crate::OracleError::Provider.
There is currently no per-descriptor flag to opt a custom source out
of this path — if the source is not Chainlink-shaped, point
read_proxy at a contract that exposes a Chainlink-compatible
latestRoundData() view for it.
Sourcepub fn is_identity(&self) -> bool
pub fn is_identity(&self) -> bool
Return true when this source is a plain identity Chainlink source.
Sourcepub fn uses_builtin_chainlink_handler(&self) -> bool
pub fn uses_builtin_chainlink_handler(&self) -> bool
Return true when the built-in Chainlink reactive handler should route this source.
Sourcepub fn supports_proxy_reconciliation(&self) -> bool
pub fn supports_proxy_reconciliation(&self) -> bool
Return true when this source can be reconciled by reading a Chainlink proxy.
Sources that fail this predicate are either reconciled through their
own protocol view (see Self::supports_derived_reconciliation) or
not reconciled at all.
Sourcepub fn supports_derived_reconciliation(&self) -> bool
pub fn supports_derived_reconciliation(&self) -> bool
Return true when this source is reconciled by reading its own protocol view instead of a Chainlink proxy.
Morpho MorphoChainlinkOracleV2 sources re-read price() and Euler
quote/cross sources re-read getQuote(one base unit, base, quote);
both promote event-derived snapshots to Confirmed/Corrected through
crate::OracleTracker::reconcile_derived_pending_with. Each family
only participates when its adapter feature (morpho / euler) is
enabled, so builds without the feature never queue derived requests
they cannot serve.
Sourcepub fn read_proxy(&self, registration_proxy: Address) -> Address
pub fn read_proxy(&self, registration_proxy: Address) -> Address
Proxy that should be read for authoritative Chainlink round data.
Sourcepub fn event_aggregators(
&self,
current_aggregator: Option<Address>,
) -> Vec<Address>
pub fn event_aggregators( &self, current_aggregator: Option<Address>, ) -> Vec<Address>
Aggregators whose Chainlink events should drive this source.
Sourcepub fn event_value_source(&self) -> OracleValueSource
pub fn event_value_source(&self) -> OracleValueSource
Source classification for a value produced from this source’s event path.
Sourcepub fn accepts_event_from(
&self,
current_aggregator: Option<Address>,
aggregator: Address,
) -> bool
pub fn accepts_event_from( &self, current_aggregator: Option<Address>, aggregator: Address, ) -> bool
Return true when an event from aggregator is acceptable for this source.
Sourcepub fn wants_answer_updated_from(
&self,
current_aggregator: Option<Address>,
aggregator: Address,
) -> bool
pub fn wants_answer_updated_from( &self, current_aggregator: Option<Address>, aggregator: Address, ) -> bool
Return true when this source should use AnswerUpdated events for aggregator.
Sourcepub fn supports_direct_chainlink_storage_effects(&self) -> bool
pub fn supports_direct_chainlink_storage_effects(&self) -> bool
Return true when Chainlink storage adapters can safely mirror this event.
Sourcepub fn normalize_answer(&self, answer: I256) -> I256
pub fn normalize_answer(&self, answer: I256) -> I256
Apply the source transform to an event or read answer.
Sourcepub fn normalize_answer_from_event(
&self,
aggregator: Option<Address>,
answer: I256,
) -> I256
pub fn normalize_answer_from_event( &self, aggregator: Option<Address>, answer: I256, ) -> I256
Apply the source transform to an answer emitted by a specific dependency aggregator.
Sourcepub fn normalize_round(&self, round: RoundData) -> RoundData
pub fn normalize_round(&self, round: RoundData) -> RoundData
Apply the source transform to round data.
Trait Implementations§
Source§impl Clone for FeedSource
impl Clone for FeedSource
Source§fn clone(&self) -> FeedSource
fn clone(&self) -> FeedSource
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FeedSource
impl Debug for FeedSource
Source§impl Default for FeedSource
impl Default for FeedSource
Source§fn default() -> FeedSource
fn default() -> FeedSource
impl Eq for FeedSource
Source§impl PartialEq for FeedSource
impl PartialEq for FeedSource
impl StructuralPartialEq for FeedSource
Auto Trait Implementations§
impl Freeze for FeedSource
impl RefUnwindSafe for FeedSource
impl Send for FeedSource
impl Sync for FeedSource
impl Unpin for FeedSource
impl UnsafeUnpin for FeedSource
impl UnwindSafe for FeedSource
Blanket Implementations§
Source§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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.