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

# Account Discovery

> Discover accounts, contract addresses, and supported assets via the GraphQL API

Equivalent to SDK's [`getVaultsByConfig()`](/v0.5.2/intro/products/earn/developers/api/getVaultsByConfig) and [`getSupportedAssets()`](/v0.5.2/intro/products/earn/developers/api/getSupportedAssets).

## GraphQL API (Recommended)

The GraphQL API returns **all contract addresses** needed for direct integration in a single request. This is the same API the Amplify SDK uses internally.

### Endpoint

```
POST https://api.paxoslabs.com/graphql
```

### Headers

| Header         | Value                |
| -------------- | -------------------- |
| `Content-Type` | `application/json`   |
| `x-api-key`    | Your Amplify API key |

### Query

```graphql theme={null}
query AmplifySdkConfigs($chainId: Int, $yieldType: YieldType) {
  amplifySdkConfigs(chainId: $chainId, yieldType: $yieldType) {
    id
    chainId
    yieldType
    vault {
      id
      name
      chainId
      boringVaultAddress
      tellerModuleId
      accountantModuleId
      withdrawQueueModuleId
      communityCodeDepositorModuleId
      supportedAssets {
        address
        chainId
        depositable
        withdrawable
        symbol
        tokenName
        decimals
      }
    }
  }
}
```

### Variables (all optional)

| Variable    | Type        | Description                                                 |
| ----------- | ----------- | ----------------------------------------------------------- |
| `chainId`   | `Int`       | Filter by chain (e.g., `1` for Ethereum, `8453` for Base)   |
| `yieldType` | `YieldType` | Filter by yield type (`CORE`, `TREASURY`, `FRONTIER`, etc.) |

### Example Request

```bash theme={null}
curl -s -X POST "https://api.paxoslabs.com/graphql" \
  -H "Content-Type: application/json" \
  -H "x-api-key: $AMPLIFY_API_KEY" \
  -d '{
    "query": "query AmplifySdkConfigs($chainId: Int, $yieldType: YieldType) { amplifySdkConfigs(chainId: $chainId, yieldType: $yieldType) { id chainId yieldType vault { id name chainId boringVaultAddress tellerModuleId accountantModuleId withdrawQueueModuleId communityCodeDepositorModuleId supportedAssets { address chainId depositable withdrawable symbol tokenName decimals } } } }",
    "variables": { "chainId": 1 }
  }' | jq
```

### Response

```json theme={null}
{
  "data": {
    "amplifySdkConfigs": [
      {
        "id": "config-id",
        "chainId": 1,
        "yieldType": "CORE",
        "vault": {
          "id": "vault-id",
          "name": "Amplify Core",
          "chainId": 1,
          "boringVaultAddress": "0x...",
          "tellerModuleId": "0x...",
          "accountantModuleId": "0x...",
          "withdrawQueueModuleId": "0x...",
          "communityCodeDepositorModuleId": "0x...",
          "supportedAssets": [
            {
              "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
              "chainId": 1,
              "depositable": true,
              "withdrawable": true,
              "symbol": "USDC",
              "tokenName": "USD Coin",
              "decimals": 6
            }
          ]
        }
      }
    ]
  }
}
```

### Response Types

| Field                                  | Type       | Description                                    |
| -------------------------------------- | ---------- | ---------------------------------------------- |
| `id`                                   | `string`   | SDK config identifier                          |
| `chainId`                              | `int`      | Blockchain network ID                          |
| `yieldType`                            | `string`   | Yield strategy (`CORE`, `TREASURY`, etc.)      |
| `vault.id`                             | `string`   | Account identifier (use for deduplication)     |
| `vault.name`                           | `string`   | Human-readable account name                    |
| `vault.boringVaultAddress`             | `address`  | BoringVault — ERC-20 share token               |
| `vault.communityCodeDepositorModuleId` | `address?` | DistributorCodeDepositor — deposit entry point |
| `vault.withdrawQueueModuleId`          | `address?` | WithdrawQueue — withdrawal orders              |
| `vault.accountantModuleId`             | `address`  | Accountant — exchange rate oracle              |
| `vault.tellerModuleId`                 | `address`  | Teller — pause state                           |
| `vault.supportedAssets[].address`      | `address`  | ERC-20 token contract address                  |
| `vault.supportedAssets[].depositable`  | `boolean`  | Whether this token can be deposited            |
| `vault.supportedAssets[].withdrawable` | `boolean`  | Whether this token can be used as want asset   |
| `vault.supportedAssets[].symbol`       | `string?`  | Token symbol (e.g., `"USDC"`)                  |
| `vault.supportedAssets[].decimals`     | `int?`     | Token decimals (e.g., `6`)                     |

