npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@vertigo-amm/vertigo-sdk

v2.0.6

Published

Official TypeScript SDK for the Vertigo AMM protocol on Solana

Readme

Vertigo SDK v2.0

npm version License: MIT Documentation

✨ Features

  • 🎯 Simple & Intuitive API - Get started in minutes with our high-level client
  • 🔧 Modular Architecture - Use only what you need with tree-shakeable exports
  • ⚡ High Performance - Optimized for speed with smart caching and batching
  • 🔐 Type Safety - Full TypeScript support with comprehensive type definitions
  • 📊 Real-time Data - Built-in API client for market data and analytics
  • 🛠️ Developer Tools - Rich utilities for common blockchain operations
  • 📱 Wallet Integration - Works seamlessly with all major Solana wallets
  • 🔄 Auto-retry Logic - Robust error handling and automatic retries

📦 Installation

yarn add @vertigo-amm/vertigo-sdk
# or
npm install @vertigo-amm/vertigo-sdk
# or
bun install @vertigo-amm/vertigo-sdk

🚀 Quick Start

Basic Usage (Read-Only)

import { Vertigo } from "@vertigo-amm/vertigo-sdk";
import { Connection } from "@solana/web3.js";

// Initialize SDK without wallet (read-only)
const vertigo = await Vertigo.load({
  connection: new Connection("https://api.mainnet-beta.solana.com"),
  network: "mainnet",
});

// Find pools for a token pair
const pools = await vertigo.pools.findPoolsByMints(SOL_MINT, USDC_MINT);

// Get swap quote
const quote = await vertigo.swap.getQuote({
  inputMint: SOL_MINT,
  outputMint: USDC_MINT,
  amount: 1_000_000_000, // 1 SOL
  slippageBps: 50,
});

With Wallet (Full Features)

import { Vertigo } from "@vertigo-amm/vertigo-sdk";
import { Connection, Keypair } from "@solana/web3.js";
import * as anchor from "@coral-xyz/anchor";

// Initialize with wallet
const wallet = new anchor.Wallet(keypair);
const vertigo = await Vertigo.load({
  connection: new Connection("https://api.mainnet-beta.solana.com"),
  wallet,
  network: "mainnet",
});

// Execute a swap
const result = await vertigo.swap.swap({
  inputMint: SOL_MINT,
  outputMint: USDC_MINT,
  amount: 1_000_000_000,
  options: {
    slippageBps: 100,
    priorityFee: "auto",
  },
});

console.log(`Swap successful: ${result.signature}`);

📚 Core Modules

🏊 Pool Client

Manage liquidity pools and fetch pool data:

// Create a new pool
const { poolAddress } = await vertigo.pools.createPool({
  mintA: SOL_MINT,
  mintB: TOKEN_MINT,
  initialMarketCap: 10_000_000_000,
  royaltiesBps: 250,
});

// Get pool information
const pool = await vertigo.pools.getPool(poolAddress);

// Get all pools
const pools = await vertigo.pools.getPools();

// Find pools by tokens
const pools = await vertigo.pools.findPoolsByMints(mintA, mintB);

// Get pool statistics
const stats = await vertigo.pools.getPoolStats(poolAddress);

💱 Swap Client

Execute token swaps with advanced features:

// Get swap quote
const quote = await vertigo.swap.getQuote({
  inputMint: SOL_MINT,
  outputMint: USDC_MINT,
  amount: 1_000_000_000,
  slippageBps: 50,
});

// Simulate swap to check for errors
const simulation = await vertigo.swap.simulateSwap({
  inputMint: SOL_MINT,
  outputMint: USDC_MINT,
  amount: 1_000_000_000,
});

// Execute swap
const result = await vertigo.swap.swap({
  inputMint: SOL_MINT,
  outputMint: USDC_MINT,
  amount: 1_000_000_000,
  options: {
    slippageBps: 100,
    wrapSol: true,
    priorityFee: "auto",
  },
});

🏗️ Pool Authority Client

Advanced pool management for authorized users:

import { PoolAuthority } from "@vertigo-amm/vertigo-sdk";

// Initialize Pool Authority client
const poolAuth = await PoolAuthority.load({
  connection,
  wallet,
});

