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

@skate-org/skate-app-amm

v3.2.4

Published

Core SDK for Skate's cross-chain Automated Market Maker (AMM) with NFT-based position management.

Downloads

788

Readme

@skate-org/skate-app-amm

Core SDK for Skate's cross-chain Automated Market Maker (AMM) with NFT-based position management.

Installation

npm install @skate-org/skate-app-amm

Quick Start

import { SkateAmmCoreSDK } from "@skate-org/skate-app-amm";

const sdk = new SkateAmmCoreSDK("PRODUCTION"); // or "STAGING"

Package Structure

src/
├── abi/                          # Smart contract ABIs
│   ├── skate-amm/               # V2 contract ABIs (unified)
│   │   ├── KernelManager.ts     # Core kernel contract
│   │   ├── KernelPool.ts        # Pool contract
│   │   └── PeripheryPool.ts     # Cross-chain periphery
│   └── uniswap/                 # Uniswap V3 compatibility
├── action/                       # Core AMM operations
│   └── kernel.ts                # Position management functions
├── adapter/                      # Protocol adapters
│   ├── kernelManager.ts         # Kernel contract adapter
│   └── peripheryPool.ts         # Periphery contract adapter
├── api/                         # REST API functions
├── deployment/                   # Contract addresses & config
├── types/                       # TypeScript definitions
└── classWrapper.ts              # Main SDK class

Core Actions

Position Management

Get NFT Positions (V2)

import { SkateAmmCoreSDK } from "@skate-org/skate-app-amm";
import { createPublicClient, http } from "viem";
import { base } from "viem/chains";

const sdk = new SkateAmmCoreSDK("PRODUCTION");
const client = createPublicClient({
  chain: base,
  transport: http()
});

// Get all NFT positions for a user
const positions = await sdk.getNFTPositions(client, {
  user: "0x742d35Cc6639C0532fEb96A35d15b3DF1c99dd5F"
});

console.log(positions);
// [{ tokenId: 123n, pool: "0x...", tickLower: -100, tickUpper: 100, liquidity: 1000n }]

Get Pool Information

// Get all available pools
const pools = sdk.getAllPoolInfo();

// Get specific pool by tokens
const pool = sdk.getPoolInfoByTokens(CHAIN.BASE, {
  tokenA: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", // USDC
  tokenB: "0x4200000000000000000000000000000000000006"  // WETH
});

Simulation & Quotes

Swap Simulation

const swapResult = await sdk.simulateSwap(client, {
  kernelPool: "0x...",
  recipient: "0x..." // bytes32 format
  zeroForOne: true,
  amountSpecified: 1000000n, // 1 USDC (6 decimals)
  sqrtPriceLimitX96: 0n
});

console.log(`Amount out: ${swapResult.amount1}`);

Get Swap Quote

const quote = await sdk.getSwapQuote(CHAIN.BASE, {
  tokenA: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", // USDC
  tokenB: "0x4200000000000000000000000000000000000006", // WETH
  amount: 1000000n,
  slippageLimit: 0.01 // 1%
});

if (quote.success) {
  console.log(`Expected output: ${quote.expectedAmountOut}`);
}

Contract Interactions

Generate Transaction Calldata

// Swap calldata for KernelManager
const swapCalldata = sdk.getSwapCalldata({
  kernelPool: "0x...",
  bytes32Recipient: "0x...",
  bytes32User: "0x...",
  actionId: "0x...",
  srcChainId: 8453, // Base
  srcVmType: 1,     // EVM
  destChainId: 42161, // Arbitrum
  destVmType: 1,      // EVM
  zeroForOne: true,
  amount: 1000000n,
  sqrtPriceLimitX96: 0n
});

// Periphery swap calldata
const peripherySwapCalldata = sdk.getPeripherySwapCalldata({
  recipient: "0x...", // bytes32
  destChainId: 42161,
  destVmType: 1,
  zeroForOne: true,
  amount: 1000000n,
  sqrtPriceLimitX96: 0n,
  minAmountOut: 900000n,
  deadline: BigInt(Math.floor(Date.now() / 1000) + 3600) // 1 hour
});

Mint Position Calldata

const mintCalldata = sdk.getPeripheryMintCalldata({
  recipient: "0x...", // bytes32
  tickLower: -200,
  tickUpper: 200,
  amount0: 1000000n, // USDC
  amount1: 500000000000000000n, // 0.5 WETH
  amount0Min: 950000n,
  amount1Min: 475000000000000000n,
  deadline: BigInt(Math.floor(Date.now() / 1000) + 3600)
});

API Integration

// Get swap quote via API (includes transaction instructions)
const apiQuote = await sdk.apiGetSwapQuote({
  amount: 1000000n,
  srcChainId: CHAIN.BASE,
  tokenA: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", // USDC
  tokenB: "0x4200000000000000000000000000000000000006", // WETH
  user: "0x742d35Cc6639C0532fEb96A35d15b3DF1c99dd5F",
  recipient: "0x742d35Cc6639C0532fEb96A35d15b3DF1c99dd5F",
  slippageLimit: 0.01
});

// Returns transaction calldata for the specific chain
console.log(apiQuote.payload.calldata);

Chain Support

import { CHAIN, VM } from "@skate-org/skate-app-amm";

// Supported chains
CHAIN.ETHEREUM    // 1
CHAIN.ARBITRUM    // 42161
CHAIN.BASE        // 8453
CHAIN.SOLANA      // 901
CHAIN.ECLIPSE     // 902
CHAIN.SUI         // 1001

// VM Types
VM.EVM  // 1 - Ethereum Virtual Machine
VM.SVM  // 3 - Solana Virtual Machine
VM.SuiVM // 4 - Sui Virtual Machine

Environment Configuration

// Production (mainnet)
const mainnetSDK = new SkateAmmCoreSDK("PRODUCTION");

// Staging (testnet)
const testnetSDK = new SkateAmmCoreSDK("STAGING");

Advanced Usage

See CHANGELOG.md for detailed migration guide.