API Documentation

Last updated:

REST API

Base URL: https://api.veil.markets/v1

GET /markets

Fetch all active markets with current prices, volume, and metadata.

Query params: category, status, limit, offset

GET /markets/:id

Get detailed information about a specific market including resolution criteria and historical data.

GET /markets/:id/orderbook

Retrieve the current order book for a market with bid/ask prices and liquidity depth.

POST /orders

Place a new order on a market. Requires wallet authentication and signature.

Body: marketId, outcome, amount, price, signature

GET /user/:address/positions

Get all open positions for a wallet address. Requires authentication.

WebSocket API

Connect to: wss://api.veil.markets/ws

Subscribe to real-time market updates, order book changes, and trade executions via WebSocket connections.

Subscribe to Market

{ "action": "subscribe", "channel": "market", "marketId": "btc-100k" }

Subscribe to Order Book

{ "action": "subscribe", "channel": "orderbook", "marketId": "btc-100k" }

Authentication

VEIL uses wallet-based authentication. Sign a message with your wallet to receive an API key:

  1. Request a challenge message from POST /auth/challenge
  2. Sign the message with your wallet
  3. Submit the signature to POST /auth/verify
  4. Receive an API key valid for 24 hours
  5. Include the API key in the Authorization header for authenticated requests

Questions?

Contact us at legal@veil.market

Get Support