@ponzu_app/sdk
v0.1.2
Published
TypeScript SDK for Ponzu — launch ERC-20 tokens on Ethereum with built-in presales, DEX liquidity, and LP farming in a single transaction
Downloads
301
Maintainers
Readme
⠀⠀⢻⣽⣿⣿⣿⣿⢿⣿⣿⣿⣶⡀⠀⢰⣻⣿⣿⣿⣿⡿⣿⣿⣿⣦⠀⣿⣿⣿⣿⡇⠀⠀⢻⣿⣿⣻⠿⠈⠿⠿⠿⠿⢿⣿⣿⣿⡏⢿⣭⣿⣿⠃⠀⠀⢿⣿⣿⣾⡟
⠀⠀ ⣿⣿⣿⣿⠀⠀⠈⣿⣿⣿⣿⢸⣿⣿⣿⣿⠿⠿⢶⣿⣿⣿⣿⠀⡉⣿⣿⢿⣻⡀⠀⠈⣿⣿⣹⡇⠀⠀⠀⠀⣸⣿⣿⢹⢳⠀⣿⣿⣿⣿⠀⠀⠀⣿⣿⡿⣿⡇
⠀ ⢀⣿⣿⣿⣏⠀⠀⠀⣻⣿⡿⠿⠸⢸⣿⣿⡗⠀⠀⠀⣿⡟⣿⡿⠀⣇⣿⣿⣾⣿⡟⠀⡄⣿⣿⣿⡏⠀⠀⠀⠀⣷⢿⣿⣿⡏⠀⡿⣿⣿⣿⠀⠀⠀⣟⣿⣿⣏⡇
⠀⠀⢸⣾⣿⣿⡏⠀⠀⠀⣾⣿⡿⣿⠈⣻⣿⣿⠇⠀⠀⠀⣸⣷⣿⣷⠀⣿⣿⣿⣿⣿⣿⣷⡇⣿⣿⣇⡇⠀⠀⠀⢸⣿⣿⣿⢫⠀⠀⣹⣿⣿⣿⠀⠀⠀⣿⣿⡿⣿⡇
⠀⠀⢸⣿⣿⣿⡇⠀⠀⠀⣿⣿⣿⣿⠀⣿⣿⣿⡇⠀⠀⠀⣿⣿⣿⡇⠀⣿⣿⣽⣿⣻⣿⣿⣿⣷⣿⣿⡇⠀⠀⠀⣿⣿⣿⣿⡏⠀⠀⣻⣿⣽⣿⠀⠀⠀⣿⣿⣿⣟⡇
⠀⠀⢸⣗⣿⣿⡇⠀⠀⠀⣿⣿⣿⣿⢨⣿⣿⣿⡇⠀⠀⠀⣿⣽⣿⡿⠀⣾⡇⣿⣻⢿⣯⣿⣿⣿⣿⣿⠃⠀⠀⢀⣿⣿⣿⣷⠀⠀⠀⣾⣿⣿⣿⠀⠀⠀⣿⣿⣏⣿⡇
⠀⠀⢸⣷⡿⣷⣵⣶⣾⣿⣿⣿⡿⠋⢸⣿⣿⣿⡇⠀⠀⢸⢿⣿⣶⣇⠀⣿⣿⣿⣿⡎⣿⣿⣿⣿⣿⣿⠀⠀⠀⣷⣧⣿⣿⡗⠀⠀⠀⣽⣿⣿⣿⠀⠀⠀⣿⣿⢿⣿⡇
⠀⠀⢸⣿⣿⣿⡏⠉⠉⠀⠀⠀⠀⠀⢠⣿⣿⣿⡇⠀⠀⢸⣿⣿⣿⣿⢀⣿⣿⣿⣾⣿⡟⡟⣿⣿⣿⣿⠀⠀⢀⣾⣿⣿⣿⠀⠀⠀⠀⠹⣿⡏⣿⠀⠀⠀⡭⣿⢾⣷⡇
⠀⠀⢸⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⡇⠀⠀⢸⣿⣿⣿⣿⢰⣿⣿⣇⣿⠹⣿⣿⢹⣿⣿⠏⠀⠀⣾⣿⣿⣿⡟⠀⠀⠀⠀⢸⣿⣷⣿⠀⠀⠀⣣⣿⣿⣷⡇
⠀⠀⢨⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣧⣀⣀⣠⣿⣿⣧⣯⢸⣿⣿⣿⣼⠀⠹⣿⣿⣿⣺⣿⠀⠀⣿⣿⣿⣿⠀⠀⠀⠀⠀⢸⣿⣻⣿⣄⣀⣀⣿⣿⣾⣿⠃
⠀⠀⢸⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠘⣿⣿⣿⣿⣿⣟⣿⣿⣿⣿⣾⢸⣿⣿⣿⣿⠀⠀⢹⣿⣿⣿⣿⠀⢰⣿⣿⣿⣿⣶⣶⣦⣶⡄⣿⣿⣿⣭⣿⣭⣟⣿⣿⣿⣻⠀
⠀⠀⠚⠛⠛⠛⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠚⠿⠿⠿⠿⠛⠛⠉⠀⠉⠓⠛⠛⠃⠀⠀⠈⠉⠛⠛⠛⠀⠛⠉⠉⠉⠉⠙⠉⠉⠉⠁⠀⠈⠛⠿⠿⠿⠿⠟⠛⠉⠀⠀
@ponzu_app/sdk@ponzu_app/sdk
Launch ERC-20 tokens on Ethereum with a built-in presale, DEX liquidity pool, and LP yield farming — all from a single function call.
Ponzu deploys 9 interdependent smart contracts atomically: token, presale, launcher, distributor, farm, project coordinator, operator, and two NFT contracts (PonzuBottle for presale positions, LiquidityCard for farm stakes). This SDK wraps the entire flow into three typed functions.
Install
npm install @ponzu_app/sdk viem
# or
yarn add @ponzu_app/sdk viemQuick Start
import { createWalletClient, createPublicClient, http } from 'viem'
import { mainnet } from 'viem/chains'
import { privateKeyToAccount } from 'viem/accounts'
import { deploy } from '@ponzu_app/sdk'
const account = privateKeyToAccount('0x...')
const wallet = createWalletClient({ account, chain: mainnet, transport: http() })
const client = createPublicClient({ chain: mainnet, transport: http() })
const result = await deploy(
{
owner: account.address,
tokenName: 'My Token',
tokenSymbol: 'MYTKN',
metadata: 'ipfs://Qm...', // JSON: { image, description, socials }
imageURI: 'ipfs://Qm...', // token logo
},
wallet,
client,
'mainnet',
)
console.log(result.addresses.token) // ERC-20 address
console.log(result.addresses.presale) // presale contract
console.log(result.addresses.farm) // LP staking farmOne transaction. All 9 contracts. Presale opens immediately.
API
deploy(config, wallet, publicClient, network)
Deploys a full Ponzu token system. Returns the transaction hash and all 9 contract addresses.
interface DeployConfig {
owner: Address // receives creator fees
tokenName: string
tokenSymbol: string
metadata: string // IPFS, Arweave, or https://
imageURI: string // token image URI
targetEthRaise?: bigint // default: network minimum (3 ETH mainnet, 0.1 ETH sepolia)
initialBuyAmount?: bigint // dev buy in wei, default 0
vestingDuration?: bigint // default 864000 (10 days)
keyContract?: Address // gated presale, default zero (public)
}
interface DeployResult {
hash: `0x${string}`
addresses: {
project: Address
operator: Address
token: Address // the ERC-20
presale: Address // buy/refund/claim
launcher: Address // creates DEX pool
distributor: Address // reward routing
farm: Address // LP staking
ponzuBottle: Address // presale position NFT
liquidityCard: Address // farm position NFT
}
}Cost: 0.005 ETH creation fee + initialBuyAmount.
calcPricing(targetEthRaise, network)
Calculates the linear pricing curve for a given ETH raise target. Returns start/end prices and the encoded bytes ready to pass to craftPonzu.
import { calcPricing } from '@ponzu_app/sdk'
import { parseEther } from 'viem'
const pricing = calcPricing(parseEther('5'), 'mainnet')
pricing.startPriceWei // price per token at presale start
pricing.endPriceWei // price per token at presale end (10x start)
pricing.pricingStrategyTemplate // keccak256('LinearPricingStrategy')
pricing.pricingStrategyData // ABI-encoded [startPrice, endPrice]Formula: 690,000 tokens sold at a linear curve from startPrice to endPrice, where startPrice = endPrice / 10. The raise equals endPrice * 11 * 690,000 / 20.
If targetEthRaise is below the network minimum (3 ETH mainnet, 0.1 ETH sepolia), it's clamped up.
getAddresses(network)
Returns all deployed Ponzu protocol contract addresses for the given network.
import { getAddresses } from '@ponzu_app/sdk'
const addrs = getAddresses('mainnet')
addrs.ponzuRecipe // factory — calls craftPonzu()
addrs.zamm // ZAMM V4 singleton AMM
addrs.zapEth // ETH → LP tokens in one tx (null if not deployed)
addrs.weth // wrapped ETH
addrs.linearPricingStrategy // pricing template
addrs.ethRewarder // WETH reward distribution
addrs.ponzuVault // protocol treasuryPer-project addresses (token, presale, farm, etc.) are returned by deploy().
Networks
| Network | Chain ID | Min Raise | Status | |---------|----------|-----------|--------| | Ethereum Mainnet | 1 | 3 ETH | Live | | Sepolia Testnet | 11155111 | 0.1 ETH | Testnet |
Token Lifecycle
craftPonzu() → Presale opens → Users buy tokens (rising price curve)
↓
Presale sells out (690,000 tokens)
↓
triggerLaunch() → DEX pool created
↓
Tokens vest over 10 days → early claims recycle
unvested tokens into reward pool
↓
LPs stake → earn trading fees + rewardsFull Skill Reference
For complete interaction patterns (presale buy/refund/claim, swapping, farming, ZapEth):
https://ponzu.app/SKILL.md
License
UNLICENSED
