Learn how to test your Saros SDK integrations on Solana Devnet with real transactions.
Solana Devnet is a replica of the main Solana blockchain specifically for testing and development. It provides all the functionality of mainnet but with fake SOL tokens, making it perfect for testing your Saros SDK integrations without risking real funds.
Primary endpoint for Solana Devnet
https://api.devnet.solana.com
Alternative endpoints for better reliability
https://solana-devnet.g.alchemy.com/solana/v1/xyz123
Get free SOL for testing on Devnet
https://solfaucet.com/
Airdrop SOL to your wallet using the Solana CLI
solana airdrop 1 <WALLET_ADDRESS> --url devnet
Get common test SPL tokens like USDC, USDT, etc.
https://spl-token-faucet.com/
Create your own custom SPL tokens for testing.
spl-token create-token --url devnet
Create a new token on Devnet
spl-token create-token --url devnet
Get test tokens for development
https://spl-token-faucet.com/
# Install Solana CLI sh -c "$(curl -sSfL https://release.solana.com/stable/install)" # Set cluster to devnet solana config set --url devnet # Confirm your configuration solana config get
solana config set --url devnet
# Create a new wallet solana-keygen new --outfile devnet-wallet.json # Set the wallet as default solana config set --keypair devnet-wallet.json # Airdrop SOL to your wallet solana airdrop 1 # Check your balance solana balance
solana airdrop 1
# Install SPL Token CLI npm install -g @solana/spl-token # Create a new token spl-token create-token --url devnet # Create an account for the token spl-token create-account <TOKEN_MINT_ADDRESS> --url devnet # Mint tokens to your account spl-token mint <TOKEN_MINT_ADDRESS> 1000 --url devnet # Check your token balance spl-token balance <TOKEN_MINT_ADDRESS> --url devnet
spl-token create-token --url devnet
import { Connection, clusterApiUrl } from '@solana/web3.js'; import { genConnectionSolana } from '@saros-finance/sdk'; // Method 1: Using clusterApiUrl const connection = new Connection(clusterApiUrl('devnet')); // Method 2: Using Saros SDK utility const connection = genConnectionSolana(); // Automatically connects to devnet in development // Method 3: Using custom endpoint const connection = new Connection('https://api.devnet.solana.com');
clusterApiUrl('devnet')
Create separate wallets specifically for Devnet testing to avoid confusion with mainnet wallets.
Keep track of the tokens, pools, and accounts you create during testing for reproducibility.
Test scenarios like insufficient funds, slippage limits, and network failures to ensure your application handles them gracefully.
While Devnet SOL is free, it's still good practice to monitor transaction fees to understand costs on mainnet.
Use the Saros Playground to test code snippets before implementing them in your full application. It's already configured to connect to Devnet!