Skip to main content
The Full Sail SDK provides developers with a simple and efficient interface for interacting with the Full Sail protocol. It enables seamless integration of swaps, liquidity management, and governance interactions into external applications, analytics tools, or automated strategies.

Installation

Install the SDK using npm:
Install the SDK using yarn:

Configuration

After you have connected the wallet, you should set senderAddress to your sdk instance

Key Concepts

Gauge

A smart contract that manages staked positions rewards and oSAIL token distribution. Core functions:
  • Position Staking Management: Tracks staked positions, calculates rewards, and enables withdrawal
  • Reward & oSAIL Distribution: Distributes rewards and oSAIL tokens to staked positions. New oSAIL tokens are issued weekly for each epoch
  • Reward Calculation: Calculates earned oSAIL rewards based on staked liquidity and time, and processes reward claims to position owners
  • Fee Collection: Collects and manages fees generated by the associated liquidity pool

Ticks

Discrete price points that define the boundaries of liquidity ranges. Important considerations:
  • Each tick represents a specific price ratio
  • Ticks are spaced at constant intervals determined by the pool’s tick spacing

Pool

Initially created without a gauge. It can be added later to enable reward distribution. There are two pool entities available through the SDK: Chain Pool (Pool.getByIdFromChain()): Contains real-time data directly from the blockchain. Data from this entity is always relevant. Some core/unique properties:
  • currentTickIndex: The tick corresponding to the current price of the pool (determines which liquidity positions are currently active)
  • rewardCoinsInfo: List of reward coins available for this pool
  • currentSqrtPrice: Current sqrt price of the pool
Pool (Pool.getById()): Contains calculated data and metadata from the backend which can be convinient for frontend. It can contain same fields as ChainPool but they may be outdated by a few minutes, especially those that change frequently. Some core/unique properties:
  • gauge_id: Unique identifier for gauge contract related to this pool
Use backend pool for stable metadata and gauge_id, use chain pool for relevant current price and reward data.

Position

Represents a range of prices where you provide liquidity to a pool. If gauge exists for this pool, position should be staked, otherwise it will not receive rewards. Some core properties:
  • tick_lower: The lower bound of your price range (minimum price where your liquidity is active)
  • tick_upper: The upper bound of your price range (maximum price where your liquidity is active)
  • liquidity: The amount of liquidity provided in this price range
  • stake_info: Information about the position stake object within the gauge. Can be undefined if position not staked or no gauge exists for this pool.

Position Rewards

Different position states receive different types of rewards:
  • Position in pool without gauge: Receives pool fees and pool rewards
  • Unstaked position in pool with gauge: Receives nothing
  • Staked position in pool with gauge: Receives oSAIL tokens and pool rewards

oSAIL

oSAIL is the emissions token distributed to staked positions. Each epoch has its own oSAIL token with a specific expiration date - 5 weeks from the start of the epoch. It offers two possible paths: lock it into veSAIL to participate in governance and earn trading fees, or redeem it for liquid SAIL at 50% of the current spot price at time of redemption, paid in USDC. Expired oSAIL can be only locked into veSAIL.

Lock (veSAIL)

Represents voting power and used only for voting. Minted by locking SAIL or oSAIL for a fixed duration. Lock amount multiplied by lock duration determines voting power. isPermanent option commits to the longest available lock period for maximum voting power. Some core properties:
  • permanent: whether lock is permanent or not
  • voting_power: current voting power provided by this lock. Reduces slowly over time if lock is not permanent
  • is_voting_onchain: whether lock is used for voting at current epoch
  • amount: amount of SAIL locked
Locks are transferable, supports merging, splitting, increasing amount/duration. Liquid SAIL unlocks at lock expiration.

Epoch

7-day cycle during which veSAIL holders vote and predict trading volumes for pools.

Voting

veSAIL holders can vote and predict trading volumes for pools for the next epoch. Only pools with gauge can be voted. Voters earn from two sources:
  • Trading fees from voted pools, distributed by prediction accuracy and allocated voting power.

Usage examples

If method name ends with ...Transaction, it returns a transaction that should be signed and executed using your sui client or wallet kit.
Only oSAIL claimed automatically within this transaction. Fees and pool rewards are not.
This method can be used only if position is created before gauge is added to the pool or if gaugeId was not provided when creating the position via Position.openTransaction(). Unstaked positions within a pool with gauge will not receive rewards. Only fees claimed automatically within this transaction. Pool rewards are not.
Only oSAIL claimed automatically within this transaction. Fees and pool rewards are not.
All rewards claimed automatically within this transaction.
This method can be used only if position is not staked.
This method can be used only if position is not staked.
This method claims both fee and pool rewards for unstaked position.
This method can be used only if position is staked.
This method can be used only if position is staked.
This method claims both oSAIL and pool rewards for staked position.
See Aftermath router docs for more details.
Swaps coins directly through smart contract.
Creates lock using SAIL.
Creates lock using oSAIL.
Combines Position.claimOSailTransaction() and Lock.createLockFromOSailTransaction() for convinience.
Increases lock by provided SAIL amount.
Merges two locks into one. If one of the locks is used for voting, votes from this lock will be reset, and user will need to vote again.
Splits lock into two locks by SAIL amount. If lock is used for voting, votes from this lock will be reset, and user will need to vote again.
Transfers lock to another wallet.
Enables isPermanent flag for lock.
Disables isPermanent flag for lock.
Votes using all locks.weight is in abstract units to calculate voting power ratio. It sum can be any value and will be used as 100%. For example you can provide weights [20, 80] or [1, 1] and it will work fine. In case of [20, 80] total weight is 100 (similarly to 100%). First pool will receve 20/100 (20%) of voting power and second pool will receive 80/100 (80%) of voting power. In case of [1, 1] total weight is 2. First pool will receve 1/2 (50%) of voting power and second pool will receive 1/2 (50%) of voting power.volume is predicted volume of pool for next epoch in USD with decimals 6.