KalPol Arbi
npx skills add https://github.com/axwelbrand-byte/arbibot --skill polymarket-prediction-marketInstallez cette compétence avec la CLI et commencez à utiliser le flux de travail SKILL.md dans votre espace de travail.
An automated arbitrage bot focused on sports and esports markets that identifies and executes profit opportunities between Kalshi and Polymarket.
This bot exclusively monitors sports and esports markets for the following:
Esports:
Traditional Sports:
ArbiBot continuously monitors sports and esports markets on both Kalshi and Polymarket to identify arbitrage opportunities. The bot:
git clone <repository-url>
cd ArbiBot
npm install
cp .env.example .env
Edit .env with your API credentials and preferences.
The safest way to test ArbiBot is with paper trading mode:
npm install
cp .env.example .env
Set up Telegram notifications (optional but recommended):
Edit .env and set:
PAPER_TRADING_MODE=true
STARTING_BALANCE=1000
ENABLE_TELEGRAM_NOTIFICATIONS=true # if you set up Telegram
TELEGRAM_BOT_TOKEN=your_bot_token # from @BotFather
TELEGRAM_CHAT_ID=your_chat_id # your Telegram user ID
npm run dev
Create a .env file with the following variables:
# Kalshi API Configuration
KALSHI_API_KEY=your_kalshi_api_key_here
KALSHI_PRIVATE_KEY=your_kalshi_private_key_here
KALSHI_API_URL=https://api.elections.kalshi.com/trade-api/v2
# Polymarket API Configuration
POLYMARKET_API_KEY=your_polymarket_api_key_here
POLYMARKET_PRIVATE_KEY=your_polymarket_private_key_here
POLYMARKET_API_URL=https://clob.polymarket.com
# Bot Configuration
MIN_PROFIT_THRESHOLD=0.02 # Minimum 2% profit required
MAX_POSITION_SIZE=100 # Maximum $100 per trade
CHECK_INTERVAL_MS=5000 # Check every 5 seconds
ENABLE_TRADING=false # Set to true to execute real trades
PAPER_TRADING_MODE=true # Use simulated money for testing
STARTING_BALANCE=1000 # Starting balance for paper trading
# Telegram Configuration
TELEGRAM_BOT_TOKEN=your_telegram_bot_token_here
TELEGRAM_CHAT_ID=your_chat_id_here
ENABLE_TELEGRAM_NOTIFICATIONS=true
HOURLY_SUMMARY_ENABLED=true
# Logging
LOG_LEVEL=info # Log level: debug, info, warn, error
Bot Settings:
MIN_PROFIT_THRESHOLD: Minimum profit percentage required to execute a trade (e.g., 0.02 = 2%)MAX_POSITION_SIZE: Maximum amount to invest in a single arbitrage opportunityCHECK_INTERVAL_MS: How often to scan for opportunities (in milliseconds)ENABLE_TRADING: Set to false for dry-run mode, true to execute real tradesLOG_LEVEL: Verbosity of logging (debug, info, warn, error)Paper Trading Settings:
PAPER_TRADING_MODE: Set to true to use simulated money (recommended for testing)STARTING_BALANCE: Starting balance for paper trading (e.g., 1000 = $1,000)Telegram Settings:
TELEGRAM_BOT_TOKEN: Your Telegram bot token from @BotFatherTELEGRAM_CHAT_ID: Your Telegram user ID (see TELEGRAM_SETUP.md)ENABLE_TELEGRAM_NOTIFICATIONS: Set to true to receive notificationsHOURLY_SUMMARY_ENABLED: Set to true to receive hourly performance summariesRun the bot with hot-reloading:
npm run dev
Build and run the bot:
npm run build
npm start
Compile TypeScript in watch mode:
npm run watch
The bot fetches active markets from both Kalshi and Polymarket APIs.
Markets are matched across platforms using:
The bot checks for valid arbitrage opportunities using opposing outcomes:
Buy YES on Platform A + Buy NO on Platform B
Buy NO on Platform A + Buy YES on Platform B
Note: The bot does NOT use buy/sell strategies (e.g., "Buy YES then Sell YES") because you cannot sell shares you don't own. Only buying opposing outcomes guarantees profit without requiring pre-existing positions.
Paper Trading Mode:
Live Trading Mode:
When an opportunity is found and trading is enabled:
Telegram Notifications (if enabled):
Order Monitoring (live trading):
The bot continuously monitors active orders and:
ArbiBot/
├── src/
│ ├── clients/
│ │ ├── kalshi.ts # Kalshi API client
│ │ └── polymarket.ts # Polymarket API client
│ ├── services/
│ │ ├── marketMatcher.ts # Market matching logic
│ │ ├── arbitrageDetector.ts # Arbitrage detection
│ │ ├── orderManager.ts # Order placement and management
│ │ ├── paperTrading.ts # Paper trading simulation
│ │ └── telegramNotifier.ts # Telegram notifications
│ ├── types/
│ │ └── index.ts # TypeScript type definitions
│ ├── utils/
│ │ ├── config.ts # Configuration loader
│ │ └── logger.ts # Logging utility
│ ├── bot.ts # Main bot orchestrator
│ └── index.ts # Entry point
├── .env.example # Example environment variables
├── .gitignore
├── package.json
├── tsconfig.json
├── TELEGRAM_SETUP.md # Telegram bot setup guide
└── README.md
Logs are written to:
combined.log (all logs)error.log (errors only)USE AT YOUR OWN RISK
This bot involves real financial transactions. There are risks including:
Always:
marketMatcher.tsENABLE_TRADING=true in .envMIT
Contributions are welcome! Please open an issue or pull request.