rocket_launch 01// Getting Started
setup_guide.mdThe PolyEye CLI is a specialized daemon binary that implements real-time tokenized prediction contract speculation. The system bypasses web app latency by processing audio streams, executing local sentiment calculations using compiled tensor parameters, and dispatching trades through direct Polygon mainnet RPC node connections.
VAD ENGINE: Silero VAD (Voice Activity Detection) ONNX Classifier
SAMPLING PRESET: Single-channel (Mono) Float32 linear PCM at 16,000Hz
VAD WINDOW SIZE: 30ms (480 samples per frame evaluation block)
TRIGGER LOGIC: Starts speech buffering when voice probability Pr(Speech) ≥ 0.82. Speech block halts when voice probability dips Pr(Speech) < 0.35 for 15 consecutive frames.
When the speech chunk ends, the system processes text tokens via a local BERT-based WordPiece tokenizer (vocabulary array of 30,522 keys) and converts transcripts into 1536-dimensional dense embedding vectors inside a local ONNX runtime thread.
System Prerequisites
- Node.js Environment: Active Node runtime (version v18.16.0 or higher LTS recommended).
- ONNX Support: Local execution of ONNX Runtime models requires WebAssembly dependencies (`onnxruntime-web`).
- Web3 Connection: Access credentials to a Polygon Mainnet RPC URL (e.g. Alchemy, Infura, or a self-hosted geth node).
- Collateral Wallet: Private keys with active USDC balances on Polygon for option execution, and native POL tokens for transaction gas limits.
1. Global Binary Installation
Install the package globally. This compiles the web3 client libraries and locks local binary execution path variables:
npm install -g @polyeye/cli-binary
2. Node Credentials Initialization
Execute the `init` command to generate your local wallet key repository and point your clients onto a mainnet RPC node:
polyeye init --rpc https://polygon-mainnet.g.alchemy.com/v2/demo-key --wallet 0x93b7df82e666a4f216e2578...
settings_suggest 02// Configuration Details
config.jsonThe `config.json` configuration file is maintained locally in the daemon directory. This configuration dictates Cosine Vector similarity calculations, watchlist variables, safety gates, and dynamic gas estimation.
The system tokenizes decoded transcripts into vector arrays. Cosine Similarity between transcript embedding $T$ and watchlisted outcome semantic vector $C$ is computed as:
$\text{Cosine Similarity} = \frac{T \cdot C}{\|T\| \|C\|} = \frac{\sum_{i=1}^{n} T_i C_i}{\sqrt{\sum_{i=1}^{n} T_i^2} \sqrt{\sum_{i=1}^{n} C_i^2}}$
TRIGGER CRITERIA: Executes automatic purchase signals if the similarity score satisfies Score ≥ 0.94 and the Sentiment Polarity index registers positive outcomes above the risk gate limits.
{
"rpc_node": "https://polygon-mainnet.g.alchemy.com/v2/demo-key",
"backup_rpc_nodes": [
"https://polygon-rpc.com",
"https://rpc-mainnet.maticvigil.com"
],
"websocket_feed": "wss://speech-api.polyeye.io/stream",
"trading_limit_usdc": 1000.0,
"slippage_threshold": 0.02,
"max_slippage_model": "dynamic",
"contracts_watchlist": [
"US_PRES_ELECTION_2026",
"FED_RATE_CUT_2026",
"SOL_ETF_APPROVAL_2026"
],
"gas_premium_gwei": 5.0,
"gas_premium_limit": 50.0,
"enable_hedging": true,
"log_level": "info"
}
| Property | Type | Default | Description |
|---|---|---|---|
| rpc_node | string | null | Primary Polygon node provider RPC URL. |
| backup_rpc_nodes | array | [] | Fallback RPC nodes checked if the primary RPC encounters latency spikes. |
| websocket_feed | string | "wss://speech-api.polyeye.io/stream" | WS address used for streaming real-time speech broadcasts. |
| trading_limit_usdc | float | 100.0 | Budget ceiling allocation per trigger signal order. |
| slippage_threshold | float | 0.02 | Maximum allowed slippage (2%) before order abort. |
| max_slippage_model | string | "static" | Calculation preset ('static' limits, or 'dynamic' matching book thickness). |
| contracts_watchlist | array | [] | Short identifiers representing target outcome token ABIs. |
| gas_premium_gwei | float | 5.0 | Gas surcharge added to base gas limits for fast execution blocks. |
| gas_premium_limit | float | 50.0 | Maximum gas price ceiling in Gwei to prevent congestion trade errors. |
| enable_hedging | boolean | false | Triggers hedge counters if vector outputs invert. |
| log_level | string | "info" | Level of system outputs ("debug" | "info" | "warn" | "error"). |
menu_book 03// CLI Command Reference
commands_manualEstablishes secure transaction configurations. This commands takes your hex private key and encrypts it locally using AES-256-GCM. Derives authentication passcodes via PBKDF2 (100,000 iterations, 256-bit salt).
| Flag | Type | Requirement | Desc |
|---|---|---|---|
| --rpc | string | Required | Polygon RPC provider node endpoint url. |
| --wallet | string | Required | Hex address string representing wallet private key. |
polyeye init --rpc https://polygon-mainnet.g.alchemy.com/v2/demo --wallet 0xABCD...
Launches the speech-to-trade algorithmic engine daemons. Connects WebSocket speech feeds and runs concurrent thread pools mapping incoming streams.
| Flag | Type | Default | Desc |
|---|---|---|---|
| --topic | string | "politics" | Feed channel ('politics' | 'finance' | 'custom'). |
| --stake | number | 100.0 | USDC stake amount allocated per contract trade trigger. |
| --max-slippage | float | 0.02 | Max slippage bounds (percentage). |
| --vad-threshold | float | 0.82 | Speech activity threshold value (0.0 to 1.0). |
| --cosine-sim-limit | float | 0.94 | Cosine similarity gate limits. |
| --hedge-ratio | float | 0.50 | Hedge allocation ratio used during trade reversals. |
| --max-pending-txs | integer | 3 | Maximum parallel trade transactions allowed before lock. |
| --sim-audio-file | string | null | Runs local audio files path for diagnostic simulations. |
polyeye run --topic politics --stake 500 --max-slippage 0.015 --vad-threshold 0.85 --max-pending-txs 5
Outputs live indicators, connection health status, RPC block height latency stats, pending nonces, and current wallet USDC balances.
polyeye status --watch --verbose
>> [STATUS] POLYEYE ENGINE RUNNING - V4.2.1-BETA
> UPTIME: 34h 40m | THREADS: 5 ACTIVE | CPU: 4.8%
> PORTFOLIO VALUE: 244,092.12 USDC | ACCURACY: 89.4%
> ACTIVE RPC ENDPOINT: https://polygon-mainnet.g.alchemy.com (Latency: 12ms)
> LAST SIMILARITY MATCH: Cos(T, C) = 0.962 (Outcome: FED_RATE_CUT_2026 YES)
> PENDING TRANSACTION NONCES: 0 (Synced)
Dynamically get, set, or validate properties in `config.json` without opening text editors. Path validators verify syntax schema and RPC connection speeds before saving.
# Set budget limits
polyeye config set trading_limit_usdc 1500.0
# Set nested RPC endpoints
polyeye config set backup_rpc_nodes.0 https://polygon-rpc.com
# Query current watch list
polyeye config get contracts_watchlist
# Validate configuration structures
polyeye config validate
Manage the prediction event contracts watchlist. Fetch outcome token details directly from Polymarket smart contract ABI routers on-chain.
# Add a contract identifier to scan
polyeye watchlist add BTC_OVER_100K
# Remove a contract key
polyeye watchlist remove US_PRES_ELECTION_2026
# List all active contracts watchlists and their on-chain mappings
polyeye watchlist list
Query logs from local Sqlite `run.db` storage. Supports level queries, transaction hashes lookups, and regex searches.
# Show error logs only
polyeye logs --level error --lines 50
# Grep for specific block transaction hashes
polyeye logs --find "0x7e88"
Returns client compilation build targets, dependencies versions, and performs network speed handshakes.
polyeye version
lan 04// API Telemetry Reference
http://localhost:8080The PolyEye client spawns a local HTTP telemetry server on `localhost:8080` to export runtime data and allow trigger injections for diagnostic automation workflows.
curl http://localhost:8080/pnl
{
"status": "NOMINAL",
"net_balance_usdc": 244092.12,
"active_positions_count": 12,
"gas_saved_usdc": 428.12,
"last_trade_latency_ms": 12,
"uptime_seconds": 124800
}
curl http://localhost:8080/metrics
# HELP polyeye_balance_usdc Current USDC balance in execution wallet
# TYPE polyeye_balance_usdc gauge
polyeye_balance_usdc 244092.12
# HELP polyeye_trade_latency_ms Cosine matching and Polygon dispatch delay
# TYPE polyeye_trade_latency_ms summary
polyeye_trade_latency_ms{quantile="0.5"} 12.0
polyeye_trade_latency_ms{quantile="0.9"} 14.5
polyeye_trade_latency_ms_sum 3624.0
polyeye_trade_latency_ms_count 302
# HELP polyeye_accuracy_ratio Accuracy of resolved Yes/No options
# TYPE polyeye_accuracy_ratio gauge
polyeye_accuracy_ratio 0.894
Post raw speech transcripts directly to the sentiment tokenizers. This override diagnostic bypasses audio inputs and triggers automated buy actions directly if score parameters match.
curl -X POST -H "Content-Type: application/json" -d '{"transcript":"inflation is falling down target rate", "bypass_risk": false}' http://localhost:8080/trigger
{
"success": true,
"cosine_similarity": 0.958,
"sentiment_polarity": 0.981,
"trade_triggered": true,
"transaction_hash": "0x7e88a032d9198abf210..."
}
build 05// Troubleshooting Guide
exit_codesSummary descriptions of exit codes and common resolution procedures.
Error: RPC_RATE_LIMIT (Exit Code: 102)
Cause: The volume of balance queries or gas estimators checks exceeded limits of your Polygon node.
Resolution: Set up fallback RPC urls in your `backup_rpc_nodes` list or increase the watch query delay limits inside settings.
Error: SLIPPAGE_EXCEEDED (Exit Code: 105)
Cause: The probability rate shifted between token embeddings checks and transaction inclusion blocks.
Resolution: Switch your `max_slippage_model` to `"dynamic"` or scale the bounds flag `--max-slippage` to `0.03`.
Error: NONCE_TOO_LOW (Exit Code: 112)
Cause: Concurrent threads dispatched trade orders simultaneously, resulting in out-of-order execution slots.
Resolution: Lower execution pools limits using `--max-pending-txs 2` or check that client nonce synchronizers are enabled.
Error: ONNX_RUNTIME_INIT_FAILED (Exit Code: 180)
Cause: Node cannot allocate webassembly buffers or C++ runtime modules are missing from the OS.
Resolution: Upgrade your system to Node 18+ or install VC++ Redistributable packages (on Windows) or `libgomp` (on Linux).
Error: WEBSOCKET_TIMEOUT (Exit Code: 201)
Cause: Audio stream socket lost network connection for over 30 seconds.
Resolution: The daemon auto-reconnects, but check internet connections and ensure firewall ports are open for outgoing websockets.