Skip to content

Commit

Permalink
feat: add oracle key (#1841)
Browse files Browse the repository at this point in the history
  • Loading branch information
mustermeiszer authored May 21, 2024
1 parent ba41880 commit 5fc0465
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions libs/types/src/oracles.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use cfg_primitives::{LoanId, PoolId};
use frame_support::pallet_prelude::RuntimeDebug;
use parity_scale_codec::{Decode, Encode, MaxEncodedLen};
use scale_info::TypeInfo;
Expand Down Expand Up @@ -26,10 +27,18 @@ pub type Isin = [u8; 12];
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
pub enum OracleKey {
/// Identify a Isin price
#[codec(index = 0)]
Isin(Isin),

/// Identify a conversion from the first currency to the second one
#[codec(index = 1)]
ConversionRatio(CurrencyId, CurrencyId),

/// Identifies a single pool-loan-id combination.
/// This key is a fallback solution if no other keys are applicable for the
/// given oracle.
#[codec(index = 2)]
PoolLoanId(PoolId, LoanId),
}

impl From<(CurrencyId, CurrencyId)> for OracleKey {
Expand Down

0 comments on commit 5fc0465

Please sign in to comment.