🎯SDK Usage Guide

Learn how to use the Yoink SDK to interact with bonding curve tokens on Solana.

Basic Usage

Initializing the SDK

import { YoinkSDK } from "yoink-sdk";
import { Connection, Keypair, LAMPORTS_PER_SOL, PublicKey } from "@solana/web3.js";
import { AnchorProvider } from "@coral-xyz/anchor";
import NodeWallet from "@coral-xyz/anchor/dist/cjs/nodewallet";

// Setup connection and provider
const connection = new Connection("RPC_URL_LINK");
const wallet = new NodeWallet(yourKeypair);
const provider = new AnchorProvider(connection, wallet, { commitment: "confirmed" });

// Initialize SDK
const sdk = new YoinkSDK(provider);

Core Features

πŸ’° Trading Operations

Buy Tokens

Sell Tokens

Get Price Quotes

πŸ“Š Market Data & Analytics

Get Bonding Curve Information

Get Protocol Information

Advanced Features

πŸ”„ Price Monitoring

🎯 Smart Trading with Price Checks

Error Handling

Common Error Patterns

Constants & Utilities

Available Constants

Helper Functions

Best Practices

πŸ” Security

  • Always validate mint addresses before trading

  • Use appropriate slippage settings for market conditions

  • Implement proper error handling for all operations

  • Never expose private keys in code

⚑ Performance

  • Cache bonding curve data when monitoring multiple tokens

  • Use batch requests when possible

  • Implement proper rate limiting to avoid RPC throttling

  • Handle network timeouts gracefully

Next Steps

Last updated