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

# Natural Language Processing

> Convert text commands into blockchain transactions

Neyrs's NLP engine parses natural language input and extracts transaction parameters without requiring complex UI interactions.

## Supported Commands

### Token Swaps

```text theme={null}
Swap 10 SOL for USDC
```

```text theme={null}
Exchange 100 USDC for BONK with 2% slippage
```

```text theme={null}
Trade 50 USDC to JUP
```

### Token Transfers

```text theme={null}
Send 5 USDC to 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU
```

```text theme={null}
Transfer 0.1 SOL to alice.sol
```

### Staking Operations

```text theme={null}
Stake 10 SOL
```

```text theme={null}
Unstake 5 SOL from validator
```

### Portfolio Queries

```text theme={null}
Show my balance
```

```text theme={null}
What's my portfolio worth?
```

```text theme={null}
Display transaction history
```

### Price Checks

```text theme={null}
What's the price of JUP?
```

```text theme={null}
Show me SOL price in USD
```

### Commerce

```text theme={null}
Buy a $50 Amazon gift card with USDC
```

```text theme={null}
Purchase item using USDC
```

## Entity Extraction

The intent parser identifies key components from your command:

| Entity           | Example                | Description                 |
| ---------------- | ---------------------- | --------------------------- |
| **Action**       | swap, send, stake, buy | Operation type              |
| **Input Token**  | SOL, USDC              | Source token                |
| **Output Token** | BONK, JUP              | Destination token           |
| **Amount**       | 10, 0.5                | Quantity to transact        |
| **Slippage**     | 1%, 2%                 | Maximum acceptable slippage |
| **Address**      | 7xKXtg...              | Recipient wallet            |

## Processing Flow

<Steps>
  <Step title="Tokenization">
    Input text is split into tokens and normalized
  </Step>

  <Step title="Entity Recognition">
    NLP model identifies tokens, amounts, and addresses
  </Step>

  <Step title="Intent Classification">
    Command categorized as swap, transfer, stake, or query
  </Step>

  <Step title="Parameter Validation">
    Extracted values checked for validity and completeness
  </Step>

  <Step title="Transaction Construction">
    Valid parameters passed to routing or execution layer
  </Step>
</Steps>

## Slippage Configuration

Default slippage is 0.5% (50 basis points). Override with explicit commands:

```text theme={null}
Swap 100 USDC for SOL with 1% slippage
```

```text theme={null}
Trade 50 USDC to BONK, max slippage 2%
```

<Warning>
  Higher slippage increases execution probability but may result in worse prices. Use minimum slippage necessary for your trade size.
</Warning>

## Address Formats

Neyrs supports multiple address formats:

* **Full Solana Address:** `7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU`
* **SNS Domains:** `alice.sol`, `bob.sol`
* **Shortened Format:** `7xKX...gAsU` (must be unambiguous)

## Error Handling

If the parser cannot extract required parameters, Neyrs will prompt for clarification:

**User:** "Swap SOL"

**Neyrs:** "How much SOL would you like to swap, and for which token?"

**User:** "10 SOL for USDC"

**Neyrs:** *Proceeds with transaction*

## Performance

| Metric           | Value |
| ---------------- | ----- |
| Parse Time (p50) | 35ms  |
| Parse Time (p99) | 68ms  |
| Entity Accuracy  | 98.1% |
| Intent Accuracy  | 99.4% |

<Note>
  The NLP model is continuously improved based on user interactions. Ambiguous commands help train better entity recognition.
</Note>
