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

# Cómo saber quién financió una billetera de Solana

> Descubre la fuente de financiamiento original de cualquier billetera de Solana rastreando su primera transferencia entrante de SOL. Identifica el financiamiento proveniente de exchanges, la atribución y las relaciones entre billeteras.

<Note>
  La Wallet API está en fase beta. Los endpoints y formatos de respuesta pueden cambiar.
</Note>

## Descripción general

El endpoint Wallet Funding Source identifica quién financió originalmente una billetera de Solana mediante el análisis de su primera transferencia entrante de SOL. Resulta útil para la atribución, el cumplimiento normativo, la comprensión de las relaciones entre billeteras y la identificación de billeteras financiadas por exchanges.

El nombre y la categoría del financiador provienen del mismo sistema de identidad que utiliza el endpoint [Identity](/docs/es/wallet-api/identity). Por lo tanto, cuando el financiador es una entidad conocida, obtienes una etiqueta legible y una categoría directamente en la respuesta.

Este endpoint requiere un plan de pago. Las solicitudes realizadas con una API key del plan Free devuelven `403 Forbidden`. Consulta [Requisitos del plan](/docs/es/wallet-api/overview#requisitos-del-plan) para ver la tabla de cobertura completa.

## Cuándo usarlo

Usa la API Wallet Funding Source para lo siguiente:

* **Atribución de billeteras**: rastrea desde dónde se financian las billeteras nuevas.
* **Detección de exchanges**: identifica las billeteras financiadas directamente desde exchanges centralizados.
* **Cumplimiento normativo y AML**: marca las billeteras financiadas por entidades conocidas para realizar verificaciones de cumplimiento.
* **Detección de bots**: identifica granjas de bots financiadas desde la misma fuente.
* **Análisis de airdrops**: rastrea qué billeteras recibieron financiamiento inicial de un proyecto.
* **Detección de Sybil**: encuentra grupos de billeteras financiadas por la misma dirección.

## Inicio rápido

### Consulta básica de financiamiento

Descubre quién financió una billetera:

<Tabs>
  <Tab title="JavaScript">
    ```javascript theme={"system"}
    const getWalletFundingSource = async (address) => {
      const url = `https://api.helius.xyz/v1/wallet/${address}/funded-by?api-key=YOUR_API_KEY`;

      const response = await fetch(url);

      if (response.status === 404) {
        console.log('No funding transaction found for this wallet');
        return null;
      }

      if (!response.ok) {
        throw new Error(`HTTP error! status: ${response.status}`);
      }

      const funding = await response.json();

      console.log(`Funding Source: ${funding.funderName || funding.funder}`);
      console.log(`Funder Type: ${funding.funderType || 'Unknown'}`);
      console.log(`Initial Amount: ${funding.amount} SOL`);
      console.log(`Date: ${new Date(funding.timestamp * 1000).toLocaleString()}`);
      console.log(`Transaction: ${funding.explorerUrl}`);

      return funding;
    };

    getWalletFundingSource("86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY");
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={"system"}
    import requests
    from datetime import datetime

    def get_wallet_funding_source(address: str):
        url = f"https://api.helius.xyz/v1/wallet/{address}/funded-by"
        headers = {"X-Api-Key": "YOUR_API_KEY"}

        response = requests.get(url, headers=headers)

        if response.status_code == 404:
            print('No funding transaction found for this wallet')
            return None

        response.raise_for_status()
        funding = response.json()

        print(f"Funding Source: {funding.get('funderName') or funding['funder']}")
        print(f"Funder Type: {funding.get('funderType', 'Unknown')}")
        print(f"Initial Amount: {funding['amount']} SOL")
        print(f"Date: {datetime.fromtimestamp(funding['timestamp']).strftime('%Y-%m-%d %H:%M:%S')}")
        print(f"Transaction: {funding['explorerUrl']}")

        return funding

    get_wallet_funding_source("86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY")
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={"system"}
    curl "https://api.helius.xyz/v1/wallet/86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY/funded-by?api-key=YOUR_API_KEY"
    ```
  </Tab>
</Tabs>

## Formato de respuesta

Una respuesta exitosa describe la primera transferencia entrante de SOL de la billetera:

```json theme={"system"}
{
  "funder": "26MAyPNpK4At8LgRECMMbgiKQuJyg3oACtw1Q9FRyuba",
  "funderName": null,
  "funderType": null,
  "mint": "So11111111111111111111111111111111111111111",
  "symbol": "SOL",
  "amount": 0.09811972,
  "amountRaw": "98119720",
  "decimals": 9,
  "date": "2022-01-19T20:46:34.000Z",
  "signature": "5WX9C5kCQNULGGrSHJBR1WDFyetVyekbUpe1KQ45p3zEBe6jVgSsJuMqLWijjTDcnaAK2518ZriktRMCNycnsNAG",
  "timestamp": 1642625194,
  "slot": 116984883,
  "explorerUrl": "https://orbmarkets.io/tx/5WX9C5kCQNULGGrSHJBR1WDFyetVyekbUpe1KQ45p3zEBe6jVgSsJuMqLWijjTDcnaAK2518ZriktRMCNycnsNAG?tab=summary"
}
```

Si una billetera nunca ha recibido SOL, la API devuelve un error 404:

```json theme={"system"}
{
  "error": "No funding transaction found",
  "code": 404
}
```

### Notas sobre los campos

* **`funder`**: la dirección que envió la primera transferencia de SOL a esta billetera.
* **`funderName`**: nombre legible si el financiador es una entidad conocida (por ejemplo, un exchange o protocolo); de lo contrario, `null`.
* **`funderType`**: categoría del financiador (por ejemplo, `exchange`, `defi-protocol`); `null` si no está en la base de datos de identidades.
* **`mint`**: dirección de emisión del token (`So11111111111111111111111111111111111111111` para SOL).
* **`symbol`**: símbolo del token (siempre `SOL` para las transacciones de financiamiento).
* **`amount`**: cantidad inicial de SOL recibida (en formato legible, por ejemplo, `0.05` SOL).
* **`amountRaw`**: cantidad sin procesar en lamports como cadena (por ejemplo, `"50000000"` para 0.05 SOL).
* **`decimals`**: número de decimales del token (9 para SOL).
* **`date`**: cadena de fecha con formato ISO 8601 (por ejemplo, `"2024-01-01T00:00:00.000Z"`).
* **`signature`**: firma de la transacción de financiamiento.
* **`timestamp`**: marca de tiempo Unix (en segundos) del momento en que se financió la billetera.
* **`slot`**: número de slot de Solana en el que se confirmó la transacción de financiamiento.
* **`explorerUrl`**: enlace directo para ver la transacción en Orb.

## Casos de uso

### Detectar billeteras financiadas por exchanges

Identifica las billeteras financiadas directamente desde exchanges centralizados:

```javascript theme={"system"}
const isExchangeFunded = async (address) => {
  try {
    const funding = await getWalletFundingSource(address);

    if (!funding) {
      console.log('Wallet has no funding transaction');
      return false;
    }

    if (funding.funderType === 'exchange') {
      console.log(`Wallet was funded by ${funding.funderName}`);
      console.log(`This is likely a retail user withdrawing from an exchange`);
      return true;
    }

    console.log(`Wallet was not funded by an exchange`);
    return false;

  } catch (error) {
    console.error('Error checking funding source:', error);
    return false;
  }
};

