Skip to main content

Documentation Index

Fetch the complete documentation index at: https://yieldxyz.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Overview

The Yield.xyz API enables you to stay at the forefront of innovation while maintaining full compliance with global regulatory standards. Our built-in geoblocking system ensures your integration remains compliant — without requiring you to maintain country-by-country enforcement logic.
Geoblocking allows you to selectively restrict access to yield-related functionality based on a user’s location — at the country or region level — using a flexible, configuration-based system.

How It Works

Geoblocking is enforced at the action level — including all enter, exit, and manage flows. If a user is in a blocked region, the API returns a 403 Forbidden error and prevents the transaction from being created. All geoblocking checks are performed at the project level, allowing you to define your own compliance posture.

Configuration Options

Manage geoblocking settings directly in your dashboard:

Auto Compliance Mode

Block all regions on global compliance risk lists (OFAC, OFSI, crypto bans, staking bans)

Manual Configuration

Add or remove specific country or region-level restrictions

Override Locations

Allow specific locations to match your legal position

Default OFAC

By default, only OFAC-level restrictions are applied

Configure Geoblocking

Manage your geoblocking settings in the dashboard

Region Categories

Yield.xyz maintains an up-to-date global region list across several categories:
Countries with explicit bans on cryptocurrency trading, staking, or DeFi use.Block access from these regions to align with local regulations.

Error Response

If a request is blocked due to geoblocking, the API returns:
{
  "message": "Access denied from US (US-CA)",
  "error": "Forbidden",
  "statusCode": 403
}
The response includes the detected region, making it easy to handle programmatically or inform the user.

Implementation Example

try {
  const action = await fetch('https://api.yield.xyz/v1/actions/enter', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'X-API-Key': apiKey,
    },
    body: JSON.stringify({
      yieldId: 'ethereum-eth-lido-staking',
      address: userAddress,
      arguments: { amount: '1000000000000000000' },
    }),
  });

  if (!action.ok) {
    const error = await action.json();
    
    if (error.statusCode === 403) {
      // Handle geoblocking
      console.log('User blocked:', error.message);
      showGeoblockingMessage(error.message);
      return;
    }
  }
  
  // Continue with action...
} catch (error) {
  console.error('Request failed:', error);
}

Next Steps

Geoblocked Countries

View full country list

Geoblocked US States

View US state restrictions