Introduction

This guide provides a structured path to working with the Saros Finance SDK on Solana devnet. It covers environment setup, troubleshooting common compatibility issues, and progressively demonstrates how to:

  1. Quickstart – Connect to Solana devnet, load a wallet, and verify Saros SDK functionality.
  2. Token Swap (Optional) – Execute swaps using Saros pools.
  3. Liquidity Provision – Deposit token pairs into Saros pools and receive LP tokens.
  4. Staking – Stake LP tokens into Saros farms.

Following the tutorials in sequence ensures a working development environment and smooth SDK usage.

Quickstart Guide

Overview

This guide describes how to set up a Node.js environment for the @saros-finance/sdk package and verify its functionality on Solana devnet. It includes environment preparation, dependency installation, required module adjustments, a working verification script, and a troubleshooting section.

Prerequisites

Verify installation:

node -v
npm -v
solana --version

Generate and fund a devnet keypair:

solana config set --url https://api.devnet.solana.com
solana-keygen new --outfile ~/.config/solana/id.json
solana airdrop 2
solana balance

Project Setup