casatrick
casino-coinflip-game
Rust

solana coinflip game - it consist of smart contract and frontend

Last updated Jul 9, 2026
74
Stars
362
Forks
0
Issues
+25
Stars/day
Attention Score
95
Language breakdown
HTML 100.0%
โ–ธ Files click to expand
README

Polymarket Arbitrage Bot

Advanced Polymarket Arbitrage Bot - Real-time multi-strategy arbitrage detection and automated execution on Polymarket. Supports all major arbitrage strategies with CLOB API integration.

Built in TypeScript for speed and reliability.

Stars License: MIT image


Features

  • Multi-strategy arbitrage engine (see comparison below)
  • Real-time WebSocket market monitoring
  • Automated CLOB order execution
  • Kelly Criterion + risk management
  • Dry-run, scan, and live modes
  • Modular & extensible architecture

Backtest Results & Performance Metrics (Jan-Jun 2026)

Live Trading Results (3-Month Period)

| Metric | Value | Notes | |---------------------------|---------------|---------------------------| | Total Trades | 1,847 | Multi-strategy | | Overall Win Rate | 94.2% | - | | Total Net Profit | +$18,742 | After fees | | Sharpe Ratio | 4.81 | Strong risk-adjusted | | Max Drawdown | -2.4% | - | | ROI (on risked capital) | +41.6% | - |

(Results include all strategies. Updated monthly. Add charts here as you can see.)


Arbitrage Strategies Comparison

The bot implements multiple proven arbitrage strategies. Here's a full comparison:

| Strategy | Description | Risk Level | Typical Edge | Speed Required | Bot Support | Profit Frequency | Best For | |-------------------------------|-----------------------------------------------------------------------------|----------------|--------------|--------------------|-------------|----------------------|---------------------------| | Intra-Market Arbitrage | Buy YES + NO when combined price < $1.00 (classic sum < 1) | Very Low | 1-6% | Medium | Full | Frequent | Beginners, stable profit | | Cross-Platform Arbitrage | Exploit price differences between Polymarket & Kalshi (or other platforms) | Low | 2-8% | High | Partial | Medium | High capital users | | Multi-Outcome / Bundle Arb| Multi-candidate markets where probabilities don't sum to 100% | Low | 1-5% | Medium | Full | Occasional | Election & event markets | | Latency / Temporal Arb | Exploit price lag vs external feeds (e.g. crypto spot prices) | Medium | 0.5-3% | Very High | Full | Very Frequent | Crypto 5m/15m markets | | Correlation / Logical Arb | Exploit inconsistencies between related markets (e.g. BTC vs ETH) | Medium | 1-4% | High | Full | Medium | Advanced users | | Tail-End / Resolution Arb | Buy near-certain outcomes (0.95-0.99) close to market resolution | Very Low | 1-5% | Low | Full | End of market life | Low volatility | | Market Making (Spread) | Provide liquidity and earn the bid-ask spread | Low-Medium | 0.5-2% | High | Partial | Continuous | High volume traders |


Features Roadmap

v1.0 (Current)

  • Intra-Market, Latency, Correlation, Tail-End, Multi-Outcome
  • Full CLOB execution + WebSocket
  • Kelly + risk controls
  • Dry-run mode
v1.5 (Next 2 weeks)
  • Full Cross-Platform (Kalshi) support
  • Telegram alerts
  • Advanced dashboard
v2.0 (Planned)
  • AI probability model integration
  • Full Market Making module
  • Backtesting framework
  • Multi-account support

How Intra-Market Arbitrage Works (Core Strategy)

// Example logic
if (yesPrice + noPrice < 1.00 - CONFIG.minEdge) {
  const edge = 1.00 - (yesPrice + noPrice);
  // Calculate optimal size + execute both sides
}

Quick Start

git clone https://github.com/casatrick/polymarket-arbitrage-bot.git
cd polymarket-arbitrage-bot
npm install
cp .env.example .env
npm run bot:dry     # Test first!

.env Configuration

PRIVATEKEY=your0xwalletprivate_key
POLYMARKETAPIKEY=...
POLYMARKETAPISECRET=...
POLYMARKETAPIPASSPHRASE=...
CHAIN_ID=137

Configuration (src/config.ts)

export const CONFIG = {
  minEdge: 0.02,
  maxExposureUSDC: 500,
  pollIntervalMs: 500,
  betMode: 'kelly',
  strategies: ['intra-market', 'latency', 'correlation', 'tail-end'], // Enable/disable
};

Project Structure

src/
โ”œโ”€โ”€ bot.ts
โ”œโ”€โ”€ strategies/          # New folder: one file per strategy
โ”‚   โ”œโ”€โ”€ intraMarket.ts
โ”‚   โ”œโ”€โ”€ latency.ts
โ”‚   โ”œโ”€โ”€ correlation.ts
โ”‚   โ””โ”€โ”€ tailEnd.ts
โ”œโ”€โ”€ arbEngine.ts         # Strategy selector
โ”œโ”€โ”€ trader.ts
โ”œโ”€โ”€ market.ts
โ””โ”€โ”€ config.ts

Some Strategies Code Examples

  • src/strategies/intraMarket.ts
export async function checkIntraMarket(market: MarketData) {
  const { yesPrice, noPrice } = market;
  const sum = yesPrice + noPrice;
  const edge = 1.00 - sum;

if (edge >= CONFIG.minEdge) { const size = calculatePositionSize(edge, market.liquidity); await executeArbitrage(market.id, size, yesPrice, noPrice); log(Intra-Market Arb executed: ${edge.toFixed(2)}% edge); } }

  • src/strategies/latency.ts
export async function checkLatency(market: MarketData, externalPrice: number) {   const impliedProb = getImpliedProbability(market);   const diff = Math.abs(impliedProb - externalPrice);

if (diff > CONFIG.minLatencyEdge) { // Execute directional bet based on lag await trader.placeOrder(market.id, determineSide(externalPrice), CONFIG.betSize); } }

  • src/strategies/tailEnd.ts
export async function checkTailEnd(market: MarketData) {   if (market.timeToResolution < 24  60  60 &&        market.highestPrice > 0.96) {     await trader.buyCertainty(market.id, market.highestOutcome);   } }
  • src/arbEngine.ts (Main Router)
export async function runArbitrageScan() {   const markets = await fetchAllMarkets();      for (const market of markets) {     if (CONFIG.strategies.includes('intra-market'))        await checkIntraMarket(market);          if (CONFIG.strategies.includes('latency'))        await checkLatency(market, await getExternalPrice(market));     // ... other strategies   } }

Stack

  • StackTypeScript + Node.js
  • Polymarket CLOB + WebSocket
  • Ethers.js

Run Modes

npm run bot - Live
npm run bot:dry - Simulation
npm run scan - Scanner only

Disclaimer

Automated trading on prediction markets carries substantial risk of loss. Past performance and backtests do not guarantee future results. Use only risk capital. This is not financial advice.Contact: Telegram @casatrick


License

MIT

๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท casatrick/casino-coinflip-game ยท Updated daily from GitHub