A smart tool to identify and capitalize on inefficient prediction markets for stock hedging opportunities on Polymarket.
Polymarket provides prediction markets on stock prices, allowing users to bet YES or NO on outcomes like "Will GOOGL close above $200 by end of February?"
Buying NO shares on price targets well above the current stock price effectively bets against the stock reaching that level. If correct, you earn $1 per share at expiration. If wrong but you own the stock, gains in your holdings can offset losses.
Prediction markets, particularly those with low liquidity, often exhibit inefficiencies. This enables discovering opportunities with 20-50%+ APY on relatively safe bets (e.g., wagering a stock won't rise 30% in two weeks).
- GOOGL at $180
- Market: "Will GOOGL hit $250 by March?"
- NO shares at $0.92
If GOOGL stays below $250, profit $0.08/share (~8.7% in weeks = high APY). If GOOGL reaches $250, lose $0.92/share but stock gains ~39%.
This tool scans Polymarket, ranks opportunities, and enables direct trade execution.
- Market Scanner: Identifies stock prediction markets based on price delta, expiry time, and APY.
- Portfolio Dashboard: Displays positions, balance, and portfolio analytics.
- Stock Holdings Tracker: Integrates holdings for hedge scenario analysis.
- Trade Execution: Direct trading with configurable limits (wallet setup required).
- Position Redemption: Automates redemption of winning positions.
Run the scanner in view-only mode without wallet configuration.
- Node.js (v18+ recommended)
- npm or yarn
-
Install Dependencies
npm install
-
Configure Scanner
Edit
config/config.json:{ "stocks": ["GOOGL", "AMZN"], "opportunities": { "opportunityAPY": 25, "minDisplayAPY": 8, "minDeltaPercent": 7 } }Field Description stocksStock tickers to scan opportunityAPYAPY threshold for highlighting opportunities minDisplayAPYMinimum APY to display opportunities minDeltaPercentMinimum price delta percentage -
Run the Application
npm run dev
Visit http://localhost:3000
Enable trading by configuring your Polymarket wallet.
⚠️ Important: Review the Security section before proceeding.
Create a .env file in the project root:
# Wallet Credentials (required for trading)
POLYGON_PRIVATE_KEY=your_wallet_private_key
POLYMARKET_FUNDER_ADDRESS=your_polymarket_proxy_wallet_address
POLYGON_RPC_URL=https://polygon-rpc.com
# Authentication
TRADE_PASSWORD=your_secure_password
# Mode
READONLY_MODE=trueLocating Proxy Address: Find your Polymarket proxy address in account settings or deposit details.
- Click Login in the app header.
- Enter your
TRADE_PASSWORDto unlock trading features.
- Positions: Total value and count of open positions.
- Balance: Available USDC for trading.
- Opportunities: Count of high-APY opportunities.
- Stock Holdings: Input owned shares for hedge calculations.
Sortable columns:
| Column | Description |
|---|---|
| Market | Event title with Polymarket link |
| Strike | Target price |
| Delta | Percentage from current price |
| NO Price | Best ask for NO shares |
| APY | Annualized yield if NO wins |
| Score | Opportunity rating (0-100) |
| Expires | Days to resolution |
- Select Trade on an opportunity.
- Set Max Price and Max Amount.
- Review cost, APY, and profit projections.
- For holdings integration: View hedge scenarios (profit if below strike, cost if above).
- Execute the trade.
- Snooze (24h): Temporarily hide for 24 hours.
- Dismiss Forever: Permanently remove.
Opportunities are scored out of 100:
Score = APY Score (max 30) + Delta Score (max 70)
APY Score = min(APY, 200) / 200 * 30
Delta Score = min(|delta|, 50) / 50 * 70
Higher delta indicates safer bets (lower probability of reaching strike).
- Private Key: Grants full wallet access. Use a dedicated wallet with limited funds. Never share or commit.
- Trade Password: Secure access to trading. Use strong passwords for internet-exposed instances.
- Readonly Mode: Default enabled. Requires authentication to modify data.
- Stock Holdings: Stored locally in browser (localStorage). Not transmitted.
- Self-Hosting: Designed for personal infrastructure. Avoid third-party hosting with credentials.
docker compose up -d --buildRuns on port 50003 by default.
Required for restricted regions (e.g., France). Remove VPN service from docker-compose.yml if unnecessary.
Using Proton VPN as example:
- Access Proton VPN Dashboard.
- Go to Downloads > OpenVPN configuration files.
- Select Linux, UDP/TCP, specific server (e.g., Ireland).
- Download
.ovpnfile. - Retrieve OpenVPN credentials from Account section.
mkdir -p vpn
mv ~/Downloads/your-server.ovpn vpn/vpn.ovpnCreate vpn/vpn.auth:
your-openvpn-username
your-openvpn-password
Edit vpn/vpn.ovpn:
- Change
auth-user-passtoauth-user-pass /vpn/vpn.auth - Comment out
update-resolv-conflines if present.
docker compose up -d