# Auto Sell

> Run sell strategies on a launched token from the launch's wallets.

Auto Sell sells the launch's token from its wallets following one or more strategies: replication of external buys, timed sells and a market-cap ladder. A session is either planned (saved as `Planned` and started with the launch) or run on a token that is already live, and it ends on its time or sell budget. Sessions last at most 30 days.

Amounts are raw units sent as integers or integer strings; market caps are micro-USD and ratios basis points. The web app polls the status endpoint every 5 seconds.

On an EVM multi-launch container, the session endpoints answer `400` (`multi-launch container: sessions run on the winner launch once it resolves`); call them on the winning launch instead.

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

## Endpoints

- `POST /launch/autosell/plan/{launch_id}`: Plan an Auto Sell session
- `POST /launch/autosell/run/{launch_id}`: Start an Auto Sell session
- `POST /launch/autosell/update/{launch_id}`: Update an Auto Sell session
- `GET /launch/autosell/status/{launch_id}`: Retrieve Auto Sell status
- `POST /launch/autosell/cancel/{launch_id}`: Cancel an Auto Sell session
- `POST /launch/autosell/pause/{launch_id}`: Pause an Auto Sell session
- `POST /launch/autosell/resume/{launch_id}`: Resume an Auto Sell session
- `POST /launch/autosell/discard/{launch_id}`: Discard an Auto Sell session

## The Auto sell status object

The launch's Auto Sell session as the API sends it. Solana launches report totals under `auto_sell_*` and progress under `modes`; EVM launches report totals under plain names and progress under `engine`.

- `status` (enum): Session state. Possible values: `None`, `Planned`, `Running`, `Paused`, `Completed`, `Cancelled`, `Failed`.
- `info` (object): Session details. Absent when `status` is `None`.
  - `params` (object): The session parameters as stored: the body of the last plan, run or update call.
  - `started_at` (integer | null): Unix timestamp (seconds) the session started.
  - `ended_at` (integer | null): Unix timestamp (seconds) the session ended.
  - `status_reason` (string | null): Why the session ended or failed, when known.
  - `auto_sell_native_profit` (integer): Solana: native received by the session, raw units. Can be negative.
  - `auto_sell_usd_profit` (integer): Solana: USD received, micro-USD. Can be negative.
  - `auto_sell_token_sold` (integer): Solana: tokens sold, raw units.
  - `modes` (array<object>): Solana: progress per mode.
    - `id` (enum): Mode. Possible values: `replication`, `timed`, `mcap_ladder`.
    - `accumulated` (integer): Replication only: amount accumulated toward the next trade, summed over layers.
    - `layers` (array<object>): Progress per layer.
      - `id` (string): Layer ID: `as_4217_l0` for timed and replication layers, `as_4217_0` for market-cap ladder steps. Pass it as `layer_id` to cancel, pause or resume one layer.
      - `state` (enum): Layer state. The client also accepts lowercase values. Possible values: `Active`, `Paused`, `Exhausted`.
      - `token_sold` (integer): Tokens this layer has sold, raw units. The field keeps this name on both sides.
      - `sol_spent` (integer): Native or quote amount this layer has traded, raw units.
  - `token_sold` (string): EVM: tokens sold, raw units, as a decimal string.
  - `native_profit` (string): EVM: native received, wei, as a decimal string.
  - `usd_profit` (integer): EVM: USD received, micro-USD.
  - `engine` (object | null): EVM: live engine snapshot.
    - `cached_mcap_usd` (number): Market cap the engine last read, USD.
    - `swapback_layers` (array<object>): Replication layers.
      - `id` (string): Layer ID.
      - `state` (string): Layer state.
      - `accumulated` (integer | string): Amount accumulated toward the next trade.
      - `token_sold` (integer | string): Tokens sold by the layer, raw units.
      - `native_profit` (integer | string): Native received by the layer, wei.
    - `timed_layers` (array<object>): Timed layers.
      - `id` (string): Layer ID.
      - `state` (string): Layer state.
      - `accumulated` (integer | string): Amount accumulated toward the next trade.
      - `token_sold` (integer | string): Tokens sold by the layer, raw units.
      - `native_profit` (integer | string): Native received by the layer, wei.
    - `mcap_levels` (array<object>): Ladder steps: the layer fields plus `target_mcap_usd` and `sell_amount`.

```json
{
  "status": "Running",
  "info": {
    "params": {
      "modes": [
        {
          "TimedExactIn": {
            "layers": [
              {
                "min_amount": "1500000000000",
                "max_amount": "4000000000000",
                "delay": 45000,
                "min_mcap": 120000000000,
                "end_condition": {
                  "amount": "60000000000000",
                  "time": 21600
                }
              }
            ]
          }
        },
        {
          "McapLadder": [
            {
              "target_mcap": 150000000000,
              "sell_amount": "20000000000000"
            },
            {
              "target_mcap": 300000000000,
              "sell_amount": "40000000000000"
            }
          ]
        }
      ],
      "end_condition": {
        "time": 0,
        "amount": "0"
      },
      "slippage": 1500,
      "start_delay": 300,
      "wallet_pubkeys": null
    },
    "started_at": 1793655010,
    "ended_at": null,
    "status_reason": null,
    "auto_sell_native_profit": 2875000000,
    "auto_sell_usd_profit": 539060000,
    "auto_sell_token_sold": 26500000000000,
    "modes": [
      {
        "id": "timed",
        "layers": [
          {
            "id": "as_4217_l0",
            "state": "Active",
            "token_sold": 6500000000000,
            "sol_spent": 655000000
          }
        ]
      },
      {
        "id": "mcap_ladder",
        "layers": [
          {
            "id": "as_4217_0",
            "state": "Exhausted",
            "token_sold": 20000000000000,
            "sol_spent": 2220000000
          },
          {
            "id": "as_4217_1",
            "state": "Active",
            "token_sold": 0,
            "sol_spent": 0
          }
        ]
      }
    ]
  }
}
```

## The Auto sell mode object

One Auto Sell strategy. Exactly one key is set: `SwapBack` (replication), `TimedExactIn` (timed) or `McapLadder` (market-cap ladder). The replication and timed modes take either single-layer fields or `layers`; a session takes at most 5 replication and 5 timed layers.

