# Launch trading

> Quote, buy, sell, transfer, burn and lock the token of a live launch from its wallets.

Once a launch is live, these calls trade its token from the launch wallets: buy back with several wallets at once, sell the dev or sub-wallet supply, or sell everything with a nuke. Amounts are integer strings in base units of the token or the quote.

Trades are signed with the wallets' stored keys and sent on-chain; the response reports what landed.

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

## Endpoints

- `POST /launch/quote/{launch_id}`: Quote a trade
- `POST /launch/buyback/info/{launch_id}`: Retrieve the buyback maximum
- `POST /launch/buyback/{launch_id}`: Buy back the token
- `POST /launch/sell-dev-supply/{launch_id}`: Sell the dev supply
- `POST /launch/sell-subs-supply/{launch_id}`: Sell the sub-wallet supply
- `POST /launch/nuke/{launch_id}`: Nuke a launch
- `POST /launch/transfer-token/{launch_id}`: Transfer tokens
- `POST /launch/burn-dev-supply/{launch_id}`: Burn the dev supply
- `POST /launch/lock-token/{launch_id}`: Lock the dev supply

### Quote a trade

`POST /launch/quote/{launch_id}`

Simulates buys or sells of the launch token for one or more amounts. (Bearer JWT)

- Token: Upgraded session token, bound to a license.
- Read-only tokens: refused with `403 read_only_token`.
- Retry: Safe to retry. A pure read sent as POST: it prices the amounts and sends nothing.

Returns one leg per amount, in the same order. The app refreshes it every 5 seconds while a trade form is open.

> When every amount is zero the SDK answers zero legs locally without calling the API.

#### Path parameters

- `launch_id` (string, required): Public ID of the launch.

#### Body parameters

- `direction` (enum, required): Buy or sell the token. Possible values: `buy`, `sell`.
- `mode` (enum, required): `exact_in` quotes what an input amount returns; `exact_out` what an output amount costs. Possible values: `exact_in`, `exact_out`.
- `amounts` (array<string>, required): Amounts to quote, in base units, as integer strings.

#### Returns 200 OK

Returns a JSON array of legs.

- `amount` (number): Resulting amount, in base units. EVM launches answer it as an integer string.
- `price_impact` (number): Price impact of the trade.
- `mcap_change_bps` (number | null): Market cap change, in basis points.

#### Errors