<Info>
  Multiple configs can reference the same account (one per deposit token).
  Deduplicate by `vault.id` — each account has a single set of contract addresses
  and a `supportedAssets` array listing all tokens.
</Info>

<Warning>
  `withdrawQueueModuleId` and `communityCodeDepositorModuleId` can be `null`
  for accounts that don't support external withdrawals or deposits.
</Warning>

### Contract Address Mapping

| GraphQL Field                          | Contract                     | Used For                               |
| -------------------------------------- | ---------------------------- | -------------------------------------- |
| `vault.boringVaultAddress`             | **BoringVault**              | Account share token (ERC-20)           |
| `vault.communityCodeDepositorModuleId` | **DistributorCodeDepositor** | `deposit()`, `depositWithPermit()`     |
| `vault.withdrawQueueModuleId`          | **WithdrawQueue**            | `submitOrder()`, `cancelOrder()`       |
| `vault.accountantModuleId`             | **Accountant**               | `getRateInQuoteSafe()` (exchange rate) |
| `vault.tellerModuleId`                 | **Teller**                   | `isPaused()` (pause state)             |

<Note>
  The GraphQL field `communityCodeDepositorModuleId` is a legacy name. The contract it points to is the **DistributorCodeDepositor**. Use this address wherever the documentation refers to the `distributorCodeDepositorAddress`.
</Note>

### Available Yield Types

| Value      | SDK Mapping |
| ---------- | ----------- |
| `CORE`     | CORE        |
| `PRIME`    | CORE        |
| `TREASURY` | TREASURY    |
| `TBILL`    | TREASURY    |
| `FRONTIER` | FRONTIER    |
| `LENDING`  | FRONTIER    |

***

## REST API (Simpler Alternative)

If you only need to list account–asset pairs without full contract addresses, you can use the REST endpoint.

### Endpoint

```
GET https://api.paxoslabs.com/v2/amplify/vaultAssets
```

### Query Parameters

| Parameter   | Type     | Required | Description                                                |
| ----------- | -------- | -------- | ---------------------------------------------------------- |
| `pageSize`  | `int`    | No       | Results per page (default 20, max 100)                     |
| `pageToken` | `string` | No       | Pagination token from `nextPageToken` in previous response |
| `filter`    | `string` | No       | Filter expression (e.g., `chainId=1`, `withdrawable=true`) |

### Example Request

```bash theme={null}
curl -s "https://api.paxoslabs.com/v2/amplify/vaultAssets?pageSize=100" \
  -H "x-api-key: $AMPLIFY_API_KEY" | jq
```

### Response

```json theme={null}
{
  "vaultAssets": [
    {
      "vaultAddress": "0x...",
      "chainId": 1,
      "assetAddress": "0x...",
      "depositable": true,
      "withdrawable": true
    }
  ],
  "nextPageToken": null,
  "tokenMetadata": {
    "1:0xA0b8...": {
      "address": "0xA0b8...",
      "chain_id": "1",
      "symbol": "USDC",
      "name": "USD Coin",
      "decimals": "6"
    }
  }
}
```

### Response Types

| Field                        | Type      | Description                                    |
| ---------------------------- | --------- | ---------------------------------------------- |
| `vaultAssets[].vaultAddress` | `address` | BoringVault address (share token)              |
| `vaultAssets[].chainId`      | `int`     | Chain ID                                       |
| `vaultAssets[].assetAddress` | `address` | ERC-20 token address                           |
| `vaultAssets[].depositable`  | `boolean` | Whether this token can be deposited            |
| `vaultAssets[].withdrawable` | `boolean` | Whether this token can be used as want asset   |
| `nextPageToken`              | `string?` | Token for next page (`null` if no more pages)  |
| `tokenMetadata`              | `object`  | Map keyed by `chainId:address` with token info |
| `tokenMetadata[].symbol`     | `string`  | Token symbol                                   |
| `tokenMetadata[].name`       | `string`  | Token name                                     |
| `tokenMetadata[].decimals`   | `string`  | Token decimals (as string)                     |

<Warning>
  The REST endpoint only returns `vaultAddress` (the BoringVault). For
  the full set of contract addresses needed for deposits, withdrawals, and
  cancellations, use the [GraphQL API](#graphql-api-recommended) above.
</Warning>

***

## Withdraw-Eligible Assets

Filter by `withdrawable: true` in either API:

* **GraphQL**: Filter `vault.supportedAssets` where `withdrawable == true`
* **REST**: `GET /v2/amplify/vaultAssets?filter=withdrawable%3Dtrue&pageSize=100`