- `SwapBack` (object): Replication. Watches external buys of the token and accumulates `replication_factor` of each qualifying swap; a sell fires once the accumulated amount reaches `min_token_per_swap`.
  - `replication_factor` (integer): Single-layer form: share to replicate, in basis points (10–100000).
  - `trigger_condition` (object): Single-layer form: which external swaps count. Same shape as in `layers`.
  - `min_token_per_swap` (integer | string): Single-layer form: minimum size of one sell, raw token units.
  - `whitelist` (array<string>): Payer addresses whose swaps are ignored. The launch's own wallets are always ignored.
  - `layers` (array<object>): Layered form: up to 5 replication layers.
    - `replication_factor` (integer): Share of each qualifying external swap to replicate, in basis points (`10000` = 100%). Accepted range 10–100000.
    - `trigger_condition` (object): Which external swaps count.
      - `type` (enum): `Rate`: each qualifying swap triggers with probability `value` / 10000 (10–10000). `MinSol`: only swaps of at least `value` native, raw units. `MinToken`: only swaps of at least `value` tokens, raw units. Possible values: `Rate`, `MinSol`, `MinToken`.
      - `value` (integer): Threshold for `type`.
    - `min_token_per_swap` (integer | string): Minimum size of one sell, raw token units.
    - `min_mcap` (integer): Lower market-cap bound of this layer, micro-USD. Layer ranges must not overlap.
    - `max_mcap` (integer): Upper market-cap bound of this layer, micro-USD.
    - `end_condition` (object): Per-layer budget and lifetime; falls back to the session's.
      - `amount` (integer | string): Budget of this layer, raw token units.
      - `time` (integer): Lifetime of this layer, in seconds.
- `TimedExactIn` (object): Timed. Sells a random amount between `min_amount` and `max_amount` every `delay` milliseconds.
  - `min_amount` (integer | string): Single-layer form: smallest sell, raw token units.
  - `max_amount` (integer | string): Single-layer form: largest sell, raw token units.
  - `delay` (integer): Single-layer form: interval in milliseconds (1500–86400000).
  - `layers` (array<object>): Layered form: up to 5 timed layers.
    - `min_amount` (integer | string): Smallest sell, raw token units.
    - `max_amount` (integer | string): Largest sell, raw token units.
    - `delay` (integer): Interval in milliseconds (1500–86400000).
    - `min_mcap` (integer): Lower market-cap bound of this layer, micro-USD. Layer ranges must not overlap.
    - `max_mcap` (integer): Upper market-cap bound of this layer, micro-USD.
    - `end_condition` (object): Per-layer budget and lifetime; falls back to the session's.
      - `amount` (integer | string): Budget of this layer, raw token units.
      - `time` (integer): Lifetime of this layer, in seconds.
- `McapLadder` (array<object>): Market-cap ladder. Each step sells once when the market cap reaches `target_mcap`. Targets must be strictly increasing and amounts greater than 0.
  - `target_mcap` (integer): Market cap that fires the step, micro-USD.
  - `sell_amount` (integer | string): Tokens to sell at this step, raw units.

```json
{
  "TimedExactIn": {
    "layers": [
      {
        "min_amount": "1500000000000",
        "max_amount": "4000000000000",
        "delay": 45000,
        "min_mcap": 120000000000,
        "end_condition": {
          "amount": "60000000000000",
          "time": 21600
        }
      }
    ]
  }
}
```

### Plan an Auto Sell session

`POST /launch/autosell/plan/{launch_id}`

Saves an Auto Sell session as `Planned` so that it starts with the launch. (Bearer JWT)

- Token: Upgraded session token, bound to a license.
- Read-only tokens: refused with `403 read_only_token`.
- Retry: Safe to retry. Planning again overwrites the parameters of the `Planned` session. Once the session runs, a repeat answers `409`.

Replaces a previously planned session. Refused while a session is running or paused. Sell ladder targets must be strictly increasing, and layer market-cap ranges must not overlap.

#### Path parameters

- `launch_id` (string, required): Launch ID: the 15-digit chain-encoded ID. Its first three digits name the chain (`101` Solana, `201` BSC, `202` Base, `204` Ethereum).

#### Body parameters

