@shibaswap/sdk) is a TypeScript/JavaScript library that lets you build on top of ShibaSwap V1—a Uniswap V2 fork originally inherited via SushiSwap—using familiar abstractions like Token, Pair, Route, and Trade.
It runs in any JS environment (browsers, Node) and powers both quick hackathon prototypes and production-grade integrations.
Under the hood:
- It swaps in ShibaSwap’s factory and router addresses
- Computes CREATE2 pair addresses offline
- Fetches on-chain reserves via ethers
- Generates all parameters needed to craft router transactions
Quick Start & Installation
This pulls in
@shibaswap/sdk-core and ethers as dependencies.Imports & Initialization
Fetching On-Chain Data
You must supply on-chain data for tokens and pairs.Case 1: Tokens
Case 2: Pairs
Pricing
Mid Price (Direct & Indirect)
Execution Price (with Slippage)
Trading
Router Address:0x03f7724180aa6b939894b5ca4314783b0b36b329
Example: Swap 1 ETH → DAI
Pair Addresses (CREATE2 vs On-Chain)
On-chain:Technical Reference
Pair
Route
Trade
Other Exports
FACTORY_ADDRESS: ShibaSwap V1 Factory AddressINIT_CODE_HASH: For CREATE2 address generationMINIMUM_LIQUIDITY: Protocol-reservedErrors:InsufficientReservesError,InsufficientInputAmountError