Tour de Whirlpool Tutorial

Overview

What is Tour de Whirlpool?

  • Tour de Whirlpool explains how to create programs that interact with Orca Whirlpools.
  • In this tutorial you will learn how to perform the following operations programmatically.
    • Check balances for SOL and tokens
    • Send SOL and tokens
    • Perform swaps with both SOL and tokens
    • Manage Whirlpools positions
      • Open a position
      • Obtain a list of open positions
      • Check position status
      • Increase a position's liquidity
      • Decrease a position's liquidity
      • Harvest fees and rewards from a position
      • Close a position

Target Audience

  • Previous experience using Solana, Orca, and Whirlpools from the web UI
  • Previous experience with Typescript or a similar language

Tools Used

  • Typescript, for example code
  • Node.js, for running examples
  • Phantom, for Wallet actions
  • Solana CLI is used in tandem with Phantom for some Wallet actions
  • Devnet, for network interactions (It's free!)
  • This tutorial explains how to obtain the tokens used in examples

Source Code

You can find the source code for the tutorial examples in the repo below.

How to get help

Tutorial

Preparation

Basic Wallet Functionality

Swap

  • Swapping Tokens

Position Management

  • Opening a Position
  • Obtaining a List of Open Positions and Checking Position Status
  • Adding Liquidity to a Position
  • Withdrawing Liquidity From a Position
  • Harvesting Fees and Rewards From a Position
  • Closing a Position

Bonus

  • Opening a Position Without Metadata