- `mode` (object, optional): A single strategy, shaped like the [Auto sell mode](#object-auto-sell-mode) object. Send `mode` or `modes`.
- `modes` (array<object>, optional): Several strategies run together, each shaped like the [Auto sell mode](#object-auto-sell-mode) object. The web app sends this form.
- `end_condition` (object, required): Session-wide limits.
  - `time` (integer, required): Session duration in seconds; `0` uses the maximum of 30 days.
  - `amount` (integer | string, required): Tokens the session may sell, raw units. `0` means no limit.
- `slippage` (integer, optional): Slippage tolerance in basis points, at most 10000. Defaults to 10000 on Solana.
- `min_mcap` (integer | null, optional): Ignored: neither chain applies a session-wide lower bound, although the web app sends it when set. Set `min_mcap` on each layer instead.
- `max_mcap` (integer | null, optional): Ignored, like `min_mcap`. Set `max_mcap` on each layer instead.
- `start_delay` (integer, optional): Seconds to wait before the first trade, at most 30 days.
- `wallet_pubkeys` (array<string> | null, optional): Launch wallets that trade. Omit or send `null` for all of them; an empty array is rejected.

#### Returns 200 OK

Returns `ok` and a confirmation `message`.

- `ok` (boolean): Always `true` on success.
- `message` (string): Human-readable confirmation.

#### Errors

| Status | Code | Message | When | What to do |
| --- | --- | --- | --- | --- |
| 400 | `bad_request` | `invalid launch id format` | `launch_id` is not a chain-encoded launch ID. | Pass the 15-digit chain-encoded launch ID exactly as the API returned it. |
| 404 | `not_found` | `launch not found` | No launch with this ID belongs to the license in your token. | Check the launch ID and that your token is upgraded onto the license that owns the launch. |
| 400 | `bad_request` | `wallet_pubkeys cannot be empty` | Solana: `wallet_pubkeys` is an empty array. | Omit `wallet_pubkeys` to trade from every launch wallet. |
| 400 | `bad_request` | `Invalid pubkey` | Solana: an entry of `wallet_pubkeys` is not a valid address. | Send the base58 addresses of the launch's wallets. |
| 404 | `not_found` | `Wallet not found in launch` | Solana: an entry of `wallet_pubkeys` is not a wallet of this launch. | Send only addresses of the launch's own wallets, as listed by [Retrieve a launch](/reference/launches/#retrieve-launch). |
| 409 | `conflict` | `Task already running` | A session for this launch is `Running` or `Paused`. | Change the live session with [Update an Auto Sell session](/reference/auto-sell/#update-auto-sell), or cancel it with [Cancel an Auto Sell session](/reference/auto-sell/#cancel-auto-sell) before planning again. |
| 422 | `unprocessable` | `No wallets available` | No wallet is left to trade: the launch has no wallets, or (EVM) `wallet_pubkeys` is empty or names none of them. | Omit `wallet_pubkeys` to use every launch wallet, or add wallets with [Add wallets to a launch](/reference/launches/#add-launch-wallets). |
| 500 | `internal_error` | `No selling mode provided` | The parameters fail validation; `message` names the rule, e.g. `Invalid delay`, `Too many timed layers`, `Swapback layer mcap ranges must not overlap`, `Invalid levels array (must be ascending mcap)` or `Slippage must be <= 10000 bps`. On a multi-launch container the same messages come back as `400 bad_request`. | Fix the parameter named in `message` within the limits listed on [Auto sell mode](/reference/auto-sell/#object-auto-sell-mode). |
| 400 | `bad_request` | `launch group plan can only be edited while draft` | `launch_id` is a multi-launch group container whose plan is no longer a draft. | Plan the session on the winning member launch instead. |
| 500 | `internal_error` | `No launch data saved` | Solana: the launch has no funder, holder or MEV wallets saved yet. | Finish the plan with [Update the launch plan](/reference/launches/#update-launch-plan) and [Set the launch funder](/reference/launches/#set-launch-funder), then retry. |
| 400 | `bad_request` | `No funder wallet configured` | EVM: the launch plan is incomplete; `message` names the missing part, e.g. `No launch method saved`, `No mev wallets saved`, `No holder wallets saved` or `No holder amounts saved`. | Finish the plan with [Update the launch plan](/reference/launches/#update-launch-plan) and [Set the launch funder](/reference/launches/#set-launch-funder), then retry. |
| 400 | `bad_request` | `invalid body: <path>: <cause>` | The body is not valid JSON, or a field is missing or has the wrong type. | Fix the field named in `message` and send the request again. |

#### Example request

```bash
curl -X POST "https://api-mig.proxima.tools/launch/autosell/plan/101000000004217" \
  -H "Authorization: Bearer $PROXIMA_JWT" \
  -H "Content-Type: application/json" \
  -d '{
  "modes": [
    {
      "TimedExactIn": {
        "layers": [
          {
            "min_amount": "1500000000000",
            "max_amount": "4000000000000",
            "delay": 45000,
            "min_mcap": 120000000000,
            "end_condition": {
              "amount": "60000000000000",
              "time": 21600
            }
          }
        ]
      }
    },
    {
      "McapLadder": [
        {
          "target_mcap": 150000000000,
          "sell_amount": "20000000000000"
        },
        {
          "target_mcap": 300000000000,
          "sell_amount": "40000000000000"
        }
      ]
    }
  ],
  "end_condition": {
    "time": 0,
    "amount": "0"
  },
  "slippage": 1500,
  "start_delay": 300,
  "wallet_pubkeys": null
}'
```

#### Example response

```json
{
  "ok": true,
  "message": "Successfully planned auto selling task"
}
```

### Start an Auto Sell session

`POST /launch/autosell/run/{launch_id}`

Starts an Auto Sell session right away on a launched token. (Bearer JWT)

- Token: Upgraded session token, bound to a license.
- Read-only tokens: refused with `403 read_only_token`.
- Retry: Check before retrying. Read [Retrieve Auto Sell status](/reference/auto-sell/#get-auto-sell-status) first: `Running` or `Paused` means the first call went through, and a repeat answers `409` while the session lasts.

Refused while a session is running or paused. If a session is `Planned` for the launch, it starts with the planned parameters and the body is ignored.

> Trades from the launch wallets until the session ends, is paused or is cancelled.

#### Path parameters

- `launch_id` (string, required): Launch ID: the 15-digit chain-encoded ID. Its first three digits name the chain (`101` Solana, `201` BSC, `202` Base, `204` Ethereum).

#### Body parameters

- `mode` (object, optional): A single strategy, shaped like the [Auto sell mode](#object-auto-sell-mode) object. Send `mode` or `modes`.
- `modes` (array<object>, optional): Several strategies run together, each shaped like the [Auto sell mode](#object-auto-sell-mode) object. The web app sends this form.
- `end_condition` (object, required): Session-wide limits.
  - `time` (integer, required): Session duration in seconds; `0` uses the maximum of 30 days.
  - `amount` (integer | string, required): Tokens the session may sell, raw units. `0` means no limit.
- `slippage` (integer, optional): Slippage tolerance in basis points, at most 10000. Defaults to 10000 on Solana.
- `min_mcap` (integer | null, optional): Ignored: neither chain applies a session-wide lower bound, although the web app sends it when set. Set `min_mcap` on each layer instead.
- `max_mcap` (integer | null, optional): Ignored, like `min_mcap`. Set `max_mcap` on each layer instead.
- `start_delay` (integer, optional): Seconds to wait before the first trade, at most 30 days.
- `wallet_pubkeys` (array<string> | null, optional): Launch wallets that trade. Omit or send `null` for all of them; an empty array is rejected.

#### Returns 200 OK

Returns `ok` and a confirmation `message`.

- `ok` (boolean): Always `true` on success.
- `message` (string): Human-readable confirmation.

#### Errors

| Status | Code | Message | When | What to do |
| --- | --- | --- | --- | --- |
| 400 | `bad_request` | `invalid launch id format` | `launch_id` is not a chain-encoded launch ID. | Pass the 15-digit chain-encoded launch ID exactly as the API returned it. |
| 404 | `not_found` | `launch not found` | No launch with this ID belongs to the license in your token. | Check the launch ID and that your token is upgraded onto the license that owns the launch. |
| 400 | `bad_request` | `wallet_pubkeys cannot be empty` | Solana: `wallet_pubkeys` is an empty array. | Omit `wallet_pubkeys` to trade from every launch wallet. |
| 400 | `bad_request` | `Invalid pubkey` | Solana: an entry of `wallet_pubkeys` is not a valid address. | Send the base58 addresses of the launch's wallets. |
| 404 | `not_found` | `Wallet not found in launch` | Solana: an entry of `wallet_pubkeys` is not a wallet of this launch. | Send only addresses of the launch's own wallets, as listed by [Retrieve a launch](/reference/launches/#retrieve-launch). |
| 400 | `bad_request` | `multi-launch container: not available here; use the winner launch once it resolves` | `launch_id` is a multi-launch group container; sessions run on the winning member launch. | Call it with the winning member's launch ID once the group resolves. |
| 500 | `internal_error` | `Token not launched` | Solana: the launch is still a draft. | Launch the token with [Launch a token](/reference/launch-execution/#launch) first, or save the session with [Plan an Auto Sell session](/reference/auto-sell/#plan-auto-sell) so it starts with the launch. |
| 400 | `bad_request` | `token not launched` | EVM: the launch is still a draft. Imported tokens are accepted. | Launch the token with [Launch a token](/reference/launch-execution/#launch) first, or save the session with [Plan an Auto Sell session](/reference/auto-sell/#plan-auto-sell) so it starts with the launch. |
| 409 | `conflict` | `Task already running` | A session for this launch is already `Running` or `Paused`. | Change the running session with [Update an Auto Sell session](/reference/auto-sell/#update-auto-sell) instead of starting another. |
| 400 | `bad_request` | `No wallets available for autosell` | EVM: no wallet can trade, because `wallet_pubkeys` is an empty array or the launch holds no wallets. | Omit `wallet_pubkeys` to trade from every launch wallet. |
| 500 | `internal_error` | `wallet_pubkeys provided but none matched launch wallets` | EVM: none of `wallet_pubkeys` is a wallet of this launch. | Send only addresses of the launch's own wallets, as listed by [Retrieve a launch](/reference/launches/#retrieve-launch). |
| 500 | `internal_error` | `No selling mode provided` | The parameters fail validation; `message` names the rule, e.g. `Invalid delay`, `Too many timed layers`, `Swapback layer mcap ranges must not overlap`, `Invalid levels array (must be ascending mcap)` or `Slippage must be <= 10000 bps`. When a session is `Planned`, its saved parameters are checked instead of the body. | Fix the parameter named in `message` within the limits listed on [Auto sell mode](/reference/auto-sell/#object-auto-sell-mode). |
| 500 | `internal_error` | `No launch data saved` | Solana: the launch has no funder, holder or MEV wallets saved yet. | Finish the plan with [Update the launch plan](/reference/launches/#update-launch-plan) and [Set the launch funder](/reference/launches/#set-launch-funder), then retry. |
| 400 | `bad_request` | `No funder wallet configured` | EVM: the launch plan is incomplete; `message` names the missing part, e.g. `No launch method saved`, `No mev wallets saved`, `No holder wallets saved` or `No holder amounts saved`. | Finish the plan with [Update the launch plan](/reference/launches/#update-launch-plan) and [Set the launch funder](/reference/launches/#set-launch-funder), then retry. |
| 500 | `internal_error` | `the launch quote carries no price` | Solana: the price of the launch's quote token is not known yet, so the engine cannot start. | Send the request again in a few seconds. |
| 422 | `venue_ungated` | `the launchpad holds no record of this token` | EVM: replication layers or market-cap bounds need a known pool for the token and none is recorded; `message` names what is missing. | Use timed layers without market-cap bounds, or retry once the pool is recorded. |
| 409 | `conflict` | `pace already trades this launch in this direction` | The launch trades on the pace engine, which already runs an Auto Sell session for it. | Change that session with [Update an Auto Sell session](/reference/auto-sell/#update-auto-sell) or cancel it with [Cancel an Auto Sell session](/reference/auto-sell/#cancel-auto-sell). |
| 422 | `unprocessable` | `a MinSol trigger is only valid when the launch's quote is native` | The launch's platform trades on the pace engine and a rule has no pace equivalent; `message` names it, e.g. a `Rate` trigger, a `MinSol` trigger on a non-native quote, or a replication layer with no amount to stop at. | Change the rule named in `message` and send the request again. |
| 503 | `pace_unavailable` | `the execution engine is unavailable, nothing was armed` | The launch's platform trades on the pace engine and pace could not be reached. | Send the request again after a short wait. |
| 400 | `bad_request` | `invalid body: <path>: <cause>` | The body is not valid JSON, or a field is missing or has the wrong type. | Fix the field named in `message` and send the request again. |

#### Example request

```bash
curl -X POST "https://api-mig.proxima.tools/launch/autosell/run/101000000004217" \
  -H "Authorization: Bearer $PROXIMA_JWT" \
  -H "Content-Type: application/json" \
  -d '{
  "modes": [
    {
      "TimedExactIn": {
        "layers": [
          {
            "min_amount": "1500000000000",
            "max_amount": "4000000000000",
            "delay": 45000,
            "min_mcap": 120000000000,
            "end_condition": {
              "amount": "60000000000000",
              "time": 21600
            }
          }
        ]
      }
    },
    {
      "McapLadder": [
        {
          "target_mcap": 150000000000,
          "sell_amount": "20000000000000"
        },
        {
          "target_mcap": 300000000000,
          "sell_amount": "40000000000000"
        }
      ]
    }
  ],
  "end_condition": {
    "time": 0,
    "amount": "0"
  },
  "slippage": 1500,
  "start_delay": 300,
  "wallet_pubkeys": null
}'
```

#### Example response

```json
{
  "ok": true,
  "message": "Successfully started auto selling task"
}
```

### Update an Auto Sell session

`POST /launch/autosell/update/{launch_id}`

Replaces the parameters of a planned, running or paused Auto Sell session. (Bearer JWT)

- Token: Upgraded session token, bound to a license.
- Read-only tokens: refused with `403 read_only_token`.
- Retry: Safe to retry. Layers are matched by ID and keep their progress, so sending the same parameters again changes nothing.

On a live session, layers whose IDs survive the update keep their progress.

> On Solana the response also carries `wallet_set_unchanged` and `wallets_added`, which the web app does not read. EVM answers with `ok` and `message` only.

#### Path parameters

- `launch_id` (string, required): Launch ID: the 15-digit chain-encoded ID. Its first three digits name the chain (`101` Solana, `201` BSC, `202` Base, `204` Ethereum).

#### Body parameters

- `mode` (object, optional): A single strategy, shaped like the [Auto sell mode](#object-auto-sell-mode) object. Send `mode` or `modes`.
- `modes` (array<object>, optional): Several strategies run together, each shaped like the [Auto sell mode](#object-auto-sell-mode) object. The web app sends this form.
- `end_condition` (object, required): Session-wide limits.
  - `time` (integer, required): Session duration in seconds; `0` uses the maximum of 30 days.
  - `amount` (integer | string, required): Tokens the session may sell, raw units. `0` means no limit.
- `slippage` (integer, optional): Slippage tolerance in basis points, at most 10000. Defaults to 10000 on Solana.
- `min_mcap` (integer | null, optional): Ignored: neither chain applies a session-wide lower bound, although the web app sends it when set. Set `min_mcap` on each layer instead.
- `max_mcap` (integer | null, optional): Ignored, like `min_mcap`. Set `max_mcap` on each layer instead.
- `start_delay` (integer, optional): Seconds to wait before the first trade, at most 30 days.
- `wallet_pubkeys` (array<string> | null, optional): Launch wallets that trade. Omit or send `null` for all of them; an empty array is rejected.

#### Returns 200 OK

Returns `ok` and a confirmation `message`.

- `ok` (boolean): Always `true` on success.
- `message` (string): Human-readable confirmation.

#### Errors

| Status | Code | Message | When | What to do |
| --- | --- | --- | --- | --- |
| 400 | `bad_request` | `invalid launch id format` | `launch_id` is not a chain-encoded launch ID. | Pass the 15-digit chain-encoded launch ID exactly as the API returned it. |
| 404 | `not_found` | `launch not found` | No launch with this ID belongs to the license in your token. | Check the launch ID and that your token is upgraded onto the license that owns the launch. |
| 400 | `bad_request` | `Invalid pubkey in wallet_pubkeys` | Solana: an entry of `wallet_pubkeys` is not a valid address. | Send the base58 addresses of the launch's wallets. |
| 404 | `not_found` | `No MM engine running for this launch` | Solana: the session is `Running` or `Paused` but its engine is gone, for example after a restart. | Cancel the session with [Cancel an Auto Sell session](/reference/auto-sell/#cancel-auto-sell) and start a new one with [Start an Auto Sell session](/reference/auto-sell/#run-auto-sell). |
| 409 | `conflict` | `Autosell session is not running or planned` | The session is not `Planned`, `Running` or `Paused`. | Start a session with [Start an Auto Sell session](/reference/auto-sell/#run-auto-sell) or plan one with [Plan an Auto Sell session](/reference/auto-sell/#plan-auto-sell). |
| 400 | `bad_request` | `multi-launch container: sessions run on the winner launch once it resolves` | `launch_id` is a multi-launch group container; sessions run on the winning member launch. | Call it with the winning member's launch ID once the group resolves. |
| 404 | `not_found` | `No autosell session found` | EVM: the launch has no session to update. | Start a session with [Start an Auto Sell session](/reference/auto-sell/#run-auto-sell) or plan one with [Plan an Auto Sell session](/reference/auto-sell/#plan-auto-sell). |
| 500 | `internal_error` | `No autosell session found` | Solana: the launch has no session to update. | Start a session with [Start an Auto Sell session](/reference/auto-sell/#run-auto-sell) or plan one with [Plan an Auto Sell session](/reference/auto-sell/#plan-auto-sell). |
| 400 | `bad_request` | `No selling mode provided` | The parameters fail validation; `message` names the rule, e.g. `Invalid delay`, `Too many timed layers`, `Swapback layer mcap ranges must not overlap`, `Invalid levels array (must be ascending mcap)` or `Slippage must be <= 10000 bps`. | Fix the parameter named in `message` within the limits listed on [Auto sell mode](/reference/auto-sell/#object-auto-sell-mode). |
| 400 | `bad_request` | `wallet_pubkeys contains wallets that cannot trade this launch` | Solana: an entry of `wallet_pubkeys` is not a wallet that can trade this launch. | Send only addresses of the launch's own wallets, as listed by [Retrieve a launch](/reference/launches/#retrieve-launch). |
| 400 | `bad_request` | `wallet_pubkeys provided but none matched launch wallets` | EVM: none of `wallet_pubkeys` is a wallet of this launch. | Send only addresses of the launch's own wallets, as listed by [Retrieve a launch](/reference/launches/#retrieve-launch). |
| 400 | `bad_request` | `No wallets available for autosell` | EVM: `wallet_pubkeys` is an empty array. | Omit `wallet_pubkeys` to keep the current wallets. |
| 404 | `not_found` | `No engine running for this launch` | EVM: the session is `Running` or `Paused` but its engine is gone, for example after a restart. | Cancel the session with [Cancel an Auto Sell session](/reference/auto-sell/#cancel-auto-sell) and start a new one with [Start an Auto Sell session](/reference/auto-sell/#run-auto-sell). |
| 422 | `unprocessable` | `a MinSol trigger is only valid when the launch's quote is native` | The launch's platform trades on the pace engine and a rule has no pace equivalent; `message` names it, e.g. a `Rate` trigger, a `MinSol` trigger on a non-native quote, or a replication layer with no amount to stop at. | Change the rule named in `message` and send the request again. |
| 404 | `not_found` | `pace no longer trades this launch` | The launch trades on the pace engine and pace no longer runs a session for it. | Start a new session with [Start an Auto Sell session](/reference/auto-sell/#run-auto-sell). |
| 404 | `not_found` | `pace no longer holds this session` | The launch trades on the pace engine and pace no longer holds the session. | Start a new session with [Start an Auto Sell session](/reference/auto-sell/#run-auto-sell). |
| 409 | `conflict` | `pace already moved this session` | The launch trades on the pace engine and pace already moved the session to another state. | Read [Retrieve Auto Sell status](/reference/auto-sell/#get-auto-sell-status) for the current state before acting again. |
| 503 | `pace_unavailable` | `the execution engine is unavailable, nothing was armed` | The launch's platform trades on the pace engine and pace could not be reached. | Send the request again after a short wait. |
| 400 | `bad_request` | `invalid body: <path>: <cause>` | The body is not valid JSON, or a field is missing or has the wrong type. | Fix the field named in `message` and send the request again. |

#### Example request

```bash
curl -X POST "https://api-mig.proxima.tools/launch/autosell/update/101000000004217" \
  -H "Authorization: Bearer $PROXIMA_JWT" \
  -H "Content-Type: application/json" \
  -d '{
  "modes": [
    {
      "TimedExactIn": {
        "layers": [
          {
            "min_amount": "1500000000000",
            "max_amount": "4000000000000",
            "delay": 45000,
            "min_mcap": 120000000000,
            "end_condition": {
              "amount": "60000000000000",
              "time": 21600
            }
          }
        ]
      }
    },
    {
      "McapLadder": [
        {
          "target_mcap": 150000000000,
          "sell_amount": "20000000000000"
        },
        {
          "target_mcap": 300000000000,
          "sell_amount": "40000000000000"
        }
      ]
    }
  ],
  "end_condition": {
    "time": 0,
    "amount": "0"
  },
  "slippage": 1500,
  "start_delay": 300,
  "wallet_pubkeys": null
}'
```

#### Example response

```json
{
  "ok": true,
  "message": "Auto sell params updated"
}
```

### Retrieve Auto Sell status

`GET /launch/autosell/status/{launch_id}`

Returns the launch's Auto Sell session, its totals and per-layer progress. (Bearer JWT)

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

> The web client normalizes this payload (`normalizeAutoSellStatus`): lowercase statuses become PascalCase, EVM totals are mapped onto the `auto_sell_*` names, `engine` layers become `modes`, and amounts are parsed to numbers.

#### Path parameters

- `launch_id` (string, required): Launch ID: the 15-digit chain-encoded ID. Its first three digits name the chain (`101` Solana, `201` BSC, `202` Base, `204` Ethereum).

#### Returns 200 OK

Returns an Auto sell status object.

- `status` (enum): Session state. Possible values: `None`, `Planned`, `Running`, `Paused`, `Completed`, `Cancelled`, `Failed`.
- `info` (object): Session details. Absent when `status` is `None`.
  - `params` (object): The session parameters as stored: the body of the last plan, run or update call.
  - `started_at` (integer | null): Unix timestamp (seconds) the session started.
  - `ended_at` (integer | null): Unix timestamp (seconds) the session ended.
  - `status_reason` (string | null): Why the session ended or failed, when known.
  - `auto_sell_native_profit` (integer): Solana: native received by the session, raw units. Can be negative.
  - `auto_sell_usd_profit` (integer): Solana: USD received, micro-USD. Can be negative.
  - `auto_sell_token_sold` (integer): Solana: tokens sold, raw units.
  - `modes` (array<object>): Solana: progress per mode.
    - `id` (enum): Mode. Possible values: `replication`, `timed`, `mcap_ladder`.
    - `accumulated` (integer): Replication only: amount accumulated toward the next trade, summed over layers.
    - `layers` (array<object>): Progress per layer.
      - `id` (string): Layer ID: `as_4217_l0` for timed and replication layers, `as_4217_0` for market-cap ladder steps. Pass it as `layer_id` to cancel, pause or resume one layer.
      - `state` (enum): Layer state. The client also accepts lowercase values. Possible values: `Active`, `Paused`, `Exhausted`.
      - `token_sold` (integer): Tokens this layer has sold, raw units. The field keeps this name on both sides.
      - `sol_spent` (integer): Native or quote amount this layer has traded, raw units.
  - `token_sold` (string): EVM: tokens sold, raw units, as a decimal string.
  - `native_profit` (string): EVM: native received, wei, as a decimal string.
  - `usd_profit` (integer): EVM: USD received, micro-USD.
  - `engine` (object | null): EVM: live engine snapshot.
    - `cached_mcap_usd` (number): Market cap the engine last read, USD.
    - `swapback_layers` (array<object>): Replication layers.
      - `id` (string): Layer ID.
      - `state` (string): Layer state.
      - `accumulated` (integer | string): Amount accumulated toward the next trade.
      - `token_sold` (integer | string): Tokens sold by the layer, raw units.
      - `native_profit` (integer | string): Native received by the layer, wei.
    - `timed_layers` (array<object>): Timed layers.
      - `id` (string): Layer ID.
      - `state` (string): Layer state.
      - `accumulated` (integer | string): Amount accumulated toward the next trade.
      - `token_sold` (integer | string): Tokens sold by the layer, raw units.
      - `native_profit` (integer | string): Native received by the layer, wei.
    - `mcap_levels` (array<object>): Ladder steps: the layer fields plus `target_mcap_usd` and `sell_amount`.

#### Errors

| Status | Code | Message | When | What to do |
| --- | --- | --- | --- | --- |
| 400 | `bad_request` | `invalid launch id format` | `launch_id` is not a chain-encoded launch ID. | Pass the 15-digit chain-encoded launch ID exactly as the API returned it. |
| 404 | `not_found` | `launch not found` | No launch with this ID belongs to the license in your token. | Check the launch ID and that your token is upgraded onto the license that owns the launch. |
| 400 | `bad_request` | `multi-launch container: sessions run on the winner launch once it resolves` | `launch_id` is a multi-launch group container; sessions run on the winning member launch. | Call it with the winning member's launch ID once the group resolves. |

#### Example request

```bash
curl "https://api-mig.proxima.tools/launch/autosell/status/101000000004217" \
  -H "Authorization: Bearer $PROXIMA_JWT"
```

#### Example response

```json
{
  "status": "Running",
  "info": {
    "params": {
      "modes": [
        {
          "TimedExactIn": {
            "layers": [
              {
                "min_amount": "1500000000000",
                "max_amount": "4000000000000",
                "delay": 45000,
                "min_mcap": 120000000000,
                "end_condition": {
                  "amount": "60000000000000",
                  "time": 21600
                }
              }
            ]
          }
        },
        {
          "McapLadder": [
            {
              "target_mcap": 150000000000,
              "sell_amount": "20000000000000"
            },
            {
              "target_mcap": 300000000000,
              "sell_amount": "40000000000000"
            }
          ]
        }
      ],
      "end_condition": {
        "time": 0,
        "amount": "0"
      },
      "slippage": 1500,
      "start_delay": 300,
      "wallet_pubkeys": null
    },
    "started_at": 1793655010,
    "ended_at": null,
    "status_reason": null,
    "auto_sell_native_profit": 2875000000,
    "auto_sell_usd_profit": 539060000,
    "auto_sell_token_sold": 26500000000000,
    "modes": [
      {
        "id": "timed",
        "layers": [
          {
            "id": "as_4217_l0",
            "state": "Active",
            "token_sold": 6500000000000,
            "sol_spent": 655000000
          }
        ]
      },
      {
        "id": "mcap_ladder",
        "layers": [
          {
            "id": "as_4217_0",
            "state": "Exhausted",
            "token_sold": 20000000000000,
            "sol_spent": 2220000000
          },
          {
            "id": "as_4217_1",
            "state": "Active",
            "token_sold": 0,
            "sol_spent": 0
          }
        ]
      }
    ]
  }
}
```

### Cancel an Auto Sell session

`POST /launch/autosell/cancel/{launch_id}`

Cancels the whole Auto Sell session, one mode, or one layer. (Bearer JWT)

- Token: Upgraded session token, bound to a license.
- Read-only tokens: refused with `403 read_only_token`.
- Retry: Safe to retry. A cancel with no body answers `200` in any state, so repeating it changes nothing.

Send `layer_id` or `mode` to cancel part of the session; send no body to cancel all of it.

#### Path parameters

- `launch_id` (string, required): Launch ID: the 15-digit chain-encoded ID. Its first three digits name the chain (`101` Solana, `201` BSC, `202` Base, `204` Ethereum).

#### Body parameters

- `layer_id` (string, optional): Target one layer, e.g. `as_4217_l0` (from `modes[].layers[].id` in the status).
- `mode` (enum, optional): Target every layer of one mode. Possible values: `replication`, `timed`, `mcap_ladder`.

#### Returns 200 OK

Returns `ok` and a `message` (`Layer cancelled` when one layer was targeted).

- `ok` (boolean): Always `true` on success.
- `message` (string): Human-readable confirmation.

#### Errors

| Status | Code | Message | When | What to do |
| --- | --- | --- | --- | --- |
| 400 | `bad_request` | `invalid launch id format` | `launch_id` is not a chain-encoded launch ID. | Pass the 15-digit chain-encoded launch ID exactly as the API returned it. |
| 404 | `not_found` | `launch not found` | No launch with this ID belongs to the license in your token. | Check the launch ID and that your token is upgraded onto the license that owns the launch. |
| 400 | `bad_request` | `Invalid layer_id for this launch` | Solana: `layer_id` lacks the prefix of this launch's Auto Sell layer IDs. EVM accepts any value and changes nothing. | Pass a layer `id` from `modes[].layers[]` in [Retrieve Auto Sell status](/reference/auto-sell/#get-auto-sell-status). |
| 400 | `bad_request` | `Invalid mode: must be replication, timed, or mcap_ladder` | Solana: `mode` is not `replication`, `timed` or `mcap_ladder`, checked only while the engine runs. EVM accepts any value and changes nothing. | Send `replication`, `timed` or `mcap_ladder`. |
| 409 | `conflict` | `Autosell session is not running` | `layer_id` or `mode` was sent and the session is not `Running`. A cancel with no body works in any state. | Send no body to cancel the whole session. |
| 400 | `bad_request` | `multi-launch container: sessions run on the winner launch once it resolves` | `launch_id` is a multi-launch group container; sessions run on the winning member launch. | Call it with the winning member's launch ID once the group resolves. |
| 404 | `not_found` | `No autosell session found` | EVM: `layer_id` or `mode` was sent and the launch has no Auto Sell session. | Send no body to clear the session state. |
| 500 | `internal_error` | `No autosell session found` | Solana: `layer_id` or `mode` was sent and the launch has no Auto Sell session. | Send no body to clear the session state. |
| 422 | `unprocessable` | `a launch on pace cancels whole sessions, not layers` | The launch trades on the pace engine, which cancels whole sessions only, and `layer_id` or `mode` was sent. | Send no `layer_id` or `mode` to cancel the whole session. |
| 503 | `pace_unavailable` | `the execution engine is unavailable, nothing was armed` | The launch's platform trades on the pace engine and pace could not be reached. | Send the request again after a short wait. |
| 400 | `bad_request` | `invalid body: <path>: <cause>` | The body is not valid JSON, or a field is missing or has the wrong type. | Fix the field named in `message` and send the request again. |

#### Example request

```bash
curl -X POST "https://api-mig.proxima.tools/launch/autosell/cancel/101000000004217" \
  -H "Authorization: Bearer $PROXIMA_JWT" \
  -H "Content-Type: application/json" \
  -d '{
  "mode": "timed"
}'
```

#### Example response

```json
{
  "ok": true,
  "message": "Auto sell task successfully cancelled"
}
```

### Pause an Auto Sell session

`POST /launch/autosell/pause/{launch_id}`

Pauses the whole Auto Sell session, one mode, or one layer. (Bearer JWT)

- Token: Upgraded session token, bound to a license.
- Read-only tokens: refused with `403 read_only_token`.
- Retry: Safe to retry. Once the session is `Paused`, a repeat answers `409` and changes nothing.

Send `layer_id` or `mode` to pause part of the session; the client sends `{}` to pause all of it.

#### Path parameters

- `launch_id` (string, required): Launch ID: the 15-digit chain-encoded ID. Its first three digits name the chain (`101` Solana, `201` BSC, `202` Base, `204` Ethereum).

#### Body parameters

- `layer_id` (string, optional): Target one layer, e.g. `as_4217_l0` (from `modes[].layers[].id` in the status).
- `mode` (enum, optional): Target every layer of one mode. Possible values: `replication`, `timed`, `mcap_ladder`.

#### Returns 200 OK

Returns `ok` and a `message` (`Layer paused` when one layer was targeted).

- `ok` (boolean): Always `true` on success.
- `message` (string): Human-readable confirmation.

#### Errors

| Status | Code | Message | When | What to do |
| --- | --- | --- | --- | --- |
| 400 | `bad_request` | `invalid launch id format` | `launch_id` is not a chain-encoded launch ID. | Pass the 15-digit chain-encoded launch ID exactly as the API returned it. |
| 404 | `not_found` | `launch not found` | No launch with this ID belongs to the license in your token. | Check the launch ID and that your token is upgraded onto the license that owns the launch. |
| 400 | `bad_request` | `Invalid layer_id for this launch` | Solana: `layer_id` lacks the prefix of this launch's Auto Sell layer IDs. EVM accepts any value and changes nothing. | Pass a layer `id` from `modes[].layers[]` in [Retrieve Auto Sell status](/reference/auto-sell/#get-auto-sell-status). |
| 400 | `bad_request` | `Invalid mode: must be replication, timed, or mcap_ladder` | Solana: `mode` is not `replication`, `timed` or `mcap_ladder`. EVM accepts any value and changes nothing. | Send `replication`, `timed` or `mcap_ladder`. |
| 404 | `not_found` | `No MM engine running for this launch` | Solana: the session is `Running` or `Paused` but its engine is gone, for example after a restart. | Cancel the session with [Cancel an Auto Sell session](/reference/auto-sell/#cancel-auto-sell) and start a new one with [Start an Auto Sell session](/reference/auto-sell/#run-auto-sell). |
| 409 | `conflict` | `Autosell session is not running` | The session is not `Running`, for example because it is already `Paused`. | Read [Retrieve Auto Sell status](/reference/auto-sell/#get-auto-sell-status), and resume a paused session with [Resume an Auto Sell session](/reference/auto-sell/#resume-auto-sell). |
| 400 | `bad_request` | `multi-launch container: sessions run on the winner launch once it resolves` | `launch_id` is a multi-launch group container; sessions run on the winning member launch. | Call it with the winning member's launch ID once the group resolves. |
| 404 | `not_found` | `No autosell session found` | EVM: the launch has no session to pause. | Start a session with [Start an Auto Sell session](/reference/auto-sell/#run-auto-sell) or plan one with [Plan an Auto Sell session](/reference/auto-sell/#plan-auto-sell). |
| 500 | `internal_error` | `No autosell session found` | Solana: the launch has no session to pause. | Start a session with [Start an Auto Sell session](/reference/auto-sell/#run-auto-sell) or plan one with [Plan an Auto Sell session](/reference/auto-sell/#plan-auto-sell). |
| 404 | `not_found` | `No engine running for this launch` | EVM: the session is `Running` or `Paused` but its engine is gone, for example after a restart. | Cancel the session with [Cancel an Auto Sell session](/reference/auto-sell/#cancel-auto-sell) and start a new one with [Start an Auto Sell session](/reference/auto-sell/#run-auto-sell). |
| 422 | `unprocessable` | `a launch on pace pauses whole sessions, not layers` | The launch trades on the pace engine, which pauses whole sessions only, and `layer_id` or `mode` was sent. | Send no `layer_id` or `mode` to pause the whole session. |
| 404 | `not_found` | `pace no longer holds this session` | The launch trades on the pace engine and pace no longer holds the session. | Start a new session with [Start an Auto Sell session](/reference/auto-sell/#run-auto-sell). |
| 409 | `conflict` | `pace already moved this session` | The launch trades on the pace engine and pace already moved the session to another state. | Read [Retrieve Auto Sell status](/reference/auto-sell/#get-auto-sell-status) for the current state before acting again. |
| 503 | `pace_unavailable` | `the execution engine is unavailable, nothing was armed` | The launch's platform trades on the pace engine and pace could not be reached. | Send the request again after a short wait. |
| 400 | `bad_request` | `invalid body: <path>: <cause>` | The body is not valid JSON, or a field is missing or has the wrong type. | Fix the field named in `message` and send the request again. |

#### Example request

```bash
curl -X POST "https://api-mig.proxima.tools/launch/autosell/pause/101000000004217" \
  -H "Authorization: Bearer $PROXIMA_JWT" \
  -H "Content-Type: application/json" \
  -d '{
  "mode": "timed"
}'
```

#### Example response

```json
{
  "ok": true,
  "message": "Auto sell paused"
}
```

### Resume an Auto Sell session

`POST /launch/autosell/resume/{launch_id}`

Resumes a paused Auto Sell session, mode, or layer. (Bearer JWT)

- Token: Upgraded session token, bound to a license.
- Read-only tokens: refused with `403 read_only_token`.
- Retry: Safe to retry. Resuming a session that already runs answers `200` and changes nothing.

Send `layer_id` or `mode` to resume part of the session; the client sends `{}` to resume all of it.

#### Path parameters

- `launch_id` (string, required): Launch ID: the 15-digit chain-encoded ID. Its first three digits name the chain (`101` Solana, `201` BSC, `202` Base, `204` Ethereum).

#### Body parameters

- `layer_id` (string, optional): Target one layer, e.g. `as_4217_l0` (from `modes[].layers[].id` in the status).
- `mode` (enum, optional): Target every layer of one mode. Possible values: `replication`, `timed`, `mcap_ladder`.

#### Returns 200 OK

Returns `ok` and a `message` (`Layer resumed` when one layer was targeted).

- `ok` (boolean): Always `true` on success.
- `message` (string): Human-readable confirmation.

#### Errors

| Status | Code | Message | When | What to do |
| --- | --- | --- | --- | --- |
| 400 | `bad_request` | `invalid launch id format` | `launch_id` is not a chain-encoded launch ID. | Pass the 15-digit chain-encoded launch ID exactly as the API returned it. |
| 404 | `not_found` | `launch not found` | No launch with this ID belongs to the license in your token. | Check the launch ID and that your token is upgraded onto the license that owns the launch. |
| 400 | `bad_request` | `Invalid layer_id for this launch` | Solana: `layer_id` lacks the prefix of this launch's Auto Sell layer IDs. EVM accepts any value and changes nothing. | Pass a layer `id` from `modes[].layers[]` in [Retrieve Auto Sell status](/reference/auto-sell/#get-auto-sell-status). |
| 400 | `bad_request` | `Invalid mode: must be replication, timed, or mcap_ladder` | Solana: `mode` is not `replication`, `timed` or `mcap_ladder`. EVM accepts any value and changes nothing. | Send `replication`, `timed` or `mcap_ladder`. |
| 404 | `not_found` | `No MM engine running for this launch` | Solana: the session is `Running` or `Paused` but its engine is gone, for example after a restart. | Cancel the session with [Cancel an Auto Sell session](/reference/auto-sell/#cancel-auto-sell) and start a new one with [Start an Auto Sell session](/reference/auto-sell/#run-auto-sell). |
| 409 | `conflict` | `Autosell session is not paused` | Solana: the session is neither `Paused` nor `Running`. | Start a new session with [Start an Auto Sell session](/reference/auto-sell/#run-auto-sell). |
| 400 | `bad_request` | `multi-launch container: sessions run on the winner launch once it resolves` | `launch_id` is a multi-launch group container; sessions run on the winning member launch. | Call it with the winning member's launch ID once the group resolves. |
| 409 | `conflict` | `Autosell session is not running or paused` | EVM: the session is neither `Paused` nor `Running`. | Start a new session with [Start an Auto Sell session](/reference/auto-sell/#run-auto-sell). |
| 404 | `not_found` | `No autosell session found` | EVM: the launch has no session to resume. | Start a session with [Start an Auto Sell session](/reference/auto-sell/#run-auto-sell) or plan one with [Plan an Auto Sell session](/reference/auto-sell/#plan-auto-sell). |
| 500 | `internal_error` | `No autosell session found` | Solana: the launch has no session to resume. | Start a session with [Start an Auto Sell session](/reference/auto-sell/#run-auto-sell) or plan one with [Plan an Auto Sell session](/reference/auto-sell/#plan-auto-sell). |
| 404 | `not_found` | `No engine running for this launch` | EVM: the session is `Running` or `Paused` but its engine is gone, for example after a restart. | Cancel the session with [Cancel an Auto Sell session](/reference/auto-sell/#cancel-auto-sell) and start a new one with [Start an Auto Sell session](/reference/auto-sell/#run-auto-sell). |
| 422 | `unprocessable` | `a launch on pace resumes whole sessions, not layers` | The launch trades on the pace engine, which resumes whole sessions only, and `layer_id` or `mode` was sent. | Send no `layer_id` or `mode` to resume the whole session. |
| 404 | `not_found` | `pace no longer holds this session` | The launch trades on the pace engine and pace no longer holds the session. | Start a new session with [Start an Auto Sell session](/reference/auto-sell/#run-auto-sell). |
| 409 | `conflict` | `pace already moved this session` | The launch trades on the pace engine and pace already moved the session to another state. | Read [Retrieve Auto Sell status](/reference/auto-sell/#get-auto-sell-status) for the current state before acting again. |
| 503 | `pace_unavailable` | `the execution engine is unavailable, nothing was armed` | The launch's platform trades on the pace engine and pace could not be reached. | Send the request again after a short wait. |
| 400 | `bad_request` | `invalid body: <path>: <cause>` | The body is not valid JSON, or a field is missing or has the wrong type. | Fix the field named in `message` and send the request again. |

#### Example request

```bash
curl -X POST "https://api-mig.proxima.tools/launch/autosell/resume/101000000004217" \
  -H "Authorization: Bearer $PROXIMA_JWT" \
  -H "Content-Type: application/json" \
  -d '{
  "layer_id": "as_4217_l0"
}'
```

#### Example response

```json
{
  "ok": true,
  "message": "Auto sell resumed"
}
```

### Discard an Auto Sell session

`POST /launch/autosell/discard/{launch_id}`

Clears a planned or finished Auto Sell session from the launch. (Bearer JWT)

- Token: Upgraded session token, bound to a license.
- Read-only tokens: refused with `403 read_only_token`.
- Retry: Safe to retry. Once the session state is cleared, a repeat answers `200` and changes nothing.

#### Path parameters

- `launch_id` (string, required): Launch ID: the 15-digit chain-encoded ID. Its first three digits name the chain (`101` Solana, `201` BSC, `202` Base, `204` Ethereum).

#### Returns 200 OK

Returns `ok` and a confirmation `message`.

- `ok` (boolean): Always `true` on success.
- `message` (string): Human-readable confirmation.

#### Errors

| Status | Code | Message | When | What to do |
| --- | --- | --- | --- | --- |
| 400 | `bad_request` | `invalid launch id format` | `launch_id` is not a chain-encoded launch ID. | Pass the 15-digit chain-encoded launch ID exactly as the API returned it. |
| 404 | `not_found` | `launch not found` | No launch with this ID belongs to the license in your token. | Check the launch ID and that your token is upgraded onto the license that owns the launch. |
| 409 | `conflict` | `Cannot discard running session` | Solana: the session is `Running` or `Paused`. EVM answers `200` and keeps the live session. | Stop the session with [Cancel an Auto Sell session](/reference/auto-sell/#cancel-auto-sell) first. |
| 400 | `bad_request` | `multi-launch container: sessions run on the winner launch once it resolves` | `launch_id` is a multi-launch group container; sessions run on the winning member launch. | Call it with the winning member's launch ID once the group resolves. |

#### Example request

```bash
curl -X POST "https://api-mig.proxima.tools/launch/autosell/discard/101000000004217" \
  -H "Authorization: Bearer $PROXIMA_JWT"
```

#### Example response

```json
{
  "ok": true,
  "message": "Successfully discarded auto sell session status"
}
```
