> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nilemarkets.com/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenClaw Skill

> Read-only OpenClaw skill published on ClawHub that exposes 12 MCP tools for querying Nile Markets protocol data — install via clawhub install nile-markets.

## What It Is

The Nile Markets OpenClaw skill is an [agentskills.io](https://agentskills.io)-format skill published on [ClawHub](https://clawhub.io). It provides **read-only** access to the Nile Markets protocol by delegating all queries to the Nile MCP server at `mcp.nilemarkets.com`. The skill exposes 12 MCP tools for querying pool state, positions, oracle prices, account balances, and fee analytics.

## Installation

Install the ClawHub CLI globally, then install the skill:

```bash theme={null}
npm install -g clawhub
clawhub install nile-markets
```

### Prerequisites

Set the MCP server URL as an environment variable before using the skill:

```bash theme={null}
export NILE_MCP_URL="https://mcp.nilemarkets.com/api/mcp"
```

Add this to your shell profile (`.bashrc`, `.zshrc`, etc.) for persistence.

## Available Tools (12)

All tools are read-only. They return JSON responses with `protocol` (name + version), `network`, and `data` fields. Tools sourcing data from the subgraph include `_meta.lastIndexedBlock` for freshness verification.

### Pool and Protocol

| Tool                | Description                                                                            | Input |
| ------------------- | -------------------------------------------------------------------------------------- | ----- |
| `get_pool_state`    | Liquidity pool metrics: total assets, shares, share price, exposure, utilization, fees | None  |
| `get_protocol_mode` | Operating mode: NORMAL, DEGRADED, REDUCE\_ONLY, or PAUSED                              | None  |

### Positions

| Tool               | Description                                | Input                                                           |
| ------------------ | ------------------------------------------ | --------------------------------------------------------------- |
| `get_positions`    | Positions for a specific account           | `account` (required), `status?`, `first?`, `skip?`              |
| `get_position`     | Single position with real-time PnL via RPC | `id` (required)                                                 |
| `search_positions` | Search all positions with filters          | `side?`, `tenor?`, `status?`, `minNotional?`, `first?`, `skip?` |

### Oracle and Pricing

| Tool                | Description                                           | Input                                  |
| ------------------- | ----------------------------------------------------- | -------------------------------------- |
| `get_forward_price` | EUR/USD forward price for a specific tenor            | `tenor?` (1D, 1W, 1M, or omit for all) |
| `get_oracle_state`  | Full oracle state: spot, all forward prices, validity | None                                   |

### Accounts and Fees

| Tool                    | Description                                                     | Input                       |
| ----------------------- | --------------------------------------------------------------- | --------------------------- |
| `get_account`           | Account margin: collateral, locked, available, position count   | `address` (required)        |
| `get_daily_stats`       | Daily volume, fees, position opens/closes                       | `days?` (default 7, max 90) |
| `get_pool_transactions` | Historical vault deposits and withdrawals                       | `first?`, `skip?`           |
| `get_fee_events`        | Fee event breakdown (trading, liquidation, termination, oracle) | `first?`, `skip?`           |

### Simulation

| Tool                     | Description                                              | Input                                |
| ------------------------ | -------------------------------------------------------- | ------------------------------------ |
| `simulate_open_position` | Preview margin, fee, and entry strike for a new position | `side`, `tenor`, `notional`, `from?` |

## Example Queries

Ask your agent questions naturally once the skill is loaded:

* **"What's the current Nile Markets pool utilization and share price?"** -- uses `get_pool_state`
* **"Show me all open positions for 0x1234...abcd"** -- uses `get_positions` with `status: "OPEN"`
* **"What are the EUR/USD forward prices for all tenors?"** -- uses `get_forward_price` without a tenor filter
* **"Is the Nile Markets protocol operating normally?"** -- uses `get_protocol_mode`
* **"How much margin for a 1000 USDC long 1-week position?"** -- uses `simulate_open_position`
* **"Find all open short positions above 5000 USDC notional"** -- uses `search_positions` with filters

## Verify Installation

Confirm the skill is installed and inspect its metadata:

```bash theme={null}
clawhub list | grep nile-markets
```

```bash theme={null}
clawhub inspect nile-markets
```

The inspect command shows the skill version, tool count, environment requirements, and MCP server URL.

## Limitations

The OpenClaw skill is **read-only**. It cannot:

* Open, close, or modify positions onchain
* Deposit or withdraw margin or vault funds
* Approve token spending or mint test tokens
* Manage wallets, private keys, or sign transactions

For write operations, connect to the Nile MCP server directly using any MCP-compatible client. See the [MCP Server](/ai-agents/mcp-server) page for setup instructions, or use the [Claude Code Plugin](/ai-agents/claude-code-plugin) which includes both read and write tools.

<Note>
  The skill connects to the Nile Markets MCP server on Ethereum Sepolia. All protocol data is testnet-only with no real-world value. Tool schemas and response formats may change without notice during the M2 milestone.
</Note>
