Content-Length: 296554 | pFad | http://github.com/sol-farm/tulipv2-sdk/tree/v0.9.9

BC GitHub - sol-farm/tulipv2-sdk at v0.9.9
Skip to content

sol-farm/tulipv2-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 Cannot retrieve latest commit at this time.

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tulipv2-sdk

Rust sdk for on-chain (cpi) and off-chain (client-side) usage of Tulip V2 vaults, as well as sparse support for Tulip V1 lending programs.

V1 Support

Within the v1 folder you will find a single tulipv1-sdk crate, which provides selected functions, accounts, etc... of v1

Examples

Warning

Unaudited, possibly untested code developers take no responsibility for any (financial, physical, emotional, etc..) damage that results from usage of these libraries.

Usage

Lending Optimizers

Off-Chain Clients

For now this wont compile, but should serve as a sufficient example to get start

use tulipv2_sdk_common;
use tulipv2_sdk_farm;
use solana_sdk::signature::Keypair;
fn main() {
    let rpc = .. // create rpc client
    let kp = Keypair::new();
    let registration_trait = tulipv2_sdk_common::config::lending::usdc::multi_deposit::ProgramConfig::register_deposit_tracking_ix(kp.pubkey());
    let registration_ix = registration_trait.instruction(tulipv2_sdk_farms::Farm::Lending{name: tulipv2_sdk_farms::lending::Lending::MULTI_DEPOSIT}).unwrap();
    let hold_creation_ix = spl_associated_token_account::create_associated_token_account(
        &kp.pubkey(),
        &registration_trait.deposit_tracking_pda(),
        &registration_trait.shares_mint(),
    );
    let mut tx = Transaction::new_with_payer(&[hold_creation_ix, registration_ix], Some(&kp.pubkey()));
    tx.sign(&vec![&kp], rpc.get_latest_blockhash().unwrap();)
    let sig = rpc.send_and_confirm_transaction(&x).unwrap();
    println!("sent deposit tracking registration {}", sig);
}








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/sol-farm/tulipv2-sdk/tree/v0.9.9

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy