# @elizaos/plugin-0x

## Purpose

This plugin enables Eliza to interact with the 0x Protocol, providing decentralized exchange capabilities across multiple evm blockchain networks with optimized token swaps and liquidity aggregation.

## Key Features

- Supports multiple networks including Ethereum Mainnet, Polygon, Binance Smart Chain, Arbitrum, Optimism, Base, Linea, Scroll, Avalanche, and Blast

## Installation

```bash
bun install @elizaos/plugin-0x
```

## Configuration

Set environment variables:

```env
WALLET_PRIVATE_KEY=your_private_key
ZERO_EX_API_KEY=your_0x_api_key
{chain}_RPC_URL=your_rpc_endpoint
```

## Integration

```typescript
import { zeroExPlugin } from '@elizaos/plugin-0x';
```

## Example Usage

The plugin supports natural language commands:

- "I want to convert 1 ETH to USDC on ethereum chain"
- "Give me the quote"
- "Execute it"

Available actions:

1. GET_INDICATIVE_PRICE_0X: Get indicative prices for token swaps
2. GET_QUOTE_0X: Get the quote for the swap
3. EXECUTE_SWAP_0X: Execute token swaps

## Links

- [0x Protocol](https://0x.org/)
- [0x API Documentation](https://0x.org/docs/api)