isExchangeFunded("86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY");
```

### Encontrar grupos de billeteras (detección de Sybil)

Identifica grupos de billeteras financiadas por la misma fuente:

```javascript theme={"system"}
const findWalletClusters = async (walletAddresses) => {
  const fundingData = await Promise.all(
    walletAddresses.map(async address => {
      try {
        const funding = await getWalletFundingSource(address);
        return { address, funder: funding?.funder };
      } catch {
        return { address, funder: null };
      }
    })
  );

  // Group by funder
  const clusters = {};

  fundingData.forEach(({ address, funder }) => {
    if (funder) {
      if (!clusters[funder]) {
        clusters[funder] = [];
      }
      clusters[funder].push(address);
    }
  });

  // Report clusters
  Object.entries(clusters).forEach(([funder, wallets]) => {
    if (wallets.length > 1) {
      console.log(`\nFound cluster: ${wallets.length} wallets funded by ${funder.slice(0, 8)}...`);
      wallets.forEach(wallet => console.log(`  - ${wallet}`));
    }
  });

  return clusters;
};

// Example: Check list of wallets for clusters
const suspiciousWallets = [
  "Wallet1...",
  "Wallet2...",
  "Wallet3..."
];

findWalletClusters(suspiciousWallets);
```

### Rastrear destinatarios de airdrops

Analiza de dónde provienen los destinatarios de airdrops:

```javascript theme={"system"}
const analyzeAirdropRecipients = async (airdropWallets) => {
  const fundingSources = await Promise.all(
    airdropWallets.map(async address => {
      try {
        return await getWalletFundingSource(address);
      } catch {
        return null;
      }
    })
  );

  const stats = {
    total: airdropWallets.length,
    exchangeFunded: 0,
    unknown: 0,
    byExchange: {}
  };

  fundingSources.forEach(funding => {
    if (!funding) {
      stats.unknown++;
      return;
    }

    if (funding.funderType === 'exchange') {
      stats.exchangeFunded++;
      const exchange = funding.funderName || 'Unknown Exchange';
      stats.byExchange[exchange] = (stats.byExchange[exchange] || 0) + 1;
    }
  });

  console.log('Airdrop Recipient Analysis:');
  console.log(`Total Recipients: ${stats.total}`);
  console.log(`Exchange-Funded: ${stats.exchangeFunded} (${(stats.exchangeFunded / stats.total * 100).toFixed(1)}%)`);
  console.log(`Unknown Source: ${stats.unknown}`);
  console.log('\nBy Exchange:');
  Object.entries(stats.byExchange).forEach(([exchange, count]) => {
    console.log(`  ${exchange}: ${count}`);
  });

  return stats;
};
```

### Crear una cronología de la billetera

Crea una cronología a partir de la creación de la billetera:

```javascript theme={"system"}
const buildWalletTimeline = async (address) => {
  const funding = await getWalletFundingSource(address);

  if (!funding) {
    console.log('No funding data available');
    return null;
  }

  const creationDate = new Date(funding.timestamp * 1000);
  const ageInDays = Math.floor((Date.now() - creationDate.getTime()) / (1000 * 60 * 60 * 24));

  console.log('Wallet Timeline:');
  console.log(`Created: ${creationDate.toLocaleString()} (${ageInDays} days ago)`);
  console.log(`Initial Funding: ${funding.amount} SOL`);
  console.log(`Funded By: ${funding.funderName || funding.funder.slice(0, 8) + '...'}`);

  if (funding.funderType === 'exchange') {
    console.log(`This wallet was likely created by withdrawing from ${funding.funderName}`);
  }

  return {
    creationDate,
    ageInDays,
    initialFunding: funding.amount,
    fundedBy: funding.funderName || funding.funder
  };
};
```

### Puntuación de riesgo de cumplimiento

Asigna puntuaciones de riesgo según la fuente de financiamiento:

```javascript theme={"system"}
const assessWalletRisk = async (address) => {
  const funding = await getWalletFundingSource(address);

  if (!funding) {
    return { riskLevel: 'UNKNOWN', score: 50, reasons: ['No funding data available'] };
  }

  let score = 0;
  let reasons = [];

  // Low risk: Funded by known exchange
  if (funding.funderType === 'exchange') {
    score = 20;
    reasons.push(`Funded by known exchange (${funding.funderName})`);
  }
  // Medium risk: Unknown funder
  else if (!funding.funderName) {
    score = 50;
    reasons.push('Funded by unknown wallet');
  }
  // High risk: Funded by flagged address
  else if (funding.funderType === 'flagged') {
    score = 90;
    reasons.push('Funded by flagged address');
  }

  // Age factor: New wallets are higher risk
  const ageInDays = (Date.now() / 1000 - funding.timestamp) / (60 * 60 * 24);
  if (ageInDays < 7) {
    score += 20;
    reasons.push('Wallet is less than 7 days old');
  }

  // Amount factor: Very small initial funding is suspicious
  if (funding.amount < 0.01) {
    score += 10;
    reasons.push('Very small initial funding amount');
  }

  const riskLevel = score < 30 ? 'LOW' : score < 60 ? 'MEDIUM' : 'HIGH';

  console.log(`Risk Assessment for ${address}:`);
  console.log(`Risk Level: ${riskLevel} (Score: ${score}/100)`);
  reasons.forEach(reason => console.log(`  - ${reason}`));

  return { riskLevel, score, reasons };
};
```

### Seguimiento de atribución

Rastrea qué fuentes crean la mayor cantidad de billeteras nuevas:

```javascript theme={"system"}
const trackNewWalletSources = async (recentWallets) => {
  const fundingSources = await Promise.all(
    recentWallets.map(async address => {
      try {
        const funding = await getWalletFundingSource(address);
        return {
          address,
          funder: funding?.funder,
          funderName: funding?.funderName,
          funderType: funding?.funderType
        };
      } catch {
        return { address, funder: null };
      }
    })
  );

  // Count by source
  const sourceStats = {};

  fundingSources.forEach(({ funderName, funderType }) => {
    const sourceName = funderName || funderType || 'Unknown';
    sourceStats[sourceName] = (sourceStats[sourceName] || 0) + 1;
  });

  // Sort by count
  const sorted = Object.entries(sourceStats)
    .sort(([, a], [, b]) => b - a)
    .slice(0, 10);

  console.log('Top Wallet Funding Sources:');
  sorted.forEach(([source, count]) => {
    console.log(`${source}: ${count} wallets`);
  });

  return sourceStats;
};
```

## Tipos de financiadores

El campo `funderType` indica la categoría de la billetera que financió la dirección. Se admiten todos los valores de [Categorías de identidad](/docs/es/wallet-api/identity#categorías-de-identidad).

<Accordion title="Supported funder types">
  Tipos de financiadores comunes:

  | Tipo                 | Descripción                           | Ejemplos                                                        |
  | -------------------- | ------------------------------------- | --------------------------------------------------------------- |
  | Centralized Exchange | Billeteras activas de CEX             | Binance, Coinbase, Kraken, OKX                                  |
  | DeFi                 | Direcciones de protocolos DeFi        | Jupiter, Raydium, Marinade                                      |
  | Market Maker         | Empresas creadoras de mercado         | Jump Trading, Wintermute                                        |
  | Trading Firm         | Empresas de trading por cuenta propia | Operadores institucionales                                      |
  | Cross-chain Bridge   | Direcciones de protocolos puente      | Wormhole, AllBridge, Portal                                     |
  | Validator            | Direcciones de validadores            | Coinbase Validator, Jito                                        |
  | Key Opinion Leader   | Personas destacadas                   | Influencers, fundadores                                         |
  | Treasury             | Tesorerías de proyectos               | Tesorerías de protocolos                                        |
  | Stake Pool           | Pools de staking líquido              | Marinade, Jito                                                  |
  | null                 | Financiador desconocido               | Billetera normal que no está en la base de datos de identidades |

  La lista completa incluye: Airdrop, Authority, Cross-chain Bridge, Casino & Gambling, DAO, DeFi, DePIN, Centralized Exchange, Exploiter/Hackers/Scams, Fees, Fundraise, Game, Genesis Block Distribution, Governance, Hacker, Jito, Key Opinion Leader, Market Maker, Memecoin, Multisig, NFT, Non-Circulating Supply, Oracle, Other, Payments, Proprietary AMM, Restaking, Rugger, Scammer, Spam, Stake Pool, System, Tools, Trading App/Bot, Trading Firm, Transaction Sending, Treasury, Validator, Vault y X402.

  Consulta la sección [Categorías de identidad](/docs/es/wallet-api/identity#categorías-de-identidad) para ver la lista completa con descripciones.
</Accordion>

## Prácticas recomendadas

* **Gestiona las respuestas 404.** Las billeteras que nunca han recibido SOL devuelven un error 404. Esto es normal para las billeteras recién creadas que aún no tienen fondos.
* **Combínala con la Identity API.** La respuesta incluye `funderName` e `funderType`, pero puedes llamar al endpoint [Identity](/docs/es/wallet-api/identity) con la dirección `funder` para obtener más detalles.
* **Almacena en caché los datos de financiamiento.** La fuente de financiamiento de una billetera nunca cambia. Almacena estos datos permanentemente en caché para evitar llamadas repetidas a la API.
* **Comprueba la antigüedad para obtener contexto.** `timestamp` indica cuándo se financió la billetera por primera vez. Combina la antigüedad con la fuente de financiamiento para obtener más contexto.

## Errores comunes

| Código de error | Descripción                                          | Solución                                                                                                                                           |
| --------------- | ---------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| 400             | Formato de dirección de billetera no válido          | Verifica que la dirección sea una dirección de Solana válida en base58                                                                             |
| 401             | API key ausente o no válida                          | Comprueba que la API key esté incluida en la solicitud                                                                                             |
| 403             | El endpoint requiere un plan de pago                 | Las consultas de fuentes de financiamiento no están disponibles en el plan Free. [Mejora tu plan](https://dashboard.helius.dev) a un nivel de pago |
| 404             | No se encontró ninguna transacción de financiamiento | Esta billetera nunca ha recibido SOL                                                                                                               |
| 429             | Se superó el límite de solicitudes                   | Reduce la frecuencia de las solicitudes o mejora tu plan                                                                                           |

## Limitaciones

* Este endpoint solo rastrea la **primera transferencia de SOL** a una billetera.
* Si una billetera se creó mediante un airdrop o la inicialización de un programa sin una transferencia de SOL, no tendrá datos de financiamiento.
* La fuente de financiamiento representa al financiador **inmediato**, no necesariamente la fuente original de los fondos.
* Los datos históricos solo están disponibles para las billeteras creadas después de la implementación de esta función.

## Próximos pasos

<CardGroup cols={3}>
  <Card title="Wallet Identity" icon="address-card" href="/docs/es/wallet-api/identity">
    Resuelve la dirección del financiador para obtener una etiqueta completa, una categoría y etiquetas adicionales.
  </Card>

  <Card title="Wallet API Overview" icon="wallet" href="/docs/es/wallet-api/overview">
    Todos los endpoints de Wallet API y las convenciones compartidas.
  </Card>

  <Card title="API Reference" icon="code" href="/docs/es/api-reference/wallet-api/funded-by">
    Esquemas de solicitud y respuesta para consultar la fuente de financiamiento.
  </Card>
</CardGroup>
