Aftermath
  • Aftermath
    • About Aftermath Finance
      • What are we building?
  • Getting Started
    • Creating an account
      • zkLogin
        • Removing a zkLogin account
      • Sui Metamask Snap
      • Native Sui wallets
    • Dynamic Gas
    • Navigating Aftermath
      • Interacting with your Wallet
      • Viewing your Portfolio
      • Changing your Settings
      • Bridge
      • Referrals
  • Trade
    • Smart-Order Router
      • Agg of Aggs
      • Making a trade
      • Exact Out
      • Fees
    • DCA
      • Why should I use DCA
      • How does DCA work
      • Tutorials
        • Creating a DCA order
        • Monitoring DCA progress
        • Advanced Features
      • Fees
      • Contracts
  • Limit Orders
    • Contracts
    • Fees
  • Pools
    • Constant Function Market Maker
      • Tutorials
        • Depositing
        • Withdrawing
        • Creating a Pool
      • Fees
      • Contracts
      • Audit
  • Farms
    • Afterburner Vaults
      • Tutorials
        • Staking into a Farm
        • Claiming Rewards
        • Unstaking
        • Creating a Farm
      • Architecture
        • Vault
        • Stake Position
      • Fees
      • FAQs
  • Liquid Staking
    • afSUI
      • Tutorials
        • Staking
        • Unstaking
      • Architecture
        • Packages & Modules
        • Entry Points
      • Fees
      • FAQs
      • Contracts
      • Audit
  • Perpetuals
    • Aftermath Perpetuals
      • Tutorials
        • Creating an Account
        • Selecting a Market
        • Creating a Market Order
        • Creating a Limit Order
        • Maintaining your Positions
      • Architecture
        • Oracle Prices
        • Margin
        • Account
        • Trading
        • Funding
        • Liquidations
        • Fees
  • GameFi
    • NFT AMM
      • Architecture
        • Fission Vaults
        • AMM Pools
      • Tutorials
        • Buy
        • Sell
        • Deposit
        • Withdraw
      • Sui Overflow
  • Our validator
    • About us
  • Developers
    • Aftermath TS SDK
      • Utils
        • Coin
        • Users Data
        • Authorization
      • Products
        • Prices
        • Router
        • DCA
        • Limit Orders
        • Liquid Staking
        • Pools
        • Farms
    • Aftermath REST API
      • Authorization
  • Egg
    • About Egg
  • Legal
    • Terms of Service
    • Privacy Policy
  • Languages
    • 中文
    • 한국어
  • Links
    • X
    • Telegram
    • Discord
    • Github
    • Medium
    • Aftermath Validator
Powered by GitBook
On this page
  • Installation
  • Quick Start (Aftermath SDK)
  • Advanced Usage (AftermathApi)
  • Available Protocols
  • Limit Orders
  • Rate Limits
  1. Developers

Aftermath TS SDK

Official Aftermath Finance TypeScript SDK for Sui

The Aftermath SDK provides easy access to Aftermath Finance's protocols on the Sui blockchain. Please note that not all of our protocols are on Testnet, but all of them are Mainnet.

Installation

npm i aftermath-ts-sdk

Quick Start (Aftermath SDK)

For most integrations, use the Aftermath SDK for simplified access:

const afSdk = new Aftermath("MAINNET"); // "MAINNET" | "TESTNET"
await afSdk.init(); // initialize provider

// Access protocols
const router = afSdk.Router();
const pools = afSdk.Pools();
const staking = afSdk.Staking();
const farms = afSdk.Farms();
const dca = afSdk.Dca();

Advanced Usage (AftermathApi)

For complex transaction construction, use AftermathApi for direct control:

const afSdk = new Aftermath("MAINNET");
const addresses = afSdk.getAddresses();

const afApi = new AftermathApi(
	new SuiClient({
		transport: new SuiHTTPTransport({
			url: "https://fullnode.mainnet.sui.io",
		}),
	}),
	addresses // Configuration addresses
);

// Access protocol APIs
const poolsApi = afApi.Pools();
const stakingApi = afApi.Staking();
const farmsApi = afApi.Farms();

Available Protocols

Pools (AMM)

  • Automated Market Maker pools for trading

  • Support for stable and uncorrelated assets

  • Up to 8 assets per pool

Router

  • Smart order routing across multiple pools

  • Optimal trade execution via split routes

Staking

  • Liquid staking for SUI tokens

  • Earn yield with afSUI

Farms

  • Yield farming opportunities

  • Stake LP tokens and earn rewards

DCA (Dollar-Cost Averaging)

  • Automated periodic investments

  • Reduce impact of market volatility

Limit Orders

  • Set precise buy or sell conditions

  • Enable automated trades at desired price levels

Rate Limits

Default rate limit: 1000 requests per 10 seconds

For higher limits, contact us via:

PreviousAbout usNextUtils

Last updated 2 months ago

View Pools Documentation
View Router Documentation
View Staking Documentation
View Farms Documentation
View DCA Documentation
Telegram
Discord
X/Twitter
View Limit Order Documentation