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

# Chainlink Price Oracle

> Real-time crypto price agent using Chainlink price feeds on Ethereum mainnet

<Info>**Source:** [`examples/chainlink`](https://github.com/AgentlyHQ/aixyz/tree/main/examples/chainlink)</Info>

## Overview

The Chainlink Price Oracle agent provides real-time cryptocurrency price data by reading Chainlink price feeds directly from Ethereum mainnet. It demonstrates on-chain data integration with an aixyz agent, gated behind x402 payments.

## Project Structure

```
chainlink/
├── aixyz.config.ts           # Agent metadata and skills
├── app/
│   ├── agent.ts              # Agent with Chainlink lookup tool
│   ├── tools/
│   │   └── lookup.ts         # Chainlink price feed reader
│   └── icon.png              # Agent icon
├── package.json
└── vercel.json
```

## Skills

| Skill                  | Description                                                          |
| ---------------------- | -------------------------------------------------------------------- |
| Chainlink Price Lookup | Look up real-time cryptocurrency prices in USD using Chainlink feeds |

## Configuration

```typescript title="aixyz.config.ts" theme={null}
const config: AixyzConfig = {
  name: "Chainlink Price Oracle",
  description:
    "AI agent that provides real-time cryptocurrency price data using Chainlink price feeds on Ethereum mainnet.",
  version: "1.0.0",
  x402: {
    payTo: process.env.X402_PAY_TO!,
    network: process.env.X402_NETWORK!,
  },
};
```

## Key Features

* **On-chain data** — Reads directly from Chainlink price feeds on Ethereum mainnet
* **Symbol validation** — Does not assume token symbols; validates via the tool
* **Environment-driven config** — Payment address and network set via environment variables
* **Auto-generated server** — No custom `server.ts` needed

## Payment

The agent charges `$0.01` per request via x402. Payment destination is configured via environment variables.

## Environment Variables

| Variable         | Description                           |
| ---------------- | ------------------------------------- |
| `OPENAI_API_KEY` | OpenAI API key                        |
| `X402_PAY_TO`    | Payment destination address           |
| `X402_NETWORK`   | Payment network (e.g., `eip155:8453`) |

## Running

```bash theme={null}
cd examples/chainlink
bun install
bun run dev
```
