use anyhow::Result;
use async_trait::async_trait;
use wp_solana_rpc::RpcContext;
use crate::types::Price;
#[derive(Debug, Clone)]
pub struct Slot0 {
pub sqrt_price: u128,
pub tick_current_index: i32,
pub liquidity: u128,
}
#[async_trait]
pub trait PoolViewer: Send + Sync {
async fn currency_a_price(&self, ctx: &RpcContext) -> Result<Price>;
async fn currency_b_price(&self, ctx: &RpcContext) -> Result<Price>;
async fn liquidity(&self, ctx: &RpcContext) -> Result<u128>;
async fn tick_current_index(&self, ctx: &RpcContext) -> Result<i32>;
async fn sqrt_price(&self, ctx: &RpcContext) -> Result<u128>;
async fn get_slot0(&self, ctx: &RpcContext) -> Result<Slot0>;
}