// Create pools with authority permissions
// Note: Token factory features are under development

📊 API Client

Access market data and analytics:

// Get pool statistics
const stats = await vertigo.api.getPoolStats(poolAddress);

// Get trending pools
const trending = await vertigo.api.getTrendingPools("24h", 10);

// Get token information
const tokenInfo = await vertigo.api.getTokenInfo(mintAddress);

// Subscribe to pool updates
const unsubscribe = vertigo.api.subscribeToPool(poolAddress, {
  onUpdate: (data) => console.log("Pool update:", data),
});

🛠️ Utility Functions

The SDK includes rich utilities for common operations:

import {
  formatTokenAmount,
  parseTokenAmount,
  getOrCreateATA,
  estimatePriorityFee,
  retry,
  getExplorerUrl,
  createTokenMetadata,
} from "@vertigo-amm/vertigo-sdk";

// Format token amounts
const formatted = formatTokenAmount(amount, decimals, 4);

// Parse user input
const amount = parseTokenAmount("1.5", 9);

// Get or create token accounts
const { address, instruction } = await getOrCreateATA(connection, mint, owner);

// Estimate network fees
const fee = await estimatePriorityFee(connection, 75);

// Retry with exponential backoff
const result = await retry(() => fetchData(), { maxRetries: 3 });

// Get explorer links
const url = getExplorerUrl(signature, "mainnet", "solscan");

// Create token metadata for token factories
const metadata = createTokenMetadata(
  "My Token",
  "MYTKN",
  "https://example.com/metadata.json"
);

🪙 Token Metadata Helper

When creating tokens with the factory programs, use the createTokenMetadata helper for validation:

import { createTokenMetadata } from "@vertigo-amm/vertigo-sdk";

// Create and validate token metadata
const metadata = createTokenMetadata(
  "My Amazing Token", // name (max 32 characters)
  "MAT",              // symbol (max 10 characters, auto-uppercased)
  "https://example.com/token-metadata.json" // URI to off-chain metadata
);

// Use with token factory launch params
const launchParams = {
  token_config: metadata,
  reference: new anchor.BN(Date.now() / 1000),
  nonce: 0,
};

The helper automatically:

  • ✅ Validates name length (1-32 characters)
  • ✅ Validates symbol length (1-10 characters)
  • ✅ Trims whitespace from all fields
  • ✅ Uppercases the symbol
  • ✅ Ensures URI is provided

⚙️ Advanced Configuration

const vertigo = await Vertigo.load({
  connection,
  wallet,
  network: "mainnet",

  // Custom program addresses
  programs: {
    amm: customAmmAddress,
    factory: customFactoryAddress,
  },

  // API configuration
  apiUrl: "https://api.vertigo.so",

  // Caching settings
  cache: {
    enabled: true,
    ttl: 60000, // 1 minute
  },

  // Transaction settings
  priority: {
    autoFee: true,
    baseFee: 1000,
    maxFee: 1000000,
  },
});

🎯 Examples

Check out our test files for usage examples:

🧪 Running Tests

# Run all tests
npm test

# Run tests in watch mode
npm run test:watch

# Run integration tests
npm run test:integration

# Run full devnet integration test
npm run test:full

# Run devnet tests with various options
npm run test:devnet
npm run test:devnet:verbose

🔄 Migration from v1

If you're upgrading from SDK v1:

// Old (v1)
import { VertigoSDK } from "@vertigo-amm/vertigo-sdk";
const sdk = new VertigoSDK(provider);

// New (v2)
import { Vertigo } from "@vertigo-amm/vertigo-sdk";
const vertigo = await Vertigo.load({ connection, wallet });

// The old SDK is still available for backwards compatibility
import { VertigoSDK } from "@vertigo-amm/vertigo-sdk";

🔗 Network Support

| Network | Status | RPC Endpoint | | -------- | ------------ | ----------------------------------- | | Mainnet | ✅ Supported | https://api.mainnet-beta.solana.com | | Devnet | ✅ Supported | https://api.devnet.solana.com | | Testnet | ✅ Supported | https://api.testnet.solana.com | | Localnet | ✅ Supported | http://localhost:8899 |

📖 Documentation

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

🐛 Support

📄 License

MIT License - see LICENSE for details.