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

# Cursor Setup

> Set up Cursor IDE for Yield.xyz development

## Overview

Cursor is an AI-powered IDE that makes it easy to write code while integrating with Yield.xyz APIs. Here's how to set up Cursor to build with our documentation.

This will let you interact with our docs directly and get the most accurate answers to your questions.

***

## Quick Setup

<Steps>
  <Step title="Open Cursor Settings">
    Go to **Cursor Settings** → **Features** → **Docs** and click **"+ Add new doc"**
  </Step>

  <Step title="Add Yield.xyz Docs">
    Paste this URL:

    ```
    https://docs.yield.xyz
    ```
  </Step>

  <Step title="Configure the Doc">
    * Change the name to **Yield.xyz**
    * Leave everything else the same
  </Step>

  <Step title="Wait for Indexing">
    Wait until the docs have been fully indexed. You can check the progress in Cursor Settings.
  </Step>

  <Step title="Reference in Prompts">
    Now you can reference the Yield.xyz docs in your prompt using **@Yield.xyz**
  </Step>
</Steps>

***

## Adding the OpenAPI Spec

For even better API understanding, add the OpenAPI spec:

<Steps>
  <Step title="Add OpenAPI Spec">
    In Cursor Settings → Docs, add another doc with URL:

    ```
    https://api.yield.xyz/docs.yaml
    ```
  </Step>

  <Step title="Name it">
    Name it **Yield.xyz API** to distinguish from the main docs
  </Step>
</Steps>

***

## Example Usage

Once set up, you can reference Yield.xyz docs in your prompts:

### Generate API Calls

```
@Yield.xyz Create a function to enter a Lido staking position 
for a given address and amount using the v2 API
```

### Understand Responses

```
@Yield.xyz Explain the balance types returned by the 
/v1/yields/balances endpoint
```

### Fix Errors

```
I'm getting this error from Yield.xyz API:
{"error": "Bad Request", "message": "Validation failed"}

@Yield.xyz How do I fix this for the enter action?
```

### Build Complete Flows

```
@Yield.xyz Create a complete React hook that:
1. Fetches available yields for a network
2. Allows user to enter a yield
3. Tracks transaction status
4. Shows user balances
```

***

## Recommended Prompts for Yield.xyz

### Discovery

```
@Yield.xyz How do I list all staking yields on Ethereum 
with APY above 5%?
```

### Enter Flow

```
@Yield.xyz Walk me through the complete flow to stake ETH 
with Lido using the API, including transaction signing.
```

### Balance Tracking

```
@Yield.xyz How do I get all positions for a user across 
multiple networks? Show me the request and response format.
```

### Manage Actions

```
@Yield.xyz How do I claim rewards for a Cosmos staking 
position? What's the passthrough field for?
```

***

## Best Practices

<CardGroup cols={2}>
  <Card title="Be Specific" icon="bullseye">
    Reference specific endpoints or concepts from the docs
  </Card>

  <Card title="Share Context" icon="file">
    Include error messages and your current code
  </Card>

  <Card title="Reference Docs" icon="book">
    Always use @Yield.xyz to ground the AI in accurate information
  </Card>

  <Card title="Verify Code" icon="check">
    Always test generated code against the actual API
  </Card>
</CardGroup>

***

## Troubleshooting

<AccordionGroup>
  <Accordion title="Docs not indexing">
    Check that the URL is correct and accessible. Try refreshing Cursor settings.
  </Accordion>

  <Accordion title="AI giving outdated information">
    Make sure to reference @Yield.xyz in your prompt to use the indexed docs rather than training data.
  </Accordion>

  <Accordion title="API calls failing">
    Verify your API key is correct and you're using the right endpoint format. Check our [API Reference](/api-reference/getting-started).
  </Accordion>
</AccordionGroup>

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Prompting Patterns" icon="message" href="/guides/ai/prompting-patterns">
    Effective prompts for Yield.xyz
  </Card>

  <Card title="Guardrails" icon="shield" href="/guides/ai/guardrails">
    AI safety best practices
  </Card>
</CardGroup>
