use anchor_client::Cluster;
use anchor_lang::prelude::Pubkey;
use jup_lend_sdk::borrow::instructions::get_liquidate_ix;
use std::str::FromStr;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let rpc_url =
        dotenv::var("RPC_URL").unwrap_or("https://api.mainnet-beta.solana.com".to_string());
    let cluster = Cluster::from_str(rpc_url.as_str())?;

    let liquidate = get_liquidate_ix(
        1,
        100,
        0,
        true,
        Pubkey::new_unique(),
        Pubkey::new_unique(),
        cluster,
    )
    .await?;

    dbg!(&liquidate);

    Ok(())
}
