The Pingu SDK is Live
The Pingu SDK wraps 70+ perpetual markets into five TypeScript classes. Read market data, execute trades, track history.

The Pingu SDK is live.
70+ perpetual markets. Crypto, FX, metals, equities, commodities. Five TypeScript classes. One npm install.
This article covers what the SDK does, how it works, and what you can build with it.
Why a SDK
Pingu is a decentralized perpetuals exchange on Monad. You can trade 70+ markets with no price impact, powered by Pyth Network oracles. The protocol uses an oracle-based architecture: trades execute at spot price, no slippage, no spread, no hidden costs.
Until now, interacting with Pingu programmatically meant working directly with smart contracts, encoding calldata, managing ABIs, and handling low-level blockchain operations. The SDK abstracts all of that into clean, typed methods.
Read market data in three lines. Open a position in five. Close it in one. No ABI, no calldata, no contract addresses to manage.
Whether you are building a trading bot, a portfolio dashboard, an alerting system, or an AI agent, the SDK gives you the same interface: import, connect, build.
What's Inside
@pingu-exchange/sdk wraps the entire Pingu protocol into five classes.
PinguClient
The connection layer. Handles RPC endpoints with automatic failover, wallet management, and contract resolution. Works in read-only mode without a private key.
1import { PinguClient } from "@pingu-exchange/sdk";23// Read-only (no wallet needed)4const client = new PinguClient();56// With a wallet for trading7const client = new PinguClient({ privateKey: process.env.PRIVATE_KEY });
PinguReader
Market data. Funding rates. Open interest. No wallet needed.
1import { PinguClient, PinguReader } from "@pingu-exchange/sdk";23const client = new PinguClient();4const reader = new PinguReader(client);56// Every available market7const markets = await reader.getMarkets();8console.log(`${markets.length} markets`);910// Funding rate for ETH-USD11const funding = await reader.getFundingRate("ETH-USD");1213// Open interest breakdown14const oi = await reader.getOpenInterest("BTC-USD");15console.log(`Longs: $${oi.long} / Shorts: $${oi.short}`);
Three lines to get every market. One more for funding rates. One more for open interest. That's the full read surface.
PinguTrader
Execution. Requires a wallet.
1import { PinguClient, PinguTrader } from "@pingu-exchange/sdk";23const client = new PinguClient({ privateKey: process.env.PRIVATE_KEY });4const trader = new PinguTrader(client);56// Approve USDC (one-time)7await trader.approveUSDC();89// Open 10x long ETH with $100 margin10await trader.submitMarketOrder({11 market: "ETH-USD",12 isLong: true,13 margin: 100,14 leverage: 10,15});1617// Close it18await trader.closePosition({ market: "ETH-USD", isLong: true });
Market orders, limit orders, position closing, order cancellation, margin management. Everything goes through PinguTrader.
PinguGraph
Historical trade data via The Graph. Requires an API key from thegraph.com/studio.
1import { PinguGraph } from "@pingu-exchange/sdk";23const graph = new PinguGraph(process.env.GRAPH_API_KEY);4const stats = await graph.getUserStats("0x...");5console.log(`Win rate: ${stats.winRate}%, PnL: $${stats.totalPnl}`);
Trade history, user stats, position data. Useful for analytics, backtesting, or building leaderboards.
PinguPool
Vault operations. Deposit, withdraw, check balances and fees. The vault is independent from trading but allows users to earn yield on their assets.
1import { PinguPool } from "@pingu-exchange/sdk";23const pool = new PinguPool(client);4const balance = await pool.getUserBalance();5console.log(`LP position: $${balance.total}`);
What You Can Build
The SDK is a building block. Here are some directions it opens up.
Trading Strategies
Funding rate arbitrage. Scan all 70+ markets for funding rate anomalies. When rates diverge significantly from equilibrium, capture the funding payments by opening a position on the right side. The funding rate on Pingu updates every 8 hours. A script that monitors all markets simultaneously spots opportunities a manual trader would miss.
Grid trading. Place a grid of limit orders around current price. Auto-adjust spacing based on volatility. Use funding rates and OI data to bias the grid direction. The SDK handles order placement and cancellation.
DCA and scheduled execution. Automate dollar-cost averaging into perp positions on a schedule. Set it, let it run. Works across any of the 70+ markets.
Mean reversion. Identify when price deviates from a rolling average or VWAP equivalent, then trade the reversion. Combine with OI data to filter for high-conviction setups.
Dashboards and Analytics
Portfolio tracker. Real-time PnL, margin usage, liquidation distance across all open positions. The SDK reads everything you need: positions, prices, funding accrued.
Market scanner. Compare funding rates, open interest, and long/short ratios across all 70+ markets in one view. Spot where the crowd is leaning, where rates are extreme, where liquidity is shifting.
Whale tracker. Use PinguGraph to monitor large traders. Track their positions, win rates, and average trade sizes. Build alerts for when a tracked wallet opens or closes a position.
Leaderboard. Pull trade history and stats from The Graph. Rank traders by PnL, win rate, or volume. Display it on a website, in Discord, or in a Telegram group.
Alerts and Monitoring
Funding rate alerts. Get notified when a market's funding rate exceeds a threshold. Send alerts to Telegram, Discord, email, or any webhook. Useful for manual traders who want to stay informed without watching screens.
OI shift detection. Monitor sudden changes in long/short ratios. A rapid shift in open interest often precedes a move. An alert system built on the SDK can flag these in real time.
Price level monitoring. Track support and resistance levels across multiple markets. Get notified when price approaches a key level. No need to set alerts on 70 separate charts.
DeFi Composability
The SDK uses ethers.js under the hood. Your code can interact with any contract on Monad in the same flow.
Basis trading. Combine Pingu perps with spot DEXs on Monad. Go long spot and short perp (or vice versa) to capture the basis spread. The SDK handles the perp leg, ethers handles the spot leg.
Hedging. If you have spot exposure from another Monad protocol, use Pingu to hedge with a perp short. The SDK makes this a few lines of code.
Community and Social Tools
Telegram or Discord bot. Let your community query market data, check positions, or even execute trades through a chat interface. The SDK provides the data and execution layer; you provide the bot logic.
Copy trading. Use PinguGraph to track a wallet's trades. When the tracked wallet opens a position, mirror it automatically. The SDK handles both the reading (Graph) and the execution (Trader).
Trading competitions. Build a system that tracks participants' PnL over a period. Use PinguGraph for historical data and PinguReader for live positions. Automate results and rankings.
AI Agents
Connect an LLM (or any reasoning engine) to the SDK. Feed it market data, funding rates, OI, and external information. Let it reason about market conditions. The SDK executes its decisions.
The starter kit in the repo includes a working LLM trader skeleton. But AI agents are one use case among many, not the only one. The SDK is useful with or without AI.
Getting Started
Install
1npm install @pingu-exchange/sdk
Requirements: Node.js >= 18. A private key for trading (read-only works without one). A Graph API key for historical data (optional).
Read market data (no wallet needed)
1import { PinguClient, PinguReader } from "@pingu-exchange/sdk";23const client = new PinguClient();4const reader = new PinguReader(client);56const markets = await reader.getMarkets();7const funding = await reader.getFundingRate("ETH-USD");8const oi = await reader.getOpenInterest("BTC-USD");910console.log(`Markets: ${markets.length}`);11console.log(`ETH funding: ${funding}`);12console.log(`BTC OI - Longs: $${oi.long}, Shorts: $${oi.short}`);
Execute a trade
1import { PinguClient, PinguTrader } from "@pingu-exchange/sdk";23const client = new PinguClient({ privateKey: process.env.PRIVATE_KEY });4const trader = new PinguTrader(client);56await trader.approveUSDC();7await trader.submitMarketOrder({8 market: "ETH-USD",9 isLong: true,10 margin: 50,11 leverage: 5,12});
Start read-only. Understand the data. Then connect a wallet with small amounts to test execution. The full API reference is in the SDK README.
Best Practices
Start read-only. Use PinguReader to understand the data before connecting a wallet. Most of the development cycle should happen without touching real funds.
Use small amounts. When you move to live execution, start with $5-10 margin. Scale up only after confirming everything works.
Never hardcode your private key. Always use environment variables. Add .env to .gitignore before your first commit.
Use a dedicated wallet. Create a fresh wallet for your project. Fund it with only what it needs. If the key is compromised, your exposure is limited.
Handle errors. RPC calls fail. Transactions revert. Gas spikes. Catch errors, log them, and decide whether to retry or stop. The SDK has built-in RPC fallback, but your logic should be defensive too.
Build kill switches. Max loss per day, max number of trades, max position size. If something goes wrong, your code should stop, not keep running.
Audit your dependencies. Malicious npm packages targeting crypto wallets exist. Stick to well-known libraries. Run npm audit periodically.
FAQ
Can I use Python?
Your application logic can be in any language. The SDK interaction goes through @pingu-exchange/sdk (TypeScript/JavaScript). You can build a Python app that calls a thin TS wrapper, or use a Python process that communicates with a Node.js service running the SDK.
Do I need real funds?
Not for reading data. PinguReader and PinguGraph work without a wallet or funds. For executing trades, you need USDC on Monad. Bridge from Ethereum or Solana via monadbridge.com.
What markets are available?
70+ perpetual markets across crypto, FX, metals, equities, and commodities. Any asset with a Pyth Network price feed can be traded. Call reader.getMarkets() for the full list.
Where can I ask questions?
Join the Pingu Discord (discord.com/invite/pinguexchange) or open an issue on the SDK repo.
Resources
- SDK: github.com/PinguProtocol/pingu-sdk
- Pingu Exchange: pingu.exchange
- Pingu Discord: discord.com/invite/pinguexchange
- Pyth Network price feeds: pyth.network/price-feeds
- The Graph (for API key): thegraph.com/studio
- Bridge to Monad: monadbridge.com
Questions? Ideas? Need help getting started? Join us on Discord.
The SDK is live. The markets are open. Start building.
Disclaimer: Pingu Exchange is a decentralized perpetuals DEX on Monad. Trade 70+ markets with no price impact, powered by Pyth Network oracles. This article is for informational purposes only and does not constitute financial advice. Trading perpetual futures involves significant risk of loss.
Trade on Pingu
Decentralized perpetuals on Monad. Zero spread, oracle-based execution.
Start tradingReferral Program
Earn up to 20% commission on trading fees. Progressive tiers, instant payouts.
Invite friendsPoints Campaign
Trade and earn $PINGU tokens. Multipliers up to 3x. Weekly leaderboards.
Earn pointsGet weekly insights
Market analysis and research delivered to your inbox.
Telegram Channel
Get instant notifications when new articles drop. Join the Pingu community.
Join Telegram