# Moondev — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Access live crypto market data from MoonDev's public endpoints: aggregated Hyperliquid positions near liquidation, fees leaderboard, PnL share stats by address, Polymarket sweep trades, and soon-to-expire Polymarket markets — plus a single aggregate endpoint that pulls all major datastreams at once.

**Category:** Web3 & Onchain | **Website:** [moondev.com/](https://moondev.com/) | **Docs:** [parse.bot/marketplace/b3021ad8-f032-49a0-9ee5-8889746389fd/moondev-com-api](https://parse.bot/marketplace/b3021ad8-f032-49a0-9ee5-8889746389fd/moondev-com-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-moondev-com-api-b3021ad8/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### all_datastreams

One-shot aggregator collecting major public datastreams across MoonDev tabs (fees leaderboard, positions feed, Polymarket sweeps/expiring, stream config, clips check, data status). Optionally include address-focused PnL and filtered positions when an address is provided. Individual stream failures are captured in the errors object without failing the whole request.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `address` | string | No | Optional EVM address (0x + 40 hex) to also return PnL share view and address-filtered positions. |
| `address_max_pages` | integer | No | Max pages to scan for address liquidation matches (safety cap, max 50). |
| `include_clips` | boolean | No | Include clips_check stream. |
| `include_polymarket` | boolean | No | Include polymarket sweeps and expiring streams. |
| `include_positions` | boolean | No | Include the positions_feed stream. |
| `include_stream` | boolean | No | Include stream_config stream. |
| `min_value` | integer | No | Minimum notional value filter (reserved for future graveyard integration). |
| `per_page` | integer | No | Items per page (reserved for future graveyard integration). |
| `period` | string | No | PnL period selector used when address is provided. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-moondev-com-api-b3021ad8/all_datastreams \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"address":"<string>","address_max_pages":"<integer>","include_clips":"<boolean>","include_polymarket":"<boolean>","include_positions":"<boolean>","include_stream":"<boolean>","min_value":"<integer>","per_page":"<integer>","period":"<string>"}'
```

### clips_check

Polling endpoint used by MoonDev's site to detect newly published clips. Returns clip availability status and total clip count.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-moondev-com-api-b3021ad8/clips_check \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### data_status

Metadata and status for MoonDev's premium datasets (liquidations, OI). Returns status string, last_updated timestamp (or null), and file_size (or null) for each dataset. Does not download any files.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-moondev-com-api-b3021ad8/data_status \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### fees_leaderboard

Fees leaderboard showing the top 25 addresses by total fees paid on Hyperliquid. Each entry includes total trades, volume, fees paid, bot fees, savings, patience savings, and submission timestamp. No input parameters required.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-moondev-com-api-b3021ad8/fees_leaderboard \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### hl_share_create

Create a MoonDev PnL share code for a given Hyperliquid/EVM address. Each call creates a new share code; if a code already exists for this address, returns the existing code alongside the new one. Share codes are used to view PnL statistics via hl_share_view.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `address` | string | Yes | EVM address (0x + 40 hex characters). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-moondev-com-api-b3021ad8/hl_share_create \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"address":"<string>"}'
```

### hl_share_view

Fetch PnL statistics and chart series for a given share code. Returns account value history, total PnL, volume, profitability flag, available time periods, view count, and creation timestamp.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `period` | string | No | Time period selector. |
| `share_code` | string | Yes | Share code returned by hl_share_create. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-moondev-com-api-b3021ad8/hl_share_view \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"period":"<string>","share_code":"<string>"}'
```

### pnl_for_address

Convenience endpoint: creates (or reuses) a share code for an EVM address and immediately fetches its PnL statistics and chart data in a single call. Combines hl_share_create and hl_share_view into one round-trip.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `address` | string | Yes | EVM address (0x + 40 hex characters). |
| `period` | string | No | Time period selector. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-moondev-com-api-b3021ad8/pnl_for_address \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"address":"<string>","period":"<string>"}'
```

### polymarket_expiring

Polymarket markets expiring soon, sorted by time remaining. Returns market slugs, titles, end times (Unix timestamp), total sweep volumes, last_updated timestamps, and hours until expiry.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | integer | No | Number of items to return. 0 returns all available items. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-moondev-com-api-b3021ad8/polymarket_expiring \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>"}'
```

### polymarket_sweeps

Recent Polymarket sweep trades surfaced on MoonDev. Returns trades with market details, USD amounts, outcomes, and trader info. When the sweeps database is unavailable, returns an empty sweeps array with a descriptive message.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | integer | No | Number of items to return. 0 returns all available items. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-moondev-com-api-b3021ad8/polymarket_sweeps \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>"}'
```

### positions_by_address

Filter the public positions feed to only positions belonging to a specific EVM address. Returns matching longs and shorts from the top-positions feed along with feed metadata. An address with no positions in the top feed returns empty arrays.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `address` | string | Yes | EVM address (0x + 40 hex characters). |
| `api_key` | string | No | API key for the MoonDev positions feed. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-moondev-com-api-b3021ad8/positions_by_address \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"address":"<string>","api_key":"<string>"}'
```

### positions_feed

Public aggregated positions feed showing the top 50 longs and 50 shorts by proximity to liquidation. Returns position details including entry price, liquidation price, leverage, PnL, and websocket connectivity status. Positions are sourced from Hyperliquid via MoonDev's real-time websocket connection.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `api_key` | string | No | API key for the MoonDev positions feed. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-moondev-com-api-b3021ad8/positions_feed \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"api_key":"<string>"}'
```

### stream_config

Live stream metadata including headline, scheduled date and times, topics array, and template configuration. Reflects the current or next scheduled stream on MoonDev's site.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-moondev-com-api-b3021ad8/stream_config \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```
