equanetwork-cli 0.0.4

The Equa Network command line interface
//! Stablecoin mints and Pyth feed addresses (reference for VaultUpdate).
//! Keep aligned with `solana-program/src/utility/oracle.rs` (and web-functions params).
#![allow(dead_code)]

use solana_pubkey::{pubkey, Pubkey};

pub const WSOL_MINT: Pubkey = pubkey!("So11111111111111111111111111111111111111112");
pub const USDC_MINT: Pubkey = pubkey!("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v");
pub const EURC_MINT: Pubkey = pubkey!("HzwqbKZw8HxMN6bF2yFZNrht3c2iXXzpKcFu7uBEDKtr");

pub const PYTH_SOL_USD: Pubkey = pubkey!("7UVimffxr9ow1uXYxsr4LHAcV58mLzhmwaeKvJ1pjLiE");
pub const PYTH_USDC_USD: Pubkey = pubkey!("Dpw1EAVrSB1ibxiDQyTAW6Zip3J4Btk2x4SgApQCeFbX");
pub const PYTH_EURC_USD: Pubkey = pubkey!("HyBsZY1UiGttbQ3ppBmnFVss9rmDAEvEbtYxdfjNAqBZ");

#[derive(Debug, Clone, Copy)]
pub struct CollateralAsset {
    pub mint: Pubkey,
    pub price_feed: Pubkey,
    #[allow(dead_code)]
    pub decimals: u8,
}

pub const COLLATERALS: [CollateralAsset; 3] = [
    CollateralAsset {
        mint: WSOL_MINT,
        price_feed: PYTH_SOL_USD,
        decimals: 9,
    },
    CollateralAsset {
        mint: USDC_MINT,
        price_feed: PYTH_USDC_USD,
        decimals: 6,
    },
    CollateralAsset {
        mint: EURC_MINT,
        price_feed: PYTH_EURC_USD,
        decimals: 6,
    },
];

pub fn collateral_by_mint(mint: &Pubkey) -> Option<&'static CollateralAsset> {
    COLLATERALS.iter().find(|c| c.mint == *mint)
}