use anyhow::Result;
use async_trait::async_trait;
use solana_client::rpc_response::RpcSimulateTransactionResult;
use solana_sdk::{pubkey::Pubkey, signature::Signature};
use crate::types::token::QuoteData;
#[derive(Debug, Clone)]
pub struct HarvestFeesAndRewardsParams {
pub positions: Vec<Pubkey>,
pub recipient: Pubkey,
}
#[async_trait]
pub trait PoolHarvester: Send + Sync {
async fn get_quote_data(&self, position_mint: &[Pubkey]) -> Result<Vec<QuoteData>>;
async fn harvest_fees_and_rewards(
&self,
params: HarvestFeesAndRewardsParams,
) -> Result<HarvestFeesAndRewardsResult>;
async fn simulate_harvest_fees_and_rewards(
&self,
params: HarvestFeesAndRewardsParams,
) -> Result<HarvestFeesAndRewardsSimulationResult>;
}
#[derive(Clone, Debug)]
pub struct HarvestFeesAndRewardsResult {
pub results: Vec<QuoteData>,
pub signature: Signature,
}
#[derive(Clone, Debug)]
pub struct HarvestFeesAndRewardsSimulationResult {
pub results: Vec<QuoteData>,
pub simulation: RpcSimulateTransactionResult,
}