Health Check
Returns a lightweight uptime signal for monitoring and deploy verification.
curl "https://api.vatic.trading/health"
{
"ok": true,
"service": "vatic-api",
"now": "2026-04-04T10:12:00.000Z"
}{
"error": "Rate limit exceeded"
}This page replaces the old docs with a route catalog extracted from the server implementation. It groups the API by functionality, flags protected routes, and keeps aliases visible so integrations stop guessing.
Read routes are public. Trading routes use the middleware in server.js and currently accept a key via Authorization: Bearer <key>, X-Api-Key, or ?apiKey=.
The backend emits X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset headers. The default ceiling in server.js is 120 requests per 60 seconds per IP.
Prefer the WebSocket feed for boundary-sensitive trading logic instead of polling target endpoints into 429s or publish-lag windows.
Returns a lightweight uptime signal for monitoring and deploy verification.
curl "https://api.vatic.trading/health"
{
"ok": true,
"service": "vatic-api",
"now": "2026-04-04T10:12:00.000Z"
}{
"error": "Rate limit exceeded"
}Basic service metadata plus a pointer to the health route.
curl "https://api.vatic.trading/"
{
"ok": true,
"service": "vatic-api",
"status": "up",
"health": "/health"
}{
"error": "Rate limit exceeded"
}Loads the original fee-rule classification for an event using the Gamma event slug.
| Field | Location | Type | Required | Description |
|---|---|---|---|---|
| eventSlug | path | string | Yes | Gamma event slug. |
curl "https://api.vatic.trading/api/v1/fees/event/slug/bitcoin-above-110k-on-april-5"
{
"event": {
"id": "8472",
"slug": "bitcoin-above-110k-on-april-5",
"title": "Bitcoin above 110k on April 5?"
},
"feeConfig": {
"hasTakerFees": true,
"type": "crypto",
"feeRate": 0.25,
"exponent": 2,
"makerRebate": "20%",
"matchedByTag": "crypto"
}
}{
"error": "Failed to fetch event metadata",
"hint": "Failed to fetch event metadata from Gamma API by slug"
}Same fee lookup as the slug route, but keyed by the Gamma event ID.
| Field | Location | Type | Required | Description |
|---|---|---|---|---|
| eventId | path | string | Yes | Gamma event identifier. |
curl "https://api.vatic.trading/api/v1/fees/event/id/8472"
{
"event": {
"id": "8472",
"slug": "bitcoin-above-110k-on-april-5"
},
"feeConfig": {
"hasTakerFees": true,
"type": "crypto",
"feeRate": 0.25,
"exponent": 2,
"makerRebate": "20%"
}
}{
"error": "Missing eventId path param"
}Estimates taker fees using the original fee formula for BUY or SELL trades.
| Field | Location | Type | Required | Description |
|---|---|---|---|---|
| eventId | body | string | No | Provide eventId or eventSlug. |
| eventSlug | body | string | No | Provide eventSlug or eventId. |
| side | body | "BUY" | "SELL" | Yes | Trade direction. |
| makingAmount | body | number | Yes | For BUY: USDC amount. For SELL: share amount. |
| takingAmount | body | number | Yes | For BUY: shares. For SELL: USDC proceeds. |
curl -X POST "https://api.vatic.trading/api/v1/fees/trade-estimate" \
-H "Content-Type: application/json" \
-d '{
"eventSlug": "bitcoin-above-110k-on-april-5",
"side": "BUY",
"makingAmount": 100,
"takingAmount": 210.5
}'{
"side": "BUY",
"averagePrice": 0.4751,
"fee": {
"chargedIn": "shares",
"feeEquivalent": 0.5263,
"feeInUsdcRaw": 0.25
},
"result": {
"grossShares": 210.5,
"netShares": 209.9737
}
}{
"error": "Provide eventId or eventSlug"
}Returns fee configuration under the updated April 2025 Polymarket fee structure.
| Field | Location | Type | Required | Description |
|---|---|---|---|---|
| eventSlug | path | string | Yes | Gamma event slug. |
curl "https://api.vatic.trading/api/v1/new_fees/event/slug/bitcoin-above-110k-on-april-5"
{
"event": {
"slug": "bitcoin-above-110k-on-april-5"
},
"feeConfig": {
"hasTakerFees": true,
"type": "crypto",
"feeRate": 0.072,
"makerRebate": "20%"
}
}{
"error": "Missing eventSlug path param"
}Looks up the new fee classification with a Gamma event ID.
| Field | Location | Type | Required | Description |
|---|---|---|---|---|
| eventId | path | string | Yes | Gamma event identifier. |
curl "https://api.vatic.trading/api/v1/new_fees/event/id/8472"
{
"event": {
"id": "8472"
},
"feeConfig": {
"hasTakerFees": true,
"type": "crypto",
"feeRate": 0.072,
"makerRebate": "20%"
}
}{
"error": "Missing eventId path param"
}Estimates trade fees using the newer fee formula and optional Polymarket validation override.
| Field | Location | Type | Required | Description |
|---|---|---|---|---|
| eventId | body | string | No | Provide eventId or eventSlug. |
| eventSlug | body | string | No | Provide eventSlug or eventId. |
| side | body | "BUY" | "SELL" | Yes | Trade direction. |
| makingAmount | body | number | Yes | For BUY: USDC amount. For SELL: share amount. |
| takingAmount | body | number | Yes | For BUY: shares. For SELL: USDC proceeds. |
curl -X POST "https://api.vatic.trading/api/v1/new_fees/trade-estimate" \
-H "Content-Type: application/json" \
-d '{
"eventId": "8472",
"side": "SELL",
"makingAmount": 150,
"takingAmount": 93
}'{
"validatedWithPolymarket": true,
"side": "SELL",
"fee": {
"chargedIn": "usdc",
"feeEquivalent": 0.15,
"feeInUsdcRaw": 0.15043
},
"result": {
"grossUsdc": 93,
"netUsdc": 92.85
}
}{
"error": "Invalid side. Supported values: BUY, SELL"
}Returns the current active target window for one asset across one or more market types.
| Field | Location | Type | Required | Description |
|---|---|---|---|---|
| asset | query | string | Yes | Normalized asset slug such as btc or eth. |
| types | query | comma-separated string | No | Subset of market types. Defaults to all supported types. |
curl "https://api.vatic.trading/api/v1/targets/active?asset=btc&types=5min,15min,1hour"
{
"asset": "btc",
"results": [
{
"marketType": "5min",
"ok": true,
"windowStart": 1775290500,
"windowStartIso": "2026-04-04T10:15:00.000Z",
"source": "chainlink",
"price": 107233.42
}
]
}{
"error": "Invalid asset. Supported assets: btc, eth, sol, xrp, hype, doge, bnb"
}Fetches a Chainlink-backed target price for 5min, 15min, or 4hour markets at a given timestamp.
| Field | Location | Type | Required | Description |
|---|---|---|---|---|
| asset | query | string | Yes | Asset slug. |
| type | query | "5min" | "15min" | "4hour" | Yes | Chainlink-supported market type. |
| timestamp | query | unix seconds | unix milliseconds | ISO string | Yes | Timestamp to normalize into a market window. |
curl "https://api.vatic.trading/api/v1/targets/chainlink?asset=eth&type=15min×tamp=2026-04-04T10:15:00Z"
{
"asset": "eth",
"marketType": "15min",
"requestedTimestamp": 1775297700,
"source": "chainlink",
"price": 3921.81,
"_cache": {
"hit": true,
"windowStart": 1775297700,
"ageSec": 2
}
}{
"error": "Chainlink credentials not configured",
"error_code": "upstream_error",
"hint": "Check Chainlink credentials in twitter_post/.env (CHAINLINK_USERNAME, CHAINLINK_PASSWORD)"
}Resolves a target price at a given timestamp, automatically picking Chainlink or Binance based on the market type.
| Field | Location | Type | Required | Description |
|---|---|---|---|---|
| asset | query | string | Yes | Asset slug. |
| type | query | string | Yes | Any supported market type. |
| timestamp | query | unix seconds | unix milliseconds | ISO string | Yes | Timestamp to resolve. |
curl "https://api.vatic.trading/api/v1/targets/timestamp?asset=btc&type=1hour×tamp=1775296800"
{
"asset": "btc",
"marketType": "1hour",
"provider": "binance",
"requestedTimestamp": 1775296800,
"source": "binance",
"price": 107104.9
}{
"error": "Upstream price provider is temporarily throttled. Please retry in a few seconds.",
"error_code": "upstream_throttled",
"provider": "chainlink",
"windowStart": 1775297700,
"websocket": "wss://api.vatic.trading/ws",
"docs": "https://api.vatic.trading/docs"
}Resolves one market type across multiple assets in a single request.
| Field | Location | Type | Required | Description |
|---|---|---|---|---|
| assets | query | comma-separated string | Yes | List of asset slugs. |
| type | query | string | Yes | Single supported market type. |
| timestamp | query | unix seconds | unix milliseconds | ISO string | Yes | Timestamp to resolve. |
curl "https://api.vatic.trading/api/v1/targets/timestamp/batch?assets=btc,eth,sol&type=5min×tamp=2026-04-04T10:15:00Z"
{
"marketType": "5min",
"provider": "chainlink",
"results": [
{ "asset": "btc", "ok": true, "source": "chainlink", "price": 107233.42 },
{ "asset": "eth", "ok": true, "source": "chainlink", "price": 3921.81 }
]
}{
"error": "Invalid assets: abc",
"hint": "Supported assets: btc, eth, sol, xrp, hype, doge, bnb"
}Parses a Vatic market slug, infers asset and market type, and resolves the target price for that window.
| Field | Location | Type | Required | Description |
|---|---|---|---|---|
| slug | path | string | Yes | Supported slug formats include short crypto slugs and date-based slug variants. |
curl "https://api.vatic.trading/api/v1/targets/slug/btc-updown-5m-1775297700"
{
"slug": "btc-updown-5m-1775297700",
"asset": "btc",
"marketType": "5min",
"windowStart": 1775297700,
"source": "chainlink",
"price": 107233.42
}{
"error": "Historical data unavailable",
"error_code": "history_too_old",
"reason": "Chainlink Data Streams retains reports for ~14 days.",
"slug": "btc-updown-5m-1773000000"
}Resolves the market window corresponding to a timestamp and returns the single target datapoint for that window.
| Field | Location | Type | Required | Description |
|---|---|---|---|---|
| asset | query | string | Yes | Asset slug. |
| type | query | string | Yes | Supported market type. |
| marketStart | start | timestamp | query | timestamp | Yes | Any of these query keys may be used; the server aligns the value to the market boundary. |
curl "https://api.vatic.trading/api/v1/history/market?asset=btc&type=5min×tamp=1775297842"
{
"asset": "btc",
"marketType": "5min",
"provider": "chainlink",
"market": {
"timestamp_start": 1775297700,
"timestamp_end": 1775298000,
"slug": "btc-updown-5m-1775297700"
},
"datapoint": {
"source": "chainlink",
"price": 107233.42
}
}{
"error": "Invalid type. Supported values: 5min, 15min, 1hour, 4hour, daily"
}Returns a series of market windows and their resolved prices across a requested time range.
| Field | Location | Type | Required | Description |
|---|---|---|---|---|
| asset | query | string | Yes | Asset slug. |
| type | query | string | Yes | Supported market type. |
| start | query | timestamp | Yes | Range start. |
| end | query | timestamp | Yes | Range end. Must be greater than start. |
curl "https://api.vatic.trading/api/v1/history/range?asset=btc&type=1hour&start=1775210400&end=1775296800"
{
"asset": "btc",
"marketType": "1hour",
"provider": "binance",
"count": 24,
"history": [
{
"timestamp_start": 1775210400,
"timestamp_end": 1775214000,
"ok": true,
"price": 106700.12
}
],
"timeseries": []
}{
"error": "Range too large (1440 points). Maximum is 1000",
"hint": "Use a smaller time range or larger interval"
}Returns either aligned market windows or underlying Binance source data for 1hour and daily markets.
| Field | Location | Type | Required | Description |
|---|---|---|---|---|
| asset | query | string | Yes | Asset slug. |
| type | query | "1hour" | "daily" | Yes | Binance-backed market type. |
| start | query | timestamp | Yes | Range start. |
| end | query | timestamp | Yes | Range end. |
| mode | query | "market" | "source" | No | Defaults to market. |
| includeOutcomeMeta | query | boolean | No | Only relevant in source mode. |
curl "https://api.vatic.trading/api/v1/history/binance/range?asset=btc&type=1hour&mode=source&includeOutcomeMeta=true&start=1775210400&end=1775217600"
{
"asset": "btc",
"marketType": "1hour",
"provider": "binance",
"mode": "source",
"method": "aggTrades",
"count": 120,
"points": [
{
"timestamp": 1775210401,
"price": 106700.12,
"corresponding_market_slug": "btc-updown-1h-1775210400",
"target_price": 106745.8
}
]
}{
"error": "Invalid mode. Supported modes: market, source"
}Returns aligned market windows or raw Chainlink report pages for 5min, 15min, and 4hour markets.
| Field | Location | Type | Required | Description |
|---|---|---|---|---|
| asset | query | string | Yes | Asset slug. |
| type | query | "5min" | "15min" | "4hour" | Yes | Chainlink-backed market type. |
| start | query | timestamp | Yes | Range start. |
| end | query | timestamp | Yes | Range end. |
| mode | query | "market" | "source" | No | Defaults to market. |
| includeOutcomeMeta | query | boolean | No | Only relevant in source mode. |
curl "https://api.vatic.trading/api/v1/history/chainlink/range?asset=eth&type=15min&mode=source&start=1775296800&end=1775300400"
{
"asset": "eth",
"marketType": "15min",
"provider": "chainlink",
"mode": "source",
"method": "getReportsPage",
"count": 42,
"points": [
{
"timestamp": 1775297003,
"price": 3921.81,
"corresponding_market_slug": "eth-updown-15m-1775296800"
}
]
}{
"error": "Chainlink credentials not configured",
"hint": "Set CHAINLINK_USERNAME and CHAINLINK_PASSWORD"
}Builds the chronological market schedule for one UTC day and one or more intervals, including generated Polymarket slugs.
| Field | Location | Type | Required | Description |
|---|---|---|---|---|
| asset | query | string | Yes | Asset slug. |
| interval or intervals | query | string | No | Single interval or comma-separated intervals. |
| date | query | YYYY-MM-DD | Yes | UTC date to enumerate. |
curl "https://api.vatic.trading/api/v1/markets/timestamps?asset=btc&intervals=5min,1hour&date=2026-04-04"
{
"asset": "btc",
"utc_date": "2026-04-04",
"data": {
"5min": {
"count": 288,
"chronological_order": [
{
"index": 1,
"timestamp_start": 1775251200,
"slug": "btc-updown-5m-1775251200",
"url": "https://polymarket.com/event/btc-updown-5m-1775251200"
}
]
}
}
}{
"error": "Use interval=5m|15m|1hour|4h|daily or intervals as comma-separated list"
}Maps a human-readable Polymarket slug and outcome label to a tradeable CLOB token ID.
| Field | Location | Type | Required | Description |
|---|---|---|---|---|
| slug | query | string | Yes | Polymarket market slug. |
| outcome | query | string | Yes | Outcome label, case-insensitive. |
| eventSlug | query | string | No | Optional safety check that the market belongs to a specific event. |
curl "https://api.vatic.trading/api/v1/markets/tokenId?slug=will-bitcoin-be-above-110k-on-april-5&outcome=Yes"
{
"tokenId": "716340470000000000000000000000000000",
"outcome": "Yes",
"outcomeIndex": 0,
"conditionId": "0xcba248...",
"negRisk": true,
"slug": "will-bitcoin-be-above-110k-on-april-5",
"eventSlug": "bitcoin-above-110k-on-april-5",
"question": "Will Bitcoin be above 110k on April 5?"
}{
"error": "Outcome "Maybe" not found",
"availableOutcomes": ["Yes", "No"]
}Builds and signs a CLOB order using the server-managed signer for a provisioned trading wallet, then posts it directly to Polymarket.
| Field | Location | Type | Required | Description |
|---|---|---|---|---|
| walletId | body | UUID | Yes | Provisioned trading wallet from the dashboard. |
| tokenId | body | string | Yes | Polymarket outcome token ID. |
| side | body | "BUY" | "SELL" | Yes | Order side. |
| price | body | number | Yes | Limit price from 0.01 to 0.99. |
| size | body | number | Yes | Size in USDC-equivalent units, minimum 1. |
curl -X POST "https://api.vatic.trading/api/v1/orders" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"walletId": "9eb7f0bb-0f0b-4a2d-8d84-50f141d36241",
"tokenId": "716340470000000000000000000000000000",
"side": "BUY",
"price": 0.52,
"size": 25
}'{
"ok": true,
"orderId": "0x3b0a...",
"status": "submitted",
"safeAddress": "0x832c...",
"order": {
"tokenId": "716340470000000000000000000000000000",
"side": "BUY",
"price": 0.52,
"size": 25,
"makerAmount": "13000000",
"takerAmount": "25000000"
}
}{
"error": "API key required",
"hint": "Pass your key via Authorization: Bearer <key>, X-Api-Key header, or ?apiKey= query param."
}The highest-level trading endpoint: resolve slug plus outcome to tokenId, then submit a market order with one request.
| Field | Location | Type | Required | Description |
|---|---|---|---|---|
| walletId | body | UUID | Yes | Provisioned trading wallet. |
| slug | body | string | Yes | Polymarket market slug. |
| outcome | body | string | Yes | Outcome label, case-insensitive. |
| side | body | "BUY" | "SELL" | Yes | Order side. |
| amount | body | number | Yes | BUY spends USDC. SELL uses share amount. |
| eventSlug | body | string | No | Optional event slug validator. |
| orderType | body | "FOK" | "FAK" | No | Defaults to FOK. |
curl -X POST "https://api.vatic.trading/api/v1/simpleOrders/easyMarketOrder" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"walletId": "9eb7f0bb-0f0b-4a2d-8d84-50f141d36241",
"slug": "will-bitcoin-be-above-110k-on-april-5",
"outcome": "Yes",
"side": "BUY",
"amount": 3,
"orderType": "FOK"
}'{
"ok": true,
"orderId": "0xc5b5...",
"status": "matched",
"latencyS": 1.81,
"order": {
"slug": "will-bitcoin-be-above-110k-on-april-5",
"outcome": "Yes",
"tokenId": "716340470000000000000000000000000000",
"side": "BUY",
"amount": 3,
"negRisk": true
}
}{
"error": "Outcome "Up" not found",
"availableOutcomes": ["Yes", "No"]
}The fastest market-order route when the caller already knows the tokenId.
| Field | Location | Type | Required | Description |
|---|---|---|---|---|
| walletId | body | UUID | Yes | Provisioned trading wallet. |
| tokenId | body | string | Yes | Polymarket outcome token ID. |
| side | body | "BUY" | "SELL" | Yes | Order side. |
| amount | body | number | Yes | BUY spends USDC. SELL uses share amount. |
| negRisk | body | boolean | No | If omitted, the server auto-detects it via CLOB. |
| orderType | body | "FOK" | "FAK" | No | Defaults to FOK. |
| steps | body | 1 | 2 | 3 | No | Execution mode selector. |
curl -X POST "https://api.vatic.trading/api/v1/simpleOrders/createMarketOrder" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"walletId": "9eb7f0bb-0f0b-4a2d-8d84-50f141d36241",
"tokenId": "716340470000000000000000000000000000",
"side": "BUY",
"amount": 2,
"negRisk": true,
"steps": 1
}'{
"ok": true,
"orderId": "0x3b0a...",
"status": "matched",
"latencyS": 0.54,
"steps": 1,
"order": {
"tokenId": "716340470000000000000000000000000000",
"side": "BUY",
"amount": 2,
"negRisk": true,
"negRiskSource": "provided"
}
}{
"ok": false,
"error": "CLOB rejected order (status rejected)",
"latencyS": 0.62,
"order": {
"tokenId": "716340470000000000000000000000000000",
"side": "BUY",
"amount": 2,
"negRisk": true
}
}Places a GTC limit order using tokenId, price, and share size.
| Field | Location | Type | Required | Description |
|---|---|---|---|---|
| walletId | body | UUID | Yes | Provisioned trading wallet. |
| tokenId | body | string | Yes | Polymarket outcome token ID. |
| side | body | "BUY" | "SELL" | Yes | Order side. |
| price | body | number | Yes | Limit price from 0.01 to 0.99. |
| size | body | number | Yes | Number of shares. |
| negRisk | body | boolean | No | If omitted, the server auto-detects it. |
| expiration | body | unix timestamp | No | Defaults to 0, which means no expiry. |
curl -X POST "https://api.vatic.trading/api/v1/simpleOrders/createLimitOrder" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"walletId": "9eb7f0bb-0f0b-4a2d-8d84-50f141d36241",
"tokenId": "716340470000000000000000000000000000",
"side": "BUY",
"price": 0.8,
"size": 5,
"negRisk": true
}'{
"ok": true,
"orderId": "0x9d32...",
"status": "live",
"latencyS": 0.61,
"order": {
"tokenId": "716340470000000000000000000000000000",
"side": "BUY",
"price": 0.8,
"size": 5,
"negRisk": true,
"negRiskSource": "provided",
"expiration": 0
}
}{
"error": "price must be between 0.01 and 0.99"
}Returns open orders for the authenticated user’s provisioned trading wallet and forwards the usual Polymarket filters.
| Field | Location | Type | Required | Description |
|---|---|---|---|---|
| walletId | query | UUID | Yes | Provisioned trading wallet. |
| market | query | string | No | Condition ID filter. |
| asset_id | query | string | No | Token ID filter. |
| id | query | string | No | Specific order hash. |
| next_cursor | query | string | No | Cursor for pagination. |
curl "https://api.vatic.trading/api/v1/orders?walletId=9eb7f0bb-0f0b-4a2d-8d84-50f141d36241" \ -H "Authorization: Bearer YOUR_API_KEY"
{
"ok": true,
"data": [
{
"id": "0xabc...",
"status": "ORDER_STATUS_LIVE",
"maker_address": "0x832c...",
"asset_id": "71634047...",
"side": "BUY",
"price": "0.85"
}
]
}{
"error": "Invalid or revoked API key",
"hint": "Generate a new key at https://api.vatic.trading/dashboard/api-keys"
}Pushes the current and newly opened target windows to subscribers without polling.
| Field | Location | Type | Required | Description |
|---|---|---|---|---|
| type | message | "subscribe" | "unsubscribe" | Yes | WebSocket message type. |
| asset | message | string | No | Required for subscribe. |
| marketTypes | message | string[] | No | Optional on subscribe. Defaults to all supported types. |
wscat -c "wss://api.vatic.trading/ws"
> {"type":"subscribe","asset":"btc","marketTypes":["5min","15min"]}{
"event": "window_open",
"asset": "btc",
"marketType": "5min",
"windowStart": 1775297700,
"windowStartIso": "2026-04-04T10:15:00.000Z",
"price": 107233.42,
"source": "chainlink",
"snapshot": true
}{
"event": "error",
"error": "No valid market types provided"
}