1. Abstract
Prediction markets and betting venues are fragmented across products, fee models, odds formats, and liquidity conditions. Polyware converges these silos into one terminal by (i) unifying market metadata and odds, (ii) offering an adapter interface for venue connectivity, and (iii) executing a routing algorithm that chooses the venue (or split across venues) that yields the best effective fill for a user’s intended spend. Polyware does not hold user funds and does not charge an added fee.
2. Vision & Principles
- User First: best execution, transparent pricing, and clear payout math.
- Non-Custodial: wallets sign orders; settlement occurs at venues.
- Minimal Abstraction: simple SOL-per-share pricing (1 share pays 1 SOL if correct).
- Extensible: venue adapters are small, testable modules.
- No Added Fees: Polyware charges no fee on top of venue costs.
3. System Overview
The terminal consists of a responsive web UI plus a lightweight backend used for discovery, normalization and quoting. The backend exposes REST endpoints and an adapter SDK. All sensitive actions (e.g., order intent) are authorized by a wallet signature (signMessage).
| Component | Description |
|---|---|
| UI | Markets table, trade ticket, positions & PnL, watchlists, alerts. |
| Adapter Layer | Per-venue connectors implementing a common interface for markets, books, quotes, and (optionally) order placement. |
| Normalizer | Transforms venue odds into SOL/share with optional overround removal. |
| Router | Finds best venue(s) for a given side and spend; can split orders across legs. |
| Signer | Wallet (Phantom). The user retains control; Polyware is non-custodial. |
4. Odds & Pricing
Polyware uses a single price convention: SOL per share with shares paying 1 SOL if the outcome resolves true (and 0 otherwise). A price of 0.37 means an implied probability of 37% and a potential payoff of ~2.70× if correct (ignoring fees).
4.1 Overround (Vig) Removal
Some venues embed an overround such that pYes + pNo > 1. For display and optional quoting, Polyware can normalize pairs to sum to 1:
// Given pYes and pNo in 0..1:
function removeOverround(pYes, pNo){
const s = pYes + pNo;
return s > 0 ? { pYes: pYes / s, pNo: pNo / s } : { pYes: .5, pNo: .5 };
}
4.2 Orderbook Simulation
Average fill price is computed by walking ask levels until the spend is exhausted.
for (level of asks.sortedByPriceAsc) {
const shares = min(level.size, remainingSOL / level.price);
acquired += shares;
cost += shares * level.price;
remainingSOL -= shares * level.price;
}
5. Venue Adapters
Adapters are small modules that translate a venue’s API into Polyware’s canonical types. They must implement listMarkets, getOrderbook, and quote; place is optional (some venues require native UX).
interface Adapter {
venue: string;
listMarkets(params?: { query?: string; limit?: number }): Promise<Market[]>;
getOrderbook(marketId: string): Promise<Orderbook>;
quote(req: QuoteRequest): Promise<Quote>;
place?(q: Quote & { signature?: string; payload?: string }): Promise<{ accepted: boolean; id?: string }>;
}
Core entities (simplified):
type Market = {
id: string; // "venue|venueMarketId"
venue: string;
title: string;
priceYes: number; // 0..1 SOL/share
priceNo: number; // 0..1 SOL/share
liquiditySOL: number;
volume24hSOL: number;
endTime: number; // epoch ms
};
6. Smart-Order Routing
Routing compares quotes across venues for the same market and side, choosing the lowest average execution price (YES/NO are treated symmetrically). If a single venue cannot fully fill the intended spend at competitive prices, the order may be split across venues (legs) to improve effective pricing.
6.1 Blended Price
blendedAvg = sum(leg.costSOL + leg.feeSOL) / sum(leg.shares)
6.2 Slippage & Guards
- Optional
maxSlippagePctstops execution if realized average > limit. - Venue-level risk caps prevent over-exposure to a single venue.
- Router prefers routes with lower variance when quotes are near-tied.
7. Portfolio & PnL
Locally, Polyware tracks per-market positions (shares, average entry, cost basis) and estimates mark-to-market PnL from current quotes. Users can export history and reconcile with venue fills.
| Metric | Definition |
|---|---|
| Shares | Sum of YES or NO units acquired. |
| Entry Avg (SOL) | Weighted average of executed prices. |
| Unrealized PnL | (Mark price − Entry) × Shares. |
| Realized PnL | Sum of settled outcomes minus cost basis. |
8. Security & Wallets
- Non-custodial: Polyware never controls private keys or funds.
- Authorization: orders are authorized via
signMessage(Phantom). - Integrity: backend verifies signatures (ed25519) against wallet public keys.
- Privacy: minimal event telemetry; no PII is required to browse or quote.
// Verification (ed25519/Phantom)
verifySignMessage(payloadUtf8, signatureBase64, publicKeyBase58) -> boolean
9. Public API (Preview)
Base URL is environment-specific. All responses are JSON.
GET /api/markets?query=<string>&limit=50&removeVig=true
GET /api/markets/<globalId>/orderbook
GET /api/quote?marketId=<globalId>&side=YES|NO&amountSOL=1.5
POST /api/route
{
"marketId": "demo-predict|MK1000",
"side": "YES",
"amountSOL": 1.5,
"payload": "POLYWARE_SOL|...|timestamp",
"signatureB64": "<base64>",
"publicKey": "<base58>"
}
Polyware charges no added fees; venue fees (if any) are passed through transparently.
10. Risk, Compliance & Jurisdictions
- Market Risk: Prices can move rapidly; liquidity may be thin or episodic.
- Venue Risk: Each venue has its own rules, fees, and settlement procedures.
- Regulatory: Prediction markets and betting are jurisdiction-dependent; users are responsible for complying with local laws.
- No Advice: Polyware is an execution interface and data aggregator, not investment or betting advice.
11. Roadmap
- v0.1 — Adapter SDK, odds normalization, single-leg routing (this paper).
- v0.2 — Split routing, venue deduplication, arbitrage scanner, alerts.
- v0.3 — Historical data API, backtesting, strategy hooks.
- v1.0 — Production adapters (multi-venue), audit, public launch.
12. Glossary
Overround (Vig): The sum of implied probabilities exceeding 1 due to fees/margins.
Share (Unit): A contract that pays 1 SOL if the predicted outcome resolves true.
Effective Price: Average price including venue fees and partial fills.
Leg: A routed slice of an order executed on a specific venue.