# Funders

> Manage the funder wallets that pay for funding your trading wallets.

A funder is a wallet Proxima holds for your account and uses as the source of [funding](/reference/funding/) jobs. Each funder has a network type: an SVM funder serves Solana, an EVM funder serves every EVM chain and reports a native balance per chain.

A funder can be the default for one or more chains. When the web app creates a funding draft, it picks the default funder of the target chain. Withdrawing to one of your own funders never prompts for 2FA (see [Withdrawals](/reference/withdrawals/)).

Base URL: `https://api-mig.proxima.tools`

## Endpoints

- `GET /wallets/funders/list`: List funders
- `POST /wallets/{network_type}/funders/add`: Create a funder
- `POST /wallets/funders/export`: Export a funder key
- `POST /wallets/funders/remove`: Delete a funder
- `POST /wallets/funders/set-default`: Set the default funder

## The Funder object

A funder wallet of the account with its live native balances.

- `pubkey` (string): Funder address. EVM addresses are lowercase.
- `network_type` (enum): Network type. An EVM funder serves every EVM chain. Possible values: `svm`, `evm`.
- `is_default` (array<string>): Chain IDs this funder is the default for. Empty when it is the default nowhere.
- `native_balances` (object): Native balance per chain ID, in base units (lamports or wei), as decimal strings.
- `created_at` (integer): Unix timestamp (seconds) at which the funder was created.

```json
{
  "pubkey": "91Xgc8gCBPK92v2i3CPnoMLNT8BJBRbL9WZ9ouiL5NVy",
  "network_type": "svm",
  "is_default": [
    "sol"
  ],
  "native_balances": {
    "sol": "4820000000"
  },
  "created_at": 1790380800
}
```

### List funders

`GET /wallets/funders/list`

Returns every funder of the account, SVM and EVM, with live native balances. (Bearer JWT)

- Token: Upgraded session token, bound to a license.
- Read-only tokens: allowed.
- Retry: Safe to retry.

#### Returns 200 OK

