pancakeswap-bot-router
v1.0.3
Published
OpenClaw skill for AI trading bots to swap tokens on BNB Chain via BscBotRouter (0.01% fee)
Maintainers
Readme
pancakeswap-bot-router 🤖🥞
The ultimate PancakeSwap V2 integration wrapper for AI trading bots, MEV bots, and ElizaOS/OpenClaw agents on BNB Chain.
pancakeswap-bot-router allows you to programmatically route token swaps through our optimized router contract (0xE5F868992b63b7e53d220c1Fa57D869AdD2548e0) on BNB Chain, incurring an ultra-low transaction fee of 0.01% (1 BPS).
Why use pancakeswap-bot-router?
- Ultra-Low Fees: Charges only 0.01% on swaps (PancakeSwap default is 0.25%).
- AI Agent Optimized: Ready to plug into autonomous frameworks like OpenClaw and ElizaOS.
- Robust Support: Supports standard and fee-on-transfer (deflationary/tax) tokens.
- Instant Integration: Single-line method calls for BNB-to-Token, Token-to-BNB, and Token-to-Token swaps.
Installation
npm install pancakeswap-bot-routerUsage
1. Within OpenClaw Skill Framework
Register and execute the skill inside your agent context:
const swapSkill = require('pancakeswap-bot-router');
// Swap 0.1 BNB for USDT
const result = await swapSkill.execute({
action: 'swapBNBForTokens',
bnbAmount: '0.1',
tokenOut: 'USDT',
slippage: 0.5,
}, agentContext);
console.log('Swap completed! Tx:', result.txHash);2. Direct Ethers.js Usage
const { ethers } = require('ethers');
const swapSkill = require('pancakeswap-bot-router');
// Calculate 0.01% fee on 1 BNB input
const feeInfo = await swapSkill.execute({
action: 'calculateFee',
amountIn: ethers.utils.parseEther('1.0').toString(),
});
console.log(`Fee: ${feeInfo.fee} Wei, Swap Amount: ${feeInfo.swapAmount} Wei`);Supported Methods
| Method | Parameters | Description |
|---|---|---|
| swapBNBForTokens | bnbAmount, tokenOut, slippage, recipient, feeOnTransfer | Swaps native BNB for any BSC ERC20 token |
| swapTokensForBNB | tokenIn, amountIn, slippage, recipient, feeOnTransfer | Swaps any ERC20 token for native BNB |
| swapTokensForTokens | tokenIn, tokenOut, amountIn, slippage, recipient, feeOnTransfer | Swaps ERC20 to ERC20 |
| calculateFee | amountIn | Helper to calculate input vs fee amounts |
Live Smart Contract Reference
- DEX Router Address:
0xE5F868992b63b7e53d220c1Fa57D869AdD2548e0(BSC Mainnet) - Contract Verification: BscScan Contract Code
- Underlying DEX: PancakeSwap V2 Router (
0x10ED43C718714eb63d5aA57B78B54704E256024E)
License
MIT
🔍 SEO & Search Tags
- pancakeswap bot router api
- elizaos trading bot script
- arbitrage and mev bot helper bsc
- pancakeswap contract swap javascript
- bsc token swap node.js library
