defituna-client 3.6.10

Rust client to interact with DefiTuna's on-chain program.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::consts::LEVERAGE_ONE;
use crate::generated::accounts::Market;
use std::fmt;

impl Market {
    pub fn get_max_leverage(&self) -> f64 {
        self.max_leverage as f64 / LEVERAGE_ONE as f64
    }
}

impl fmt::Display for Market {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "pool={}", self.pool.to_string())
    }
}