| Status | Code | Message | When | What to do |
| --- | --- | --- | --- | --- |
| 400 | `bad_request` | `invalid launch id format` | `launch_id` is not a valid launch ID. | Pass the `launch_id` returned when the launch was created, as listed by [List the license's launches](/reference/licenses/#list-mints). |
| 404 | `not_found` | `launch not found` | No launch with this ID belongs to your license. | Check the ID, and that your token is upgraded onto the license that owns the launch. |
| 400 | `bad_request` | `buy/exact_out not supported` | Solana: a buy was quoted in `exact_out` mode. | Quote buys with `exact_in`. |
| 400 | `bad_request` | `exact_out not supported on EVM` | EVM: `exact_out` is not supported in either direction. | Quote with `exact_in` on EVM launches. |
| 400 | `bad_request` | `invalid amount` | EVM: an entry of `amounts` is not a base-10 integer string. One above 2^128 answers `amount too large`. | Send each amount as an integer string of base units, below 2^128. |
| 500 | `internal_error` | `Token not launched` | Solana: the token is not deployed yet. A launch with no saved plan answers `No launch data saved` or `No launch method saved` instead. | Quote once the launch is live, as shown by `launch_status` in [List the license's launches](/reference/licenses/#list-mints). |
| 400 | `bad_request` | `token not launched` | EVM: the token is not deployed yet. | Quote once the launch is live, as shown by `launch_status` in [List the license's launches](/reference/licenses/#list-mints). |
| 422 | `unprocessable` | `<reason>` | Solana: no sell amount could be priced, and the message is the venue's reason. When only some fail, those legs answer an `amount` of `0`. | Read the venue's reason in the message, then quote again. |

#### Example request

```bash
curl -X POST "https://api-mig.proxima.tools/launch/quote/101482937561204" \
  -H "Authorization: Bearer $PROXIMA_JWT" \
  -H "Content-Type: application/json" \
  -d '{
  "direction": "buy",
  "mode": "exact_in",
  "amounts": [
    "100000000",
    "500000000",
    "1000000000"
  ]
}'
```

#### Example response

```json
[
  {
    "amount": 3412095512331,
    "price_impact": 0.41,
    "mcap_change_bps": 82
  },
  {
    "amount": 16801447209012,
    "price_impact": 2.03,
    "mcap_change_bps": 412
  },
  {
    "amount": 32790051733240,
    "price_impact": 4.1,
    "mcap_change_bps": 838
  }
]
```

### Retrieve the buyback maximum

`POST /launch/buyback/info/{launch_id}`

Returns the most the selected wallets can spend on a buyback. (Bearer JWT)

- Token: Upgraded session token, bound to a license.
- Read-only tokens: refused with `403 read_only_token`.
- Retry: Safe to retry. A pure read sent as POST: it reads the wallets' balances and sends nothing.

> `max_buy_amount` can exceed the JSON safe integer range; the SDK reads it as a string to keep every digit.

#### Path parameters

- `launch_id` (string, required): Public ID of the launch.

#### Body parameters

- `wallet_sources` (object, optional): Wallets to use: either flags `include_dev`, `include_mev` and `include_holders`, or an array of wallet addresses.
  - `include_dev` (boolean, optional): Include the dev wallet.
  - `include_mev` (boolean, optional): Include the MEV wallets.
  - `include_holders` (boolean, optional): Include the holder wallets.

#### Returns 200 OK

- `max_buy_amount` (string): Largest buyback, in quote base units. Solana launches answer it as a number.
- `eligible_wallet_count` (integer): Wallets able to buy.

#### Errors

| Status | Code | Message | When | What to do |
| --- | --- | --- | --- | --- |
| 400 | `bad_request` | `invalid launch id format` | `launch_id` is not a valid launch ID. | Pass the `launch_id` returned when the launch was created, as listed by [List the license's launches](/reference/licenses/#list-mints). |
| 404 | `not_found` | `launch not found` | No launch with this ID belongs to your license. | Check the ID, and that your token is upgraded onto the license that owns the launch. |
| 500 | `internal_error` | `Token not launched` | Solana: the token is not deployed yet. A launch with no saved plan answers `No launch data saved` or `No launch method saved` instead. | Call it once the launch is live, as shown by `launch_status` in [List the license's launches](/reference/licenses/#list-mints). |
| 400 | `bad_request` | `token not launched` | EVM: the token is not deployed yet. | Call it once the launch is live, as shown by `launch_status` in [List the license's launches](/reference/licenses/#list-mints). |

#### Example request

```bash
curl -X POST "https://api-mig.proxima.tools/launch/buyback/info/101482937561204" \
  -H "Authorization: Bearer $PROXIMA_JWT" \
  -H "Content-Type: application/json" \
  -d '{
  "wallet_sources": {
    "include_dev": false,
    "include_mev": true,
    "include_holders": true
  }
}'
```

#### Example response

```json
{
  "max_buy_amount": "7412500000",
  "eligible_wallet_count": 18
}
```

### Buy back the token

`POST /launch/buyback/{launch_id}`

Buys the launch token with several launch wallets at once. (Bearer JWT)

- Token: Upgraded session token, bound to a license.
- Read-only tokens: refused with `403 read_only_token`.
- Retry: Check before retrying. Nothing refuses a repeat, so it buys again. Look for the `buy` event the call writes in [List a launch's activity events](/reference/history/#list-launch-events) before sending it again.

The amount is split across the selected wallets according to `selection_mode`, `dispersion` and `distribution`, then executed one after the other or in parallel. Use [Retrieve the buyback maximum](#retrieve-buyback-max) to size it.

#### Path parameters

- `launch_id` (string, required): Public ID of the launch.

#### Body parameters

- `amount` (string, required): Quote to spend in total, in base units, as an integer string. `0` spends everything available.
- `slippage` (integer, required): Slippage tolerance, in basis points.
- `selection_mode` (enum, optional, default "random"): Which wallets buy first. Possible values: `random`, `low_tokens`, `high_tokens`.
- `dispersion` (integer, optional): How many of the selected wallets buy, from `0` (fewest) to `100` (all).
- `distribution` (string, optional, default "equal"): How the amount is split: `equal`, `weighted`, or `{"random": {"deviation_pct"}}` (deviation defaults to 20).
- `execution` (object, optional, default "stagger"): How the buys are sent.
  - `mode` (enum, optional): One after the other, or all at once. Possible values: `stagger`, `parallel`.
  - `delay_ms` (integer, optional, default "1000"): `stagger` only: delay between buys, in milliseconds.
- `fake_tip_pct` (number, optional): Not used to build the trades. EVM refuses a value above 100; Solana ignores it. The app sends `0`.
- `wallet_sources` (object | array<string>, optional): Wallets to use: either flags `include_dev`, `include_mev` and `include_holders`, or an array of wallet addresses.
  - `include_dev` (boolean, optional): Include the dev wallet.
  - `include_mev` (boolean, optional): Include the MEV wallets.
  - `include_holders` (boolean, optional): Include the holder wallets.
- `terminal` (enum, optional): Sent by the SDK, not read by the API. Possible values: `direct`, `axiom`, `padre`, `gmgn`.
- `routing` (object, optional): Sent by the SDK, not read by the API.

#### Returns 200 OK

- `ok` (boolean): `true` when at least one buy landed. On Solana a buyback where every buy failed still answers 200, with `ok: false`.
- `message` (string): Human-readable outcome.
- `total_wallets` (integer): Wallets used.
- `successful` (integer): Buys that landed.
- `failed` (integer): Buys that failed.
- `total_token_bought` (number): Tokens bought, in base units.
- `total_quote_spent` (number): Quote spent, in base units.

#### Errors

| Status | Code | Message | When | What to do |
| --- | --- | --- | --- | --- |
| 400 | `bad_request` | `invalid launch id format` | `launch_id` is not a valid launch ID. | Pass the `launch_id` returned when the launch was created, as listed by [List the license's launches](/reference/licenses/#list-mints). |
| 404 | `not_found` | `launch not found` | No launch with this ID belongs to your license. | Check the ID, and that your token is upgraded onto the license that owns the launch. |
| 400 | `bad_request` | `Slippage cannot exceed 10000 (100%)` | EVM: `slippage` is above 10000 basis points. A stagger `delay_ms` above 60000 answers `Stagger delay cannot exceed 60000ms`, and a `fake_tip_pct` above 100 answers `fake_tip_pct must be between 0 and 100`. | Keep `slippage` at most 10000, `delay_ms` at most 60000 and `fake_tip_pct` at most 100. |
| 500 | `internal_error` | `Slippage cannot exceed 10000 (100%)` | Solana: `slippage` is above 10000 basis points. A stagger `delay_ms` above 60000 answers `Stagger delay cannot exceed 60000ms`. | Keep `slippage` at most 10000 and `delay_ms` at most 60000. |
| 500 | `internal_error` | `Token not launched` | Solana: the token is not deployed yet. A launch with no saved plan answers `No launch data saved` or `No launch method saved` instead. | Buy back once the launch is live, as shown by `launch_status` in [List the license's launches](/reference/licenses/#list-mints). |
| 400 | `bad_request` | `token not launched` | EVM: the token is not deployed yet. | Buy back once the launch is live, as shown by `launch_status` in [List the license's launches](/reference/licenses/#list-mints). |
| 422 | `unprocessable` | `No wallets available for buyback` | `wallet_sources` selects no wallet of the launch. | Select at least one of the launch's wallets in `wallet_sources`, as listed by [Retrieve a launch](/reference/launches/#retrieve-launch). |
| 422 | `unprocessable` | `No eligible wallets available` | None of the selected wallets has quote left to spend. | Fund the wallets or select others, then size the buy with [Retrieve the buyback maximum](/reference/launch-trading/#retrieve-buyback-max). |
| 400 | `bad_request` | `Requested amount <amount> exceeds total available <total>` | `amount` is more than the selected wallets can spend. | Size `amount` with [Retrieve the buyback maximum](/reference/launch-trading/#retrieve-buyback-max), or send `0` to spend everything available. |
| 422 | `unprocessable` | `No wallets selected for buyback` | The split gave none of the selected wallets a share of `amount`. | Raise `amount` or `dispersion`, then buy again. |
| 422 | `upstream_failure` | `evm_tx_engine api issue: <reason>` | EVM: every buy reverted. Without a reason from the sender the message ends `all buybacks reverted`. The `buy` activity event is still written. | Check the reason and the wallets' balances in [Retrieve a launch](/reference/launches/#retrieve-launch) before buying again. |
| 422 | `unprocessable` | `dev wallet <address> has insufficient native balance to pay gas; fund it and retry` | EVM: every buy was refused for lack of gas. The message names the dev wallet even when the buying wallets are the ones short. | Top up the buying wallets' gas, then buy again. |

#### Example request

```bash
curl -X POST "https://api-mig.proxima.tools/launch/buyback/101482937561204" \
  -H "Authorization: Bearer $PROXIMA_JWT" \
  -H "Content-Type: application/json" \
  -d '{
  "amount": "2500000000",
  "slippage": 1500,
  "selection_mode": "random",
  "distribution": "equal",
  "execution": {
    "mode": "stagger",
    "delay_ms": 1000
  },
  "fake_tip_pct": 0,
  "wallet_sources": [
    "HBwqDp7Qpmzos1wZhr5ZpwfsedZFGHubfdibhHBeH47Z",
    "GwjXHJRZCrZjmRTzfuBCFkeuMmy6PxNMET4cPSmsvahJ"
  ]
}'
```

#### Example response

```json
{
  "ok": true,
  "message": "Buyback completed: 2 successful, 0 failed",
  "total_wallets": 2,
  "successful": 2,
  "failed": 0,
  "total_token_bought": 81244031872,
  "total_quote_spent": 2500000000
}
```

### Sell the dev supply

`POST /launch/sell-dev-supply/{launch_id}`

Sells tokens from the dev wallet. (Bearer JWT)

- Token: Upgraded session token, bound to a license.
- Read-only tokens: refused with `403 read_only_token`.
- Retry: Check before retrying. A repeat sells again. Check the dev wallet's balance in [Retrieve a launch](/reference/launches/#retrieve-launch) and look for the `launch.sell_dev_supply` event in [List a launch's activity events](/reference/history/#list-launch-events) first.

> When the dev holds nothing, the call answers 200 with the message `No tokens to sell`.

> The SDK types also accept `terminal` and `routing`, but does not send them.

#### Path parameters

- `launch_id` (string, required): Public ID of the launch.

#### Body parameters

- `token_amount` (string, optional): Tokens to sell, in base units, as an integer string. `0` sells the whole balance.
- `quote_target` (string, optional): Quote to receive, in base units, as an integer string. Use instead of `token_amount`, not both.
- `fake_tip` (boolean, optional): Sent by the app, not read by the API.

#### Returns 200 OK

- `ok` (boolean): `true` when the request succeeded.
- `message` (string): Human-readable outcome.
- `token_sold` (number): Tokens sold, in base units.
- `quote_received` (number): Quote received, in base units.

#### Errors

| Status | Code | Message | When | What to do |
| --- | --- | --- | --- | --- |
| 400 | `bad_request` | `invalid launch id format` | `launch_id` is not a valid launch ID. | Pass the `launch_id` returned when the launch was created, as listed by [List the license's launches](/reference/licenses/#list-mints). |
| 404 | `not_found` | `launch not found` | No launch with this ID belongs to your license. | Check the ID, and that your token is upgraded onto the license that owns the launch. |
| 400 | `bad_request` | `token_amount and quote_target are mutually exclusive` | Solana: `token_amount` and `quote_target` were both sent. | Send only one of `token_amount` and `quote_target`. |
| 400 | `bad_request` | `quote_target is not supported on evm launches; pass token_amount` | EVM: a non-zero `quote_target` was sent. EVM sales take a token amount only. | Pass `token_amount` instead, sized with [Quote a trade](/reference/launch-trading/#quote-launch-trade) if you target a quote amount. |
| 500 | `internal_error` | `Token not launched` | Solana: the token is not deployed yet. A launch with no saved plan answers `No launch data saved` or `No launch method saved` instead. | Sell once the launch is live, as shown by `launch_status` in [List the license's launches](/reference/licenses/#list-mints). |
| 400 | `bad_request` | `token not launched` | EVM: the token is not deployed yet. | Sell once the launch is live, as shown by `launch_status` in [List the license's launches](/reference/licenses/#list-mints). |
| 500 | `internal_error` | `No dev keypair for imported token` | Solana: the launch was imported without its dev wallet's key. | Sell the dev supply only on launches whose dev wallet key Proxima holds. |
| 400 | `bad_request` | `dev wallet is watched, cannot sign` | EVM: the dev wallet is watch-only and cannot sign. A launch with no dev wallet answers `no dev wallet configured`. | Sell the dev supply only on launches whose dev wallet key Proxima holds. |
| 422 | `unprocessable` | `Supply to sell exceeds dev supply` | Solana: `token_amount` is more than the dev wallet holds. | Lower `token_amount`, or send `0` to sell the whole balance. |
| 400 | `bad_request` | `amount <requested> exceeds dev balance <balance>` | EVM: `token_amount` is more than the dev wallet holds. | Lower `token_amount`, or send `0` to sell the whole balance. |
| 422 | `unprocessable` | `this sale cannot go through lane: <reason>. Nothing was sent` | The execution engine cannot carry this sale. On EVM it never carries a sale from wallets its vault holds. Nothing was sent. | Do not repeat the call unchanged: the reason names what the execution engine cannot carry. |
| 409 | `lane_pending` | `sent, not confirmed: do not send it again` | Solana: the execution engine sent the sale but has not confirmed it, so it can still land. It also answers this, before sending anything, while the dev wallet has an earlier send unconfirmed. | Do not resend: once the hashes in `tx_hashes` settle, check [List a launch's activity events](/reference/history/#list-launch-events) and retry only the part that failed. |
| 422 | `upstream_failure` | `tx_engine api issue: Error while selling dev tokens` | Solana: the sale was not confirmed as landed. When it was split into several bundles, earlier ones may have landed. | Check the dev wallet's balance in [Retrieve a launch](/reference/launches/#retrieve-launch), then sell again only what is left. |
| 422 | `upstream_failure` | `evm_tx_engine api issue: <detail>` | EVM: the sale transaction failed, and the message carries the sender's reason. | Check the dev wallet's balance in [Retrieve a launch](/reference/launches/#retrieve-launch) before selling again. |
| 422 | `unprocessable` | `dev wallet <address> has insufficient native balance to pay gas; fund it and retry` | EVM: the dev wallet cannot pay the sale's gas. | Top up the dev wallet's gas, then sell again. |
| 409 | `launch_migrating` | `this launch is migrating to its pool, trading reopens in a few seconds` | EVM: the launch is moving from its curve to its pool, so nothing trades it for a few seconds. | Wait a few seconds, then sell again. |

#### Example request

```bash
curl -X POST "https://api-mig.proxima.tools/launch/sell-dev-supply/101482937561204" \
  -H "Authorization: Bearer $PROXIMA_JWT" \
  -H "Content-Type: application/json" \
  -d '{
  "token_amount": "0"
}'
```

#### Example response

```json
{
  "ok": true,
  "message": "Successfully sold",
  "token_sold": 17241379310344,
  "quote_received": 612004118
}
```

### Sell the sub-wallet supply

`POST /launch/sell-subs-supply/{launch_id}`

Sells tokens from the holder and MEV wallets of a launch. (Bearer JWT)

- Token: Upgraded session token, bound to a license.
- Read-only tokens: refused with `403 read_only_token`.
- Retry: Check before retrying. A repeat sells again. Check the wallets' balances in [Retrieve a launch](/reference/launches/#retrieve-launch) and look for the `launch.sell_subs_supply` event in [List a launch's activity events](/reference/history/#list-launch-events) first.

> When the wallets hold nothing, the call answers 200 with the message `No tokens to sell`.

#### Path parameters

- `launch_id` (string, required): Public ID of the launch.

#### Body parameters

- `token_amount` (string, optional): Tokens to sell, in base units, as an integer string. `0` sells the whole balance.
- `quote_target` (string, optional): Quote to receive, in base units, as an integer string. Use instead of `token_amount`, not both.
- `fake_tip` (boolean, optional): Sent by the app, not read by the API.
- `wallets` (array<string>, optional): Wallets to sell from. Omit or send an empty list to sell from every holder and MEV wallet.
- `fake_tip_pct` (number, optional): Sent by the app, not read by the API.

#### Returns 200 OK

- `ok` (boolean): `true` when the request succeeded.
- `message` (string): Human-readable outcome.
- `token_sold` (number): Tokens sold, in base units.
- `quote_received` (number): Quote received, in base units.

#### Errors

| Status | Code | Message | When | What to do |
| --- | --- | --- | --- | --- |
| 400 | `bad_request` | `invalid launch id format` | `launch_id` is not a valid launch ID. | Pass the `launch_id` returned when the launch was created, as listed by [List the license's launches](/reference/licenses/#list-mints). |
| 404 | `not_found` | `launch not found` | No launch with this ID belongs to your license. | Check the ID, and that your token is upgraded onto the license that owns the launch. |
| 409 | `conflict` | `the allowlist run is trading: pause it before selling` | Solana allowlist launch: its run is still trading. | Pause the run with [Pause an allowlist run](/reference/allowlist/#pause-allowlist), then sell. |
| 400 | `bad_request` | `token_amount and quote_target are mutually exclusive` | Solana: `token_amount` and `quote_target` were both sent. | Send only one of `token_amount` and `quote_target`. |
| 400 | `bad_request` | `quote_target is not supported on evm launches; pass token_amount` | EVM: a non-zero `quote_target` was sent. EVM sales take a token amount only. | Pass `token_amount` instead, sized with [Quote a trade](/reference/launch-trading/#quote-launch-trade) if you target a quote amount. |
| 500 | `internal_error` | `Token not launched` | Solana: the token is not deployed yet. A launch with no saved plan answers `No launch data saved` or `No launch method saved` instead. | Sell once the launch is live, as shown by `launch_status` in [List the license's launches](/reference/licenses/#list-mints). |
| 400 | `bad_request` | `token not launched` | EVM: the token is not deployed yet. | Sell once the launch is live, as shown by `launch_status` in [List the license's launches](/reference/licenses/#list-mints). |
| 500 | `internal_error` | `Wallet not found in license` | Solana: a wallet in `wallets` does not belong to your license. A watch-only wallet answers `Wallet is watch-only and cannot sign`. | List only the launch's holder and MEV wallets in `wallets`, as shown by [Retrieve a launch](/reference/launches/#retrieve-launch). |
| 400 | `bad_request` | `wallet not found on launch: <address>` | EVM: a wallet in `wallets` is not one of the launch's. A malformed address answers `invalid wallet address: <address>`. | List only the launch's holder and MEV wallets in `wallets`, as shown by [Retrieve a launch](/reference/launches/#retrieve-launch). |
| 400 | `bad_request` | `no wallets to sell` | EVM: no wallet is left to sell from. | Check `wallets` against the launch's wallets in [Retrieve a launch](/reference/launches/#retrieve-launch). |
| 500 | `internal_error` | `Not enough balance to sell. Available: 0` | Solana: an amount was sent, but the selected wallets hold none of the token. Without an amount the call answers 200 with `No tokens to sell`. | Check the wallets' balances in [Retrieve a launch](/reference/launches/#retrieve-launch) before selling. |
| 422 | `unprocessable` | `this sale cannot go through lane: <reason>. Nothing was sent` | The execution engine cannot carry this sale. On EVM it never carries a sale from wallets its vault holds. Nothing was sent. | Do not repeat the call unchanged: the reason names what the execution engine cannot carry. |
| 422 | `unprocessable` | `the vault holds <held_wallet> and not <local_wallet>: one send is signed in one place` | Solana: the execution engine's vault signs some of the selected wallets and not others, and one sale cannot mix them. Nothing was sent. | Sell the two wallets the message names in separate calls through `wallets`. |
| 409 | `lane_pending` | `sent, not confirmed: do not send it again` | Solana: the execution engine sent the sale but has not confirmed it, so it can still land. It also answers this, before sending anything, while one of the wallets has an earlier send unconfirmed. | Do not resend: once the hashes in `tx_hashes` settle, check [List a launch's activity events](/reference/history/#list-launch-events) and retry only the part that failed. |
| 500 | `internal_error` | `Error while selling some subs tokens` | Solana: not every sale landed. Some may have, and the message does not say which. | Check the wallets' balances in [Retrieve a launch](/reference/launches/#retrieve-launch), then sell again only what is left. |
| 422 | `upstream_failure` | `evm_tx_engine api issue: <detail>` | EVM: every wallet's sale failed, and the message carries the sender's reason. When only some fail, the call answers 200 with per-wallet counts. | Check the wallets' balances in [Retrieve a launch](/reference/launches/#retrieve-launch) before selling again. |
| 422 | `unprocessable` | `dev wallet <address> has insufficient native balance to pay gas; fund it and retry` | EVM: every sale was refused for lack of gas. The message names the dev wallet even when the selling wallets are the ones short. | Top up the selling wallets' gas, then sell again. |
| 409 | `launch_migrating` | `this launch is migrating to its pool, trading reopens in a few seconds` | EVM: every sale failed because the launch is moving from its curve to its pool. | Wait a few seconds, then sell again. |

#### Example request

```bash
curl -X POST "https://api-mig.proxima.tools/launch/sell-subs-supply/101482937561204" \
  -H "Authorization: Bearer $PROXIMA_JWT" \
  -H "Content-Type: application/json" \
  -d '{
  "token_amount": "9000000000000",
  "wallets": [
    "HBwqDp7Qpmzos1wZhr5ZpwfsedZFGHubfdibhHBeH47Z",
    "GwjXHJRZCrZjmRTzfuBCFkeuMmy6PxNMET4cPSmsvahJ"
  ],
  "fake_tip_pct": 0
}'
```

#### Example response

```json
{
  "ok": true,
  "message": "Successfully sold",
  "token_sold": 9000000000000,
  "quote_received": 301877402
}
```

### Nuke a launch

`POST /launch/nuke/{launch_id}`

Sells every token held by the launch wallets. (Bearer JWT)

- Token: Upgraded session token, bound to a license.
- Read-only tokens: refused with `403 read_only_token`.
- Retry: Check before retrying. A repeat sells only what the wallets still hold, but on EVM nothing refuses it while the first nuke is still selling. Before nuking again, check the balances in [Retrieve a launch](/reference/launches/#retrieve-launch) and the `launch.nuke` event in [List a launch's activity events](/reference/history/#list-launch-events).

With `consolidate`, the holders' tokens are first pooled onto one wallet with plain transfers, then sold from it.

#### Path parameters

- `launch_id` (string, required): Public ID of the launch.

#### Body parameters

- `include_dev` (boolean, optional, default "true"): Also sell the dev wallet.
- `consolidate` (boolean, optional, default "false"): Pool the tokens onto one wallet before selling.

#### Returns 200 OK

- `ok` (boolean): `true` when the nuke ran. On EVM it stays `true` when sales failed: read `failed`.
- `message` (string): Human-readable outcome. Solana only.
- `token_sold` (number): Tokens sold, in base units.
- `quote_received` (number): Quote received, in base units.
- `succeeded` (integer): EVM only: wallets that sold.
- `failed` (integer): EVM only: wallets that failed to sell.

#### Errors

| Status | Code | Message | When | What to do |
| --- | --- | --- | --- | --- |
| 400 | `bad_request` | `invalid launch id format` | `launch_id` is not a valid launch ID. | Pass the `launch_id` returned when the launch was created, as listed by [List the license's launches](/reference/licenses/#list-mints). |
| 404 | `not_found` | `launch not found` | No launch with this ID belongs to your license. | Check the ID, and that your token is upgraded onto the license that owns the launch. |
| 400 | `bad_request` | `a nuke is already running for this launch` | Solana: another nuke of this launch is still running. | Wait for the running nuke to finish, then check the `launch.nuke` event in [List a launch's activity events](/reference/history/#list-launch-events). |
| 409 | `conflict` | `the allowlist run is trading: pause it before selling` | Solana allowlist launch: its run is still trading. | Pause the run with [Pause an allowlist run](/reference/allowlist/#pause-allowlist), then nuke. |
| 500 | `internal_error` | `Token not launched` | Solana: the token is not deployed yet. A launch with no saved plan answers `No launch data saved` or `No launch method saved` instead. | Nuke only a live launch, as shown by `launch_status` in [List the license's launches](/reference/licenses/#list-mints). |
| 400 | `bad_request` | `token not launched` | EVM: the token is not deployed yet. | Nuke only a live launch, as shown by `launch_status` in [List the license's launches](/reference/licenses/#list-mints). |
| 422 | `upstream_failure` | `rpc api issue: could not read the balances to nuke` | Solana: the wallets' balances could not be read. Nothing was sent. | Nuke again in a few seconds. |
| 400 | `bad_request` | `no wallets with tokens to sell` | No selected wallet holds the token. EVM answers `all wallets have zero token balance`, or `no wallets to nuke` when the launch has no wallets. | Nothing is left to sell: confirm with the balances in [Retrieve a launch](/reference/launches/#retrieve-launch). |
| 400 | `bad_request` | `every holder is under the sell's gas escrow of <wei> wei; fund them or retry with consolidate` | EVM: every holder lacks the gas the sale reserves. | Top up the holders' gas, or nuke again with `consolidate: true`. |
| 400 | `bad_request` | `consolidate needs one holder funded enough to pay the pooling batches and the sell` | With `consolidate`, no holder has enough SOL to pay the pooling and the sale. EVM answers `consolidate needs one holder funded enough to pay the sell`. | Fund one holder, or nuke without `consolidate`. |
| 400 | `bad_request` | `consolidate left no wallet holding tokens` | EVM, with `consolidate`: after the pooling transfers, no wallet held tokens to sell. | Check the balances in [Retrieve a launch](/reference/launches/#retrieve-launch), then nuke again without `consolidate`. |
| 500 | `internal_error` | `Unimplemented platform` | Solana: the launch's platform has no nuke. | Sell with [Sell the sub-wallet supply](/reference/launch-trading/#sell-subs-supply) and [Sell the dev supply](/reference/launch-trading/#sell-dev-supply) instead. |
| 422 | `unprocessable` | `this nuke cannot go through lane: <reason>. Nothing was sent` | The execution engine cannot carry this nuke. Refused before the first round, nothing was sent and the message ends `Nothing was sent`; refused at a later round, the message does not, and earlier rounds may have landed. On EVM it never carries a nuke of wallets its vault holds. | Check the balances in [Retrieve a launch](/reference/launches/#retrieve-launch), and do not repeat the call unchanged. |
| 422 | `unprocessable` | `the vault holds <held_wallet> and not <local_wallet>: one send is signed in one place` | Solana: the execution engine's vault signs some of the launch's wallets and not others, and one nuke cannot mix them. Nothing was sent. | Sell the wallets the message names separately with [Sell the sub-wallet supply](/reference/launch-trading/#sell-subs-supply). |
| 409 | `lane_pending` | `sent, not confirmed: do not send it again` | Solana: the execution engine sent a sale but has not confirmed it, so it can still land. It also answers this before selling anything, when the bots the nuke stops still have sends unconfirmed. | Do not resend: once the hashes in `tx_hashes` settle, check [List a launch's activity events](/reference/history/#list-launch-events) and retry only the part that failed. |
| 422 | `upstream_failure` | `tx_engine api issue: Error while nuking launch` | Solana: not every sale landed, and some may have. Through the execution engine the message goes on with the round that was not sent and the sales that landed before it. | Check the balances in [Retrieve a launch](/reference/launches/#retrieve-launch), then nuke again to sell what is left. |
| 409 | `launch_migrating` | `this launch is migrating to its pool, trading reopens in a few seconds` | EVM: every sale failed because the launch is moving from its curve to its pool. When only some fail, the call answers 200 with `ok: true` and per-wallet counts. | Wait a few seconds, then nuke again. |

#### Example request

```bash
curl -X POST "https://api-mig.proxima.tools/launch/nuke/101482937561204" \
  -H "Authorization: Bearer $PROXIMA_JWT" \
  -H "Content-Type: application/json" \
  -d '{
  "include_dev": true,
  "consolidate": false
}'
```

#### Example response

```json
{
  "ok": true,
  "message": "Successfully sold",
  "token_sold": 52115420310522,
  "quote_received": 1702330118
}
```

### Transfer tokens

`POST /launch/transfer-token/{launch_id}`

Sends the launch token from launch wallets to other addresses. (Bearer JWT)

- Token: Upgraded session token, bound to a license.
- Read-only tokens: refused with `403 read_only_token`.
- Retry: Check before retrying. A repeat sends the tokens again. Before resending, check the senders' balances in [Retrieve a launch](/reference/launches/#retrieve-launch) and the `launch.transfer_token` event in [List a launch's activity events](/reference/history/#list-launch-events); on EVM, resend only the entries listed in `failures`.

#### Path parameters

- `launch_id` (string, required): Public ID of the launch.

#### Body parameters

- `transfers` (array<object>, required): Transfers to make.
  - `from` (string, required): Launch wallet to send from.
  - `recipient` (string, required): Address to send to.
  - `amount` (string, required): Tokens to send, in base units.

#### Returns 200 OK

- `ok` (boolean): `true` when every transfer went out. On EVM a 200 can carry `false`, with the misses in `failures`.
- `message` (string): Human-readable outcome. Solana only.
- `succeeded` (integer): EVM only: transfers that went out.
- `failed` (integer): EVM only: transfers that did not.
- `tx_hashes` (array<string>): EVM only: hashes of the transfers that went out.
- `failures` (array<object>): EVM only: one entry per transfer that did not go out, with `recipient`, `sender`, `amount_token_atomic` and `error`.

#### Errors

| Status | Code | Message | When | What to do |
| --- | --- | --- | --- | --- |
| 400 | `bad_request` | `invalid launch id format` | `launch_id` is not a valid launch ID. | Pass the `launch_id` returned when the launch was created, as listed by [List the license's launches](/reference/licenses/#list-mints). |
| 404 | `not_found` | `launch not found` | No launch with this ID belongs to your license. | Check the ID, and that your token is upgraded onto the license that owns the launch. |
| 400 | `bad_request` | `no transfers specified` | EVM: `transfers` is empty. | Send at least one transfer. |
| 400 | `bad_request` | `One of the recipient pubkey is invalid` | Solana: a `recipient` is not a valid address. A bad `from` answers `One of the from pubkey is invalid`; EVM answers `invalid recipient address` or `invalid from address: <from>`. | Send valid addresses for the launch's chain in `recipient` and `from`. |
| 400 | `bad_request` | `Sender and recipient are the same wallet. Choose a different recipient.` | Solana: a transfer's `from` and `recipient` are the same wallet. | Send to a different `recipient`. |
| 500 | `internal_error` | `Token not launched` | Solana: the token is not deployed yet. A launch with no saved plan answers `No launch data saved` or `No launch method saved` instead. | Transfer once the launch is live, as shown by `launch_status` in [List the license's launches](/reference/licenses/#list-mints). |
| 400 | `bad_request` | `token not launched` | EVM: the token is not deployed yet. | Transfer once the launch is live, as shown by `launch_status` in [List the license's launches](/reference/licenses/#list-mints). |
| 400 | `bad_request` | `from wallet <wallet> is not one of this launch's wallets` | A `from` is not one of the launch's wallets. | Send from the launch's wallets, as listed by [Retrieve a launch](/reference/launches/#retrieve-launch). |
| 400 | `bad_request` | `no senders selected (set from_dev and/or from_holder)` | No transfer names a `from` wallet, so there is no sender. | Set `from` on every transfer to one of the launch's wallets. |
| 400 | `bad_request` | `sender <from> cannot cover its transfer of <amount> (out of tokens or SOL)` | A `from` wallet lacks the tokens for its transfer, or the SOL or gas to send it. EVM answers `from wallet <from> cannot cover its transfer of <amount> (out of tokens or gas)`, or `from wallet <from> holds no tokens or cannot pay for a transfer`. | Lower the amount or top up the sender, checking its balances in [Retrieve a launch](/reference/launches/#retrieve-launch). |
| 400 | `bad_request` | `nothing to transfer` | Every `amount` is `0`. | Send at least one transfer with a non-zero `amount`. |
| 422 | `unprocessable` | `this transfer cannot go through lane: <reason>` | The execution engine cannot carry this transfer. Nothing was sent. | Do not repeat the call unchanged: the reason names what the execution engine cannot carry. |
| 422 | `unprocessable` | `the vault holds <held_wallet> and not <local_wallet>: one send is signed in one place` | The execution engine's vault signs some of the senders and not others, and one call cannot mix them. Nothing was sent. | Send the transfers of the two wallets the message names in separate calls. |
| 409 | `lane_pending` | `sent, not confirmed: do not send it again` | The execution engine sent a transfer but has not confirmed it, so it can still land. It also answers this, before sending anything, while one of the senders has an earlier send unconfirmed. | Do not resend: once the hashes in `tx_hashes` settle, check [List a launch's activity events](/reference/history/#list-launch-events) and retry only the part that failed. |
| 422 | `upstream_failure` | `tx_engine api issue: Error while transferring tokens` | Solana: not every transfer landed. Bundles sent before the failing one may have landed. | Check the senders' balances in [Retrieve a launch](/reference/launches/#retrieve-launch), then send again only the transfers that did not land. |

#### Example request

```bash
curl -X POST "https://api-mig.proxima.tools/launch/transfer-token/101482937561204" \
  -H "Authorization: Bearer $PROXIMA_JWT" \
  -H "Content-Type: application/json" \
  -d '{
  "transfers": [
    {
      "from": "HBwqDp7Qpmzos1wZhr5ZpwfsedZFGHubfdibhHBeH47Z",
      "recipient": "1SCVdnz5AsWbyy7MtiqYHH1upvvF2eVMGAVKTRuuUZd",
      "amount": "2500000000000"
    }
  ]
}'
```

#### Example response

```json
{
  "ok": true,
  "message": "Successfully transferred"
}
```

### Burn the dev supply

`POST /launch/burn-dev-supply/{launch_id}`

Burns tokens from the dev wallet. (Bearer JWT)

- Token: Upgraded session token, bound to a license.
- Read-only tokens: refused with `403 read_only_token`.
- Retry: Check before retrying. A repeat burns again, and `0` burns whatever is left. Check the dev wallet's balance in [Retrieve a launch](/reference/launches/#retrieve-launch) and look for the `launch.burn_dev_supply` event in [List a launch's activity events](/reference/history/#list-launch-events) first.

Burning is irreversible.

#### Path parameters

- `launch_id` (string, required): Public ID of the launch.

#### Body parameters

- `amount` (string, required): Tokens to burn, in base units. `0` burns the whole dev balance.

#### Returns 200 OK

- `ok` (boolean): `true` when the request succeeded.
- `message` (string): Human-readable outcome. Solana only.
- `signature` (string): Transaction signature, or transaction hash on EVM.
- `token_burned` (string): EVM only: tokens burned, in base units.

#### Errors

| Status | Code | Message | When | What to do |
| --- | --- | --- | --- | --- |
| 400 | `bad_request` | `invalid launch id format` | `launch_id` is not a valid launch ID. | Pass the `launch_id` returned when the launch was created, as listed by [List the license's launches](/reference/licenses/#list-mints). |
| 404 | `not_found` | `launch not found` | No launch with this ID belongs to your license. | Check the ID, and that your token is upgraded onto the license that owns the launch. |
| 400 | `bad_request` | `amount is required: pass the exact amount to burn, or 0 to burn the whole dev balance` | EVM: `amount` is missing. | Send `amount`, or `0` to burn the whole dev balance. |
| 500 | `internal_error` | `Token not launched` | Solana: the token is not deployed yet. A launch with no saved plan answers `No launch data saved` or `No launch method saved` instead. | Burn once the launch is live, as shown by `launch_status` in [List the license's launches](/reference/licenses/#list-mints). |
| 400 | `bad_request` | `token not launched` | EVM: the token is not deployed yet. | Burn once the launch is live, as shown by `launch_status` in [List the license's launches](/reference/licenses/#list-mints). |
| 500 | `internal_error` | `No dev keypair for imported token` | Solana: the launch was imported without its dev wallet's key. | Burn only on launches whose dev wallet key Proxima holds. |
| 400 | `bad_request` | `dev wallet is watched, cannot sign` | EVM: the dev wallet is watch-only and cannot sign. A launch with no dev wallet answers `no dev wallet configured`. | Burn only on launches whose dev wallet key Proxima holds. |
| 400 | `bad_request` | `dev has no tokens to burn` | EVM: the dev wallet holds none of the token. Solana answers 200 with the message `No tokens to burn` instead. | Check the dev wallet's balance in [Retrieve a launch](/reference/launches/#retrieve-launch): there is nothing to burn. |
| 422 | `unprocessable` | `Supply to burn exceeds dev supply` | Solana: `amount` is more than the dev wallet holds. | Lower `amount`, or send `0` to burn the whole balance. |
| 400 | `bad_request` | `amount <requested> exceeds dev balance <balance>` | EVM: `amount` is more than the dev wallet holds. | Lower `amount`, or send `0` to burn the whole balance. |
| 422 | `upstream_failure` | `tx_engine api issue: Error while burning dev supply` | Solana: the burn was not confirmed as landed. | Check the dev wallet's balance in [Retrieve a launch](/reference/launches/#retrieve-launch) before burning again. |
| 422 | `upstream_failure` | `evm_tx_engine api issue: <detail>` | EVM: the burn transaction failed, and the message carries the sender's reason. | Check the dev wallet's balance in [Retrieve a launch](/reference/launches/#retrieve-launch) before burning again. |

#### Example request

```bash
curl -X POST "https://api-mig.proxima.tools/launch/burn-dev-supply/101482937561204" \
  -H "Authorization: Bearer $PROXIMA_JWT" \
  -H "Content-Type: application/json" \
  -d '{
  "amount": "5000000000000"
}'
```

#### Example response

```json
{
  "ok": true,
  "message": "Successfully burnt dev supply",
  "signature": "5ysXA38PjKtmRfyDZ7J6j7JES83EdpKnjkvUtkLxm964QbYGPDbQD9vppVqXmA7a2NBnJUDoWi5Sb6zsexsoo2a1"
}
```

### Lock the dev supply

`POST /launch/lock-token/{launch_id}`

Locks tokens from the dev wallet in a Streamflow lock on Solana. (Bearer JWT)

- Token: Upgraded session token, bound to a license.
- Read-only tokens: refused with `403 read_only_token`.
- Retry: Check before retrying. A repeat creates a second lock. Look for the `launch.lock_token` event, which carries the lock's `strm_metadata`, in [List a launch's activity events](/reference/history/#list-launch-events), and check the dev wallet's balance in [Retrieve a launch](/reference/launches/#retrieve-launch) first.

> Solana launches only.

#### Path parameters

- `launch_id` (string, required): Public ID of the launch.

#### Body parameters

- `amount` (string, required): Tokens to lock, in base units. At least 100000000.
- `period` (integer, required): Lock duration, in seconds. At least 60.

#### Returns 200 OK

- `ok` (boolean): `true` when the request succeeded.
- `message` (string): Human-readable outcome.
- `strm_metadata` (string): Streamflow lock account.

#### Errors

| Status | Code | Message | When | What to do |
| --- | --- | --- | --- | --- |
| 400 | `bad_request` | `invalid launch id format` | `launch_id` is not a valid launch ID. | Pass the `launch_id` returned when the launch was created, as listed by [List the license's launches](/reference/licenses/#list-mints). |
| 404 | `not_found` | `launch not found` | No launch with this ID belongs to your license. | Check the ID, and that your token is upgraded onto the license that owns the launch. |
| 400 | `unsupported_chain` | `this endpoint is not supported for this chain` | The launch is not on Solana. | Call this endpoint only for Solana launches. |
| 500 | `internal_error` | `Token not launched` | The token is not deployed yet. A launch with no saved plan answers `No launch data saved` or `No launch method saved` instead. | Lock once the launch is live, as shown by `launch_status` in [List the license's launches](/reference/licenses/#list-mints). |
| 400 | `bad_request` | `Lock amount too small` | `amount` is below 100000000 base units. An `amount` of `0` answers `Invalid lock amount`. | Lock at least 100000000 base units. |
| 400 | `bad_request` | `Lock period too small` | `period` is below 60 seconds. | Lock for at least 60 seconds. |
| 500 | `internal_error` | `No dev keypair for imported token` | The launch was imported without its dev wallet's key. | Lock only on launches whose dev wallet key Proxima holds. |
| 422 | `unprocessable` | `Not enough tokens` | The dev wallet holds less than `amount` plus Streamflow's 0.5% fee. | Lower `amount` so it fits the dev balance shown in [Retrieve a launch](/reference/launches/#retrieve-launch), fee included. |
| 422 | `unprocessable` | `Not enough SOL` | The dev wallet holds less than the 0.175 SOL the lock needs. | Top up the dev wallet to at least 0.175 SOL, then lock again. |
| 422 | `upstream_failure` | `tx_engine api issue: Error while locking token` | The lock was not confirmed as landed. | Check the dev wallet's balance in [Retrieve a launch](/reference/launches/#retrieve-launch) before locking again, since a second call creates a second lock. |

#### Example request

```bash
curl -X POST "https://api-mig.proxima.tools/launch/lock-token/101482937561204" \
  -H "Authorization: Bearer $PROXIMA_JWT" \
  -H "Content-Type: application/json" \
  -d '{
  "amount": "50000000000000",
  "period": 2592000
}'
```

#### Example response

```json
{
  "ok": true,
  "message": "Successfully locked token",
  "strm_metadata": "ANMQCTKS1HJC1gwbMGo1r62E1PLwWCXBGgZzvKvQcZY"
}
```