Returns a list of [Funder](#object-funder) objects.

- `funders` (array<object>): Funders of the account.

#### Errors

| Status | Code | Message | When | What to do |
| --- | --- | --- | --- | --- |
| 422 | `upstream_failure` | `rpc api issue: <error>` | Reading the balances of SVM funders from the RPC failed. | Retry after a short wait. |

#### Example request

```bash
curl "https://api-mig.proxima.tools/wallets/funders/list" \
  -H "Authorization: Bearer $PROXIMA_JWT"
```

#### Example response

```json
{
  "funders": [
    {
      "pubkey": "91Xgc8gCBPK92v2i3CPnoMLNT8BJBRbL9WZ9ouiL5NVy",
      "network_type": "svm",
      "is_default": [
        "sol"
      ],
      "native_balances": {
        "sol": "4820000000"
      },
      "created_at": 1790380800
    },
    {
      "pubkey": "0x8b1cf9c07608e850143a110f4c5951655d345daf",
      "network_type": "evm",
      "is_default": [
        "bsc",
        "base"
      ],
      "native_balances": {
        "eth": "0",
        "bsc": "250000000000000000",
        "base": "12000000000000000",
        "robinhood": "0",
        "arc": "0",
        "xlayer": "0"
      },
      "created_at": 1790467200
    }
  ]
}
```

### Create a funder

`POST /wallets/{network_type}/funders/add`

Generates a new funder, imports one from a private key, or promotes an existing wallet to funder. (Bearer JWT)

- Token: Upgraded session token, bound to a license.
- Read-only tokens: refused with `403 read_only_token`.
- Retry: Check before retrying. Generating creates a new funder on each call; importing the same secret again is harmless. Before retrying a generate, call [List funders](/reference/funders/#list-funders) and check whether the funder was added.

The web app generates new funders and, on SVM, promotes an existing wallet by address from the funder settings.

#### Path parameters

- `network_type` (enum, required): Network type of the funder. Possible values: `svm`, `evm`.

#### Body parameters

- `key` (string | object, required): The string `"None"` to generate a new keypair, `{ "secret": "..." }` to import a private key, or `{ "pubkey": "..." }` to use one of your existing wallets (SVM only).
  - `secret` (string, optional): Private key to import. Requires key-management rights on the license.
  - `pubkey` (string, optional): Address of an existing wallet of the account to use as funder. SVM only.
- `is_default` (boolean, optional): Whether to make the new funder the default.

#### Returns 200 OK

- `pubkey` (string): Address of the funder.

#### Errors

| Status | Code | Message | When | What to do |
| --- | --- | --- | --- | --- |
| 400 | `bad_request` | `unknown network_type: <network_type>` | `network_type` is not `svm` or `evm`. | Use `svm` or `evm` as `network_type`. |
| 400 | `bad_request` | `Invalid secret key` | `key.secret` is not a valid secret key for the network. | Send a valid secret key for the network in `key.secret`. |
| 400 | `bad_request` | `Invalid pubkey` | On SVM, `key.pubkey` is not a valid Solana address. | Send a valid base58 address in `key.pubkey`. |
| 400 | `bad_request` | `Linking an existing wallet by pubkey is not supported for evm — import via secret` | `key.pubkey` was sent on EVM, where a funder can only be generated or imported. | Generate the EVM funder, or import it with `key.secret`. |
| 403 | `forbidden` | `Unauthorized to import a funder key` | A secret key was sent and the license cannot import keys. | Generate the funder instead, or use a license with key-management rights. |
| 404 | `not_found` | `Wallet not found` | On SVM, the wallet named by `key.pubkey` is not on the account. | Use an address from [List wallets](/reference/wallets/#list-wallets). |
| 422 | `unprocessable` | `Maximum number of funders reached` | The account already has 10 funders on this network. | Remove an unused funder with [Delete a funder](/reference/funders/#delete-a-funder) first. |

#### Example request

```bash
curl -X POST "https://api-mig.proxima.tools/wallets/svm/funders/add" \
  -H "Authorization: Bearer $PROXIMA_JWT" \
  -H "Content-Type: application/json" \
  -d '{
  "key": "None",
  "is_default": false
}'
```

#### Example response

```json
{
  "pubkey": "AqaW1YghutnQEhjycn8m26Rr4RzZuZAoaNYsFjRP5NDp"
}
```

### Export a funder key

`POST /wallets/funders/export`

Returns the private key of a funder. (Bearer JWT · 2FA step-up)

- Token: Upgraded session token, bound to a license.
- Read-only tokens: refused with `403 read_only_token`.
- Two-factor: step-up for `wallet.export_funder` when the user protects it (`401 2fa_required`).
- Retry: Safe to retry. Read-only: a repeat returns the same key.

> The response contains the private key in clear. Anyone holding it controls the funder's funds.

> Protected by the `wallet.export_funder` 2FA action when the user has enabled it.

#### Body parameters

- `pubkey` (string, required): Address of the funder.

#### Returns 200 OK

- `pubkey` (string): Address of the funder.
- `secret_key` (string): Private key: base58 on SVM, hex on EVM.

#### Errors

| Status | Code | Message | When | What to do |
| --- | --- | --- | --- | --- |
| 404 | `not_found` | `Funder not found` | On EVM, the funder is not on the account. | Use an address from [List funders](/reference/funders/#list-funders). |
| 500 | `internal_error` | `Funder not found` | On SVM, the funder is not on the account. Returned as a 500, not a 404. | Use an address from [List funders](/reference/funders/#list-funders). |

#### Example request

```bash
curl -X POST "https://api-mig.proxima.tools/wallets/funders/export" \
  -H "Authorization: Bearer $PROXIMA_JWT" \
  -H "Content-Type: application/json" \
  -d '{
  "pubkey": "91Xgc8gCBPK92v2i3CPnoMLNT8BJBRbL9WZ9ouiL5NVy"
}'
```

#### Example response

```json
{
  "pubkey": "91Xgc8gCBPK92v2i3CPnoMLNT8BJBRbL9WZ9ouiL5NVy",
  "secret_key": "<base58 secret key>"
}
```

### Delete a funder

`POST /wallets/funders/remove`

Removes a funder that holds no withdrawable balance. (Bearer JWT)

- Token: Upgraded session token, bound to a license.
- Read-only tokens: refused with `403 read_only_token`.
- Retry: Safe to retry. A repeat after a successful removal returns a "Funder not found" error.

Before deleting, the web app withdraws the funder's balance and waits for the withdrawal to finish.

#### Body parameters

- `pubkey` (string, required): Address of the funder.

#### Returns 200 OK

- `ok` (boolean): Always `true` on success.

#### Errors

| Status | Code | Message | When | What to do |
| --- | --- | --- | --- | --- |
| 400 | `bad_request` | `Invalid pubkey` | On SVM, the address is not a valid Solana address. | Use an address from [List funders](/reference/funders/#list-funders). |
| 404 | `not_found` | `Funder not found` | On EVM, the funder is not on the account. | Use an address from [List funders](/reference/funders/#list-funders). |
| 500 | `internal_error` | `Funder not found` | On SVM, the funder is not on the account. Returned as a 500, not a 404. | Use an address from [List funders](/reference/funders/#list-funders). |
| 409 | `conflict` | `Funder still has a withdrawable balance on <chain_id>; withdraw it before removing` | On EVM, the funder still holds a withdrawable balance on a chain. | Move the balance out with [Execute a withdrawal](/reference/withdrawals/#execute-a-withdrawal), then retry. |
| 409 | `conflict` | `Funder still has a withdrawable balance; withdraw it before removing` | On SVM, the funder still holds a withdrawable balance. | Move the balance out with [Execute a withdrawal](/reference/withdrawals/#execute-a-withdrawal), then retry. |
| 500 | `internal_error` | `Cannot remove the last funder` | On SVM, the funder is the account's last funder. Returned as a 500. EVM has no such check. | Create another funder with [Create a funder](/reference/funders/#create-a-funder) first. |
| 500 | `internal_error` | `Cannot remove funder while it is the active shield deployer` | On SVM, the funder is the account's active shield deployer. Returned as a 500. | Keep this funder while the shield it deployed is active. |
| 422 | `upstream_failure` | `rpc api issue: <error>` | On SVM, the balance check could not read the funder's balance from the RPC. | Retry after a short wait. |

#### Example request

```bash
curl -X POST "https://api-mig.proxima.tools/wallets/funders/remove" \
  -H "Authorization: Bearer $PROXIMA_JWT" \
  -H "Content-Type: application/json" \
  -d '{
  "pubkey": "AqaW1YghutnQEhjycn8m26Rr4RzZuZAoaNYsFjRP5NDp"
}'
```

#### Example response

```json
{
  "ok": true
}
```

### Set the default funder

`POST /wallets/funders/set-default`

Makes a funder the default for the given chains. (Bearer JWT)

- Token: Upgraded session token, bound to a license.
- Read-only tokens: refused with `403 read_only_token`.
- Retry: Safe to retry. Chains are applied one at a time, so after an error the earlier chains may already be set; check [List funders](/reference/funders/#list-funders). Sending the same body again is harmless.

#### Body parameters

- `pubkey` (string, required): Address of the funder.
- `chains` (array<string>, required): Chain IDs to make it the default for. Must match the funder's network type.

#### Returns 200 OK

- `ok` (boolean): Always `true` on success.

#### Errors

| Status | Code | Message | When | What to do |
| --- | --- | --- | --- | --- |
| 400 | `bad_request` | `cannot set an evm pubkey as default for sol` | An EVM funder was set for `sol`. | Use an SVM funder for `sol`. |
| 400 | `bad_request` | `evm chain default requires an evm funder pubkey` | An SVM funder was set for an EVM chain. | Use an EVM funder for EVM chains. |
| 404 | `not_found` | `Funder not found` | On EVM, the funder is not on the account. | Use an address from [List funders](/reference/funders/#list-funders). |
| 500 | `internal_error` | `Funder not found` | On SVM, the funder is not on the account. Returned as a 500, not a 404. | Use an address from [List funders](/reference/funders/#list-funders). |

#### Example request

```bash
curl -X POST "https://api-mig.proxima.tools/wallets/funders/set-default" \
  -H "Authorization: Bearer $PROXIMA_JWT" \
  -H "Content-Type: application/json" \
  -d '{
  "pubkey": "0x8b1cf9c07608e850143a110f4c5951655d345daf",
  "chains": [
    "bsc",
    "base"
  ]
}'
```

#### Example response

```json
{
  "ok": true
}
```
