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

# Migrate from DeBank

> A 1:1 mapping from the DeBank Cloud API to the Octav API

A drop-in mapping from the **DeBank Cloud (Pro OpenAPI)** to Octav. The biggest wins:

* **One call instead of three.** DeBank splits a portfolio across `all_token_list`, `all_complex_protocol_list`, and `total_balance`. Octav returns wallet tokens, DeFi positions, and net worth from a single [`GET /v1/portfolio`](/api/endpoints/portfolio).
* **Solana included.** DeBank is EVM-only. The same Octav endpoint accepts base58 Solana addresses.
* **USD values precomputed.** DeBank gives you `amount` and `price`; you multiply. Octav returns `value` (and `price`) on every asset.
* **P\&L and cost basis** come back in the same response.

<Info>
  **Get your API key** at [data.octav.fi](https://data.octav.fi/). Base URL: `https://api.octav.fi/v1`.
</Info>

## Endpoint mapping

| Use case                     | DeBank                                   | Octav                                                                       |
| ---------------------------- | ---------------------------------------- | --------------------------------------------------------------------------- |
| Wallet tokens (all chains)   | `GET /v1/user/all_token_list`            | [`GET /v1/portfolio`](/api/endpoints/portfolio) → `assetByProtocols.wallet` |
| DeFi positions               | `GET /v1/user/all_complex_protocol_list` | same `GET /v1/portfolio` → `assetByProtocols.<protocol>`                    |
| Off-chain apps (perps, etc.) | `GET /v1/user/complex_app_list`          | same `GET /v1/portfolio` → `assetByProtocols.<protocol>`                    |
| Net worth                    | `GET /v1/user/total_balance`             | same response → `networth` + `chains`                                       |
| Transaction history          | `GET /v1/user/history_list`              | [`GET /v1/transactions`](/api/endpoints/transactions)                       |
| Token metadata / price       | `GET /v1/token`                          | inline on every asset (`price`, `value`, `decimal`)                         |

<Tip>
  Everything except history comes from a **single** `GET /v1/portfolio` call. There is no separate token / protocol / balance request to merge.
</Tip>

## Authentication

DeBank uses an `AccessKey` header. Octav uses a standard `Authorization: Bearer` token.

<CodeGroup>
  ```bash DeBank theme={null}
  curl "https://pro-openapi.debank.com/v1/user/all_token_list?id=0x6426af179aabebe47666f345d69fd9079673f6cd&is_all=false" \
    -H "AccessKey: YOUR_DEBANK_KEY"
  ```

  ```bash Octav theme={null}
  curl "https://api.octav.fi/v1/portfolio?addresses=0x6426af179aabebe47666f345d69fd9079673f6cd" \
    -H "Authorization: Bearer YOUR_OCTAV_KEY"
  ```
</CodeGroup>

## Wallet token balances

DeBank's `all_token_list` returns a flat array of tokens. In Octav, wallet tokens live under the `wallet` protocol, grouped by chain:

```
assetByProtocols.wallet.chains.<chain>.protocolPositions.WALLET.assets[]
```

<CodeGroup>
  ```javascript JavaScript theme={null}
  const OCTAV_KEY = process.env.OCTAV_API_KEY;
  const address = "0x6426af179aabebe47666f345d69fd9079673f6cd";

  const res = await fetch(
    `https://api.octav.fi/v1/portfolio?addresses=${address}&includeImages=true`,
    { headers: { Authorization: `Bearer ${OCTAV_KEY}` } }
  );
  const [portfolio] = await res.json(); // /v1/portfolio returns one entry per address

  // Flatten wallet tokens across every chain
  const wallet = portfolio.assetByProtocols.wallet;
  const tokens = Object.values(wallet.chains).flatMap((chain) =>
    Object.values(chain.protocolPositions).flatMap((pos) => pos.assets)
  );

  tokens.forEach((t) =>
    console.log(`${t.symbol} on ${t.chainKey}: ${t.balance} ($${t.value})`)
  );
  ```

  ```python Python theme={null}
  import os
  import requests

  OCTAV_KEY = os.environ["OCTAV_API_KEY"]
  address = "0x6426af179aabebe47666f345d69fd9079673f6cd"
  res = requests.get(
      "https://api.octav.fi/v1/portfolio",
      params={"addresses": address, "includeImages": True},
      headers={"Authorization": f"Bearer {OCTAV_KEY}"},
  )
  portfolio = res.json()[0]  # one entry per address

  wallet = portfolio["assetByProtocols"]["wallet"]
  for chain in wallet["chains"].values():
      for pos in chain["protocolPositions"].values():
          for t in pos["assets"]:
              print(f"{t['symbol']} on {t['chainKey']}: {t['balance']} (${t['value']})")
  ```

  ```bash cURL theme={null}
  curl "https://api.octav.fi/v1/portfolio?addresses=0x6426af179aabebe47666f345d69fd9079673f6cd&includeImages=true" \
    -H "Authorization: Bearer YOUR_OCTAV_KEY"
  ```
</CodeGroup>

**Field mapping**

| DeBank (`all_token_list[]`)   | Octav (`…assets[]`)                    | Notes                                                                             |
| ----------------------------- | -------------------------------------- | --------------------------------------------------------------------------------- |
| `id`                          | `contract`                             | Token address. Native tokens use the zero address in Octav.                       |
| `chain`                       | `chainKey`                             | e.g. `eth` → `ethereum`. See [supported chains](/api/reference/supported-chains). |
| `symbol` / `optimized_symbol` | `symbol`                               |                                                                                   |
| `name`                        | `name`                                 |                                                                                   |
| `decimals`                    | `decimal`                              |                                                                                   |
| `price`                       | `price`                                | USD, precomputed.                                                                 |
| `amount`                      | `balance`                              | Human-readable in both.                                                           |
| `amount × price`              | `value`                                | Octav precomputes `value`; you no longer multiply.                                |
| `logo_url`                    | asset logo (with `includeImages=true`) |                                                                                   |
| `is_core`                     | —                                      | Octav applies its own spam filtering; there is no `is_core` flag to check.        |

## Net worth and per-chain breakdown

DeBank's `total_balance` maps directly onto the top-level `networth` and `chains` fields returned by the same portfolio call.

| DeBank (`total_balance`) | Octav                                      | Notes                                           |
| ------------------------ | ------------------------------------------ | ----------------------------------------------- |
| `total_usd_value`        | `networth`                                 | Total net worth in USD.                         |
| `chain_list[].usd_value` | `chains.<chain>.value`                     | Per-chain total.                                |
| `chain_list[].id`        | `chains.<chain>.key` / `chainId`           | Chain identifier + numeric ID.                  |
| —                        | `chains.<chain>.valuePercentile`           | Share of net worth per chain (Octav adds this). |
| —                        | `openPnl` / `closedPnl` / `totalCostBasis` | P\&L and cost basis (Octav adds these).         |

```javascript JavaScript theme={null}
console.log(`Net worth: $${portfolio.networth}`);
Object.values(portfolio.chains).forEach((c) =>
  console.log(`${c.name}: $${c.value} (${c.valuePercentile}%)`)
);
```

## DeFi positions

DeBank returns decoded positions under `all_complex_protocol_list[].portfolio_item_list[]`. Octav returns the same money under `assetByProtocols`, keyed by protocol, then chain, then position type (`LENDING`, `LIQUIDITYPOOL`, `STAKED`, `FARMING`, …).

<CodeGroup>
  ```javascript JavaScript theme={null}
  // Every protocol except the "wallet" bucket is a DeFi position
  const defi = Object.entries(portfolio.assetByProtocols).filter(
    ([key]) => key !== "wallet"
  );

  defi.forEach(([key, protocol]) => {
    console.log(`${protocol.name}: $${protocol.value}`);
    Object.values(protocol.chains).forEach((chain) => {
      Object.entries(chain.protocolPositions).forEach(([type, pos]) => {
        console.log(`  ${type}: $${pos.totalValue}`);
        pos.assets.forEach((a) => console.log(`    ${a.symbol}: $${a.value}`));
      });
    });
  });
  ```

  ```python Python theme={null}
  for key, protocol in portfolio["assetByProtocols"].items():
      if key == "wallet":
          continue
      print(f"{protocol['name']}: ${protocol['value']}")
      for chain in protocol["chains"].values():
          for ptype, pos in chain["protocolPositions"].items():
              print(f"  {ptype}: ${pos['totalValue']}")
  ```
</CodeGroup>

**Field mapping**

| DeBank                                      | Octav                                   | Notes                             |
| ------------------------------------------- | --------------------------------------- | --------------------------------- |
| `protocol.id` / `protocol.name`             | `assetByProtocols.<key>.name`           | Keyed by protocol.                |
| `portfolio_item_list[].stats.net_usd_value` | `protocolPositions.<TYPE>.totalValue`   | Net position value.               |
| `portfolio_item_list[].name`                | position `TYPE` key                     | e.g. `Lending`, `Liquidity Pool`. |
| `detail.supply_token_list[]`                | `assets[]` (supplied)                   |                                   |
| `detail.borrow_token_list[]`                | `assets[]` (borrowed)                   | Debt is decoded, not netted away. |
| `detail.reward_token_list[]`                | `assets[]` (rewards)                    |                                   |
| `detail.health_rate`                        | position health rate                    |                                   |
| `chain`                                     | `assetByProtocols.<key>.chains.<chain>` |                                   |

<Tip>
  DeBank's off-chain "apps" (`complex_app_list`) — Hyperliquid, Lighter, prediction markets — are folded into the same `assetByProtocols` map in Octav, so you don't call a second endpoint for them.
</Tip>

## Transaction history

Swap `history_list` for [`GET /v1/transactions`](/api/endpoints/transactions).

<CodeGroup>
  ```bash DeBank theme={null}
  curl "https://pro-openapi.debank.com/v1/user/history_list?id=0x6426af179aabebe47666f345d69fd9079673f6cd" \
    -H "AccessKey: YOUR_DEBANK_KEY"
  ```

  ```bash Octav theme={null}
  curl "https://api.octav.fi/v1/transactions?addresses=0x6426af179aabebe47666f345d69fd9079673f6cd" \
    -H "Authorization: Bearer YOUR_OCTAV_KEY"
  ```
</CodeGroup>

Octav categorizes each transaction (swap, deposit, stake, bridge, …) and prices transfers in USD. See the [transaction types reference](/api/reference/transaction-types).

## Key differences

* **Calls per portfolio.** DeBank: `all_token_list` + `all_complex_protocol_list` + `complex_app_list` + `total_balance`. Octav: one `GET /v1/portfolio`.
* **Chains.** DeBank is EVM-only. Octav covers EVM **and** Solana from the same endpoint and shape.
* **Values.** DeBank returns `amount` + `price`; Octav also returns `value`. No client-side multiplication.
* **Grouping.** DeBank groups by protocol → `portfolio_item_list`. Octav groups `assetByProtocols` → `chains` → `protocolPositions` → `assets[]`, with a dedicated `wallet` bucket for loose tokens.
* **Billing.** DeBank uses prepaid units. Octav charges **1 credit per call** (see [pricing](/api/pricing)).
* **P\&L.** Octav adds `openPnl`, `closedPnl`, and `totalCostBasis` at no extra call.
* **NFTs.** Octav's `/portfolio` focuses on fungible assets and DeFi positions; it does not enumerate NFTs the way DeBank's `all_nft_list` does.

## Need help migrating?

<CardGroup cols={2}>
  <Card title="Join our Discord" icon="discord" href="https://discord.com/invite/qvcknAa73A">
    Share your DeBank response shape and we'll map it.
  </Card>

  <Card title="Portfolio endpoint" icon="chart-pie" href="/api/endpoints/portfolio">
    Full reference for the endpoint you'll be calling.
  </Card>
</CardGroup>
