Skip to main content

Withdraw Referrer Fees

1

Import Dependencies

Import the required packages for Solana RPC communication, Kamino SDK operations, and Kit transaction building.
2

Load Market and Initialize RPC

Load the keypair, initialize RPC connections, and load the Kamino market.
3

Check Accumulated Fees

Check all accumulated fees across all tokens.
Check fees for specific reserve (USDC).
4

Build Withdraw Instructions

Generate instructions to withdraw accumulated referral fees for USDC.
5

Send Withdraw Transaction

Fetch the latest blockhash and build the transaction message.
Sign and send the transaction.
Fee withdrawal complete. The accumulated referral fees have been transferred to the referrer wallet.