pub struct COMP;Expand description
Compound (COMP)
Compound is a decentralized finance (DeFi) protocol that allows users to earn interest on their cryptocurrency holdings or borrow against them. The COMP token is the governance token of the Compound protocol.
§Examples
use typed_money::{Amount, Currency, COMP};
let amount = Amount::<COMP>::from_major(10);
assert_eq!(amount.to_major_floor(), 10);
assert_eq!(COMP::CODE, "COMP");
assert_eq!(COMP::SYMBOL, "COMP");Trait Implementations§
Source§impl Currency for COMP
impl Currency for COMP
Source§const DECIMALS: u8 = 18u8
const DECIMALS: u8 = 18u8
Number of decimal places for this currency (e.g., 2 for USD, 0 for JPY)
Source§const NAME: &'static str = "Compound"
const NAME: &'static str = "Compound"
Full currency name (e.g., “US Dollar”, “Euro”, “Bitcoin”)
Source§const REGION: &'static str = "Worldwide"
const REGION: &'static str = "Worldwide"
Geographic region where this currency is primarily used
Source§const CURRENCY_TYPE: CurrencyType = CurrencyType::Cryptocurrency
const CURRENCY_TYPE: CurrencyType = CurrencyType::Cryptocurrency
Type of currency (Fiat, Cryptocurrency, or Commodity)
Source§const INTRODUCED_YEAR: u16 = 2_020u16
const INTRODUCED_YEAR: u16 = 2_020u16
Year when this currency was introduced
Source§const ISO_4217_NUMBER: u16 = 0u16
const ISO_4217_NUMBER: u16 = 0u16
Official ISO 4217 numeric code
Source§const THOUSANDS_SEPARATOR: char = ','
const THOUSANDS_SEPARATOR: char = ','
Character used to separate thousands (e.g., ‘,’ for US, ‘.’ for EU)
Source§const DECIMAL_SEPARATOR: char = '.'
const DECIMAL_SEPARATOR: char = '.'
Character used as decimal separator (e.g., ‘.’ for US, ‘,’ for EU)
Source§const SYMBOL_POSITION: SymbolPosition = SymbolPosition::After
const SYMBOL_POSITION: SymbolPosition = SymbolPosition::After
Position of currency symbol relative to the amount
Source§const SPACE_BETWEEN: bool = true
const SPACE_BETWEEN: bool = true
Whether to include a space between symbol and amount
Source§const VOLATILITY_RATING: VolatilityRating = VolatilityRating::High
const VOLATILITY_RATING: VolatilityRating = VolatilityRating::High
Static volatility rating (Low, Medium, High)
Source§const LIQUIDITY_RATING: LiquidityRating = LiquidityRating::Medium
const LIQUIDITY_RATING: LiquidityRating = LiquidityRating::Medium
Static liquidity rating (Low, Medium, High)
Source§impl Ord for COMP
impl Ord for COMP
Source§impl PartialOrd for COMP
impl PartialOrd for COMP
impl Copy for COMP
impl Eq for COMP
impl StructuralPartialEq for COMP
Auto Trait Implementations§
impl Freeze for COMP
impl RefUnwindSafe for COMP
impl Send for COMP
impl Sync for COMP
impl Unpin for COMP
impl UnwindSafe for COMP
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
Mutably borrows from an owned value. Read more