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

# 転送クエリ

> オンチェーン転送データのクエリ例

**Transfers** Cube には、オンチェーンのトークン送金イベントが格納されています — トークンがウォレット間を移動するたびの記録です。ウォレット活動の追跡、大口の動きの監視、トークンフローの分析、取引所への入出金の検知などに使えます。

<Note>
  以下の例はすべて `network: sol`（Solana）を使用しています。他の対応チェーンでは `eth`、`bsc`、`polygon` に置き換えてください。
</Note>

***

## 最新の送金を取得するには？

Solana 上の直近 10 件のトークン送金を取得します。送信者、受信者、数量、USD 換算額を含みます。

```graphql theme={null}
query {
  Solana {
    Transfers(
      limit: {count: 10}
      orderBy: {descending: Block_Time}
    ) {
      Block { Time }
      Transaction { Hash }
      Transfer {
        Currency { MintAddress }
        Sender { Address }
        Receiver { Address }
        Amount
        AmountInUSD
      }
    }
  }
}
```

<Tip>
  [GraphQL IDE で開く](https://ide.chainstream.io) — 上記クエリを貼り付けて、オートコンプリートとスキーマ探索付きで対話的に実行できます。
</Tip>

<AccordionGroup>
  <Accordion title="主要フィールド">
    | フィールド                           | 説明                     |
    | :------------------------------ | :--------------------- |
    | `Block.Time`                    | ブロックのタイムスタンプ（ISO 8601） |
    | `Transaction.Hash`              | オンチェーンのトランザクションハッシュ    |
    | `Transfer.Currency.MintAddress` | 送金されているトークンのアドレス       |
    | `Transfer.Sender.Address`       | トークンを送ったウォレット          |
    | `Transfer.Receiver.Address`     | トークンを受け取ったウォレット        |
    | `Transfer.Amount`               | 送金されたトークン数             |
    | `Transfer.AmountInUSD`          | 発生時点での送金額の USD 換算      |
  </Accordion>

  <Accordion title="カスタマイズのヒント">
    * **トークンで絞り込み**: `tokenAddress: {is: "TOKEN_ADDRESS"}` を追加して特定トークンの送金のみ表示
    * **大口のみ**: `where: {Transfer: {AmountInUSD: {gt: 10000}}}` を追加してクジラの動きを検知
    * **期間指定**: `where: {Block: {Time: {after: "2025-03-01T00:00:00Z"}}}` で期間を限定
  </Accordion>
</AccordionGroup>

***

## ウォレットからの送金（出金）を取得するには？

`senderAddress` セレクターを使って、特定ウォレットからの送金を取得します。

```graphql theme={null}
query {
  Solana {
    Transfers(
      limit: {count: 20}
      senderAddress: {is: "WALLET_ADDRESS"}
      orderBy: {descending: Block_Time}
    ) {
      Block { Time }
      Transfer {
        Currency { MintAddress }
        Receiver { Address }
        Amount
        AmountInUSD
      }
    }
  }
}
```

<Tip>
  `WALLET_ADDRESS` を調査したい実際のウォレットアドレスに置き換えてください。
</Tip>

<AccordionGroup>
  <Accordion title="主要フィールド">
    | フィールド                           | 説明            |
    | :------------------------------ | :------------ |
    | `Transfer.Currency.MintAddress` | 送ったトークン       |
    | `Transfer.Receiver.Address`     | 受信者           |
    | `Transfer.Amount`               | 送ったトークン数      |
    | `Transfer.AmountInUSD`          | 送金時点の USD 換算額 |
  </Accordion>

  <Accordion title="カスタマイズのヒント">
    * **特定トークンのみ**: `tokenAddress: {is: "TOKEN_ADDRESS"}` を追加して 1 トークンに絞る
    * **件数の増加**: `count: 20` を最大 `10000` まで変更してより深い履歴を取得
    * **受信者フィルター**: `where: {Transfer: {Receiver: {Address: {is: "RECEIVER_ADDRESS"}}}}` で 2 ウォレット間の送金を追跡
  </Accordion>
</AccordionGroup>

***

## ウォレットへの送金（入金）を取得するには？

`receiverAddress` セレクターを使って、ウォレットへの着金を取得します。

```graphql theme={null}
query {
  Solana {
    Transfers(
      limit: {count: 20}
      receiverAddress: {is: "WALLET_ADDRESS"}
      orderBy: {descending: Block_Time}
    ) {
      Block { Time }
      Transfer {
        Currency { MintAddress }
        Sender { Address }
        Amount
        AmountInUSD
      }
    }
  }
}
```

<Tip>
  Transfers Cube は `senderAddress` と `receiverAddress` の両方のセレクターをサポートしています。`where` と組み合わせて、期間や最小額などの追加フィルターが可能です。
</Tip>

***

## 特定トークンの全送金を取得するには？

ネットワーク上の特定トークンのすべての送金を追跡します。

```graphql theme={null}
query {
  Solana {
    Transfers(
      limit: {count: 20}
      tokenAddress: {is: "TOKEN_ADDRESS"}
      orderBy: {descending: Block_Time}
    ) {
      Block { Time }
      Transaction { Hash }
      Transfer {
        Sender { Address }
        Receiver { Address }
        Amount
        AmountInUSD
      }
    }
  }
}
```

<AccordionGroup>
  <Accordion title="カスタマイズのヒント">
    * **クジラアラート**: `where: {Transfer: {AmountInUSD: {gt: 100000}}}` で大口送金のみ（10 万ドル超）
    * **ダスト除外**: `where: {Transfer: {Amount: {gt: 0.01}}}` で微小額を除外
    * **期間限定**: `where: {Block: {Time: {since: "2025-03-27T00:00:00Z"}}}` と組み合わせて当日の送金のみ
  </Accordion>
</AccordionGroup>

***

## マルチチェーンの例

<Tabs>
  <Tab title="Solana">
    ```graphql theme={null}
    query {
      Solana {
        Transfers(
          limit: {count: 5}
          orderBy: {descending: Block_Time}
        ) {
          Block { Time }
          Transfer {
            Currency { MintAddress }
            Sender { Address }
            Receiver { Address }
            Amount
          }
        }
      }
    }
    ```
  </Tab>

  <Tab title="Ethereum">
    ```graphql theme={null}
    query {
      EVM(network: eth) {
        Transfers(
          limit: {count: 5}
          orderBy: {descending: Block_Time}
        ) {
          Block { Time }
          Transfer {
            Currency { MintAddress }
            Sender { Address }
            Receiver { Address }
            Amount
          }
        }
      }
    }
    ```
  </Tab>

  <Tab title="BSC">
    ```graphql theme={null}
    query {
      EVM(network: bsc) {
        Transfers(
          limit: {count: 5}
          orderBy: {descending: Block_Time}
        ) {
          Block { Time }
          Transfer {
            Currency { MintAddress }
            Sender { Address }
            Receiver { Address }
            Amount
          }
        }
      }
    }
    ```
  </Tab>

  <Tab title="Polygon">
    ```graphql theme={null}
    query {
      EVM(network: polygon) {
        Transfers(
          limit: {count: 5}
          orderBy: {descending: Block_Time}
        ) {
          Block { Time }
          Transfer {
            Currency { MintAddress }
            Sender { Address }
            Receiver { Address }
            Amount
          }
        }
      }
    }
    ```
  </Tab>
</Tabs>

***

## 次のステップ

<CardGroup cols={2}>
  <Card title="DEX 取引" icon="arrow-right-arrow-left" href="/jp/graphql/examples/dex-trades">
    DEX のトレーディングデータ — トークン取引、ウォレット活動、トップトレーダーをクエリします。
  </Card>

  <Card title="残高とホルダー" icon="wallet" href="/jp/graphql/examples/balance-holders">
    ウォレット残高、残高履歴、トップホルダーを調べます。
  </Card>

  <Card title="プールと流動性" icon="droplet" href="/jp/graphql/examples/pools-liquidity">
    DEX プールと流動性データを探索します。
  </Card>

  <Card title="OHLC と統計" icon="chart-candlestick" href="/jp/graphql/examples/ohlc-stats">
    ローソク足、取引統計、時価総額、トークンメタデータを取得します。
  </Card>
</CardGroup>
