defituna_client/implementation/market.rs
1use crate::consts::LEVERAGE_ONE;
2use crate::generated::accounts::Market;
3use crate::math::Fixed128;
4use std::fmt;
5
6impl Market {
7 pub fn get_max_leverage(&self) -> Fixed128 {
8 Fixed128::from_num(self.max_leverage) / Fixed128::from_num(LEVERAGE_ONE)
9 }
10}
11
12impl fmt::Display for Market {
13 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
14 write!(f, "pool={}", self.pool.to_string())
15 }
16}