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

# Overview

> How the Vanish Core API wraps your instructions, and the rules that apply to every flow.

**Base URL:** `https://core-api.vanish.trade`

**SOL Native Address:** `11111111111111111111111111111111`

**Authentication:** All endpoints require an `x-api-key` header. Every endpoint except the two commit endpoints also requires a signed message - see [Signing](/guide/integration/signing).

The Vanish Core injection process adds approximately **200ms** to finality. Your instructions are injected into Vanish's transaction wrapper, keeping you in full control over route, slippage, and execution.

***

## How It Works

When a trade or a lending action is submitted, Vanish:

1. **Advances funds** from its trading accounts to a one-time wallet.
2. **Wraps your transaction** - your instructions are passed through unchanged, with settlement instructions added around them. Whichever DEX, aggregator, or lending provider you chose is untouched.
3. **Routes the transaction** via Jito bundle or returns a signed payload for self-broadcast.
4. **Settles atomically** at the end. If any instruction fails, everything reverts - failed transactions only cost the base network fee.

The two flows differ only in how long the one-time wallet lives:

|                  | [Trading](/guide/integration/trading)          | [Lending](/guide/integration/lending)                  |
| ---------------- | ---------------------------------------------- | ------------------------------------------------------ |
| One-time wallet  | A fresh wallet per trade - **never reuse it**  | One wallet per position, reused until it is settled    |
| Funds            | The user's Vanish balance, funded by a deposit | Advanced from Vanish's trading accounts                |
| Your transaction | `swap_transaction`                             | `main_tx`                                              |
| Settlement       | Part of the trade itself                       | An explicit settle when you are done                   |
| Commit at        | [`POST /commit`](/api-reference/commit)        | [`POST /borrow/commit`](/api-reference/lending/commit) |

<Warning>
  The two commit endpoints are not interchangeable. Commit deposits, trades, and withdrawals at [`/commit`](/api-reference/commit); commit lending actions at [`/borrow/commit`](/api-reference/lending/commit).
</Warning>

***

## Compliance

Vanish operates on a **same wallet in, same wallet out** model: the user's connected wallet is the only address you can deposit from and the only address withdrawals are returned to. This is enforced at the protocol level and cannot be bypassed - see [Compliance](/start/compliance).

If a deposit commit returns `rejected`, it failed compliance or risk screening. Funds are refunded to the originating wallet after extended screening completes; do not re-attempt until the refund is confirmed.

***

## Handling Interrupted Flows

A transaction that is submitted but never committed stays in a pending state. Each API has its own recovery pair, and both commit endpoints are idempotent:

| Uncommitted actions                                                                                   | Resolve with                                           |
| ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
| [`POST /account/pending`](/api-reference/account/get_pending_actions) - deposits, trades, withdrawals | [`POST /commit`](/api-reference/commit)                |
| [`POST /borrow/pending`](/api-reference/lending/pending) - lending and settle actions                 | [`POST /borrow/commit`](/api-reference/lending/commit) |

Call both on startup - see [Recovering Pending Commits](/guide/handling#recovering-pending-commits) for code.

***

## Amounts

All amounts are denominated in **lamports** - the smallest unit of SOL (1 SOL = 1,000,000,000 lamports). SPL token amounts use the token's own decimal precision.

| Amount          | Lamports        | Used for                                                     |
| --------------- | --------------- | ------------------------------------------------------------ |
| 1 SOL           | `1,000,000,000` | -                                                            |
| 0.012 SOL       | `12,000,000`    | `loan_additional_sol` on a trade - unused amount is refunded |
| 0.002039280 SOL | `2,039,280`     | One token account, the first time a position uses that token |
| 0.002 SOL       | `2,000,000`     | `additional_sol` on a withdrawal                             |
| 0.001 SOL       | `1,000,000`     | Minimum recommended Jito tip on a trade                      |

On a trade, a lower `loan_additional_sol` may work if the target token's ATA already exists in the user's wallet - but the recommended value is safe for all cases.

***

## Next Steps

<CardGroup cols={3}>
  <Card title="Signing" color="#00dae9" icon="signature" iconType="duotone" href="/guide/integration/signing">
    One prefix, six formats. The exact `Details:` line for every endpoint.
  </Card>

  <Card title="Trading" color="#00dae9" icon="arrow-right-arrow-left" iconType="duotone" href="/guide/integration/trading">
    Deposit, trade privately, and withdraw.
  </Card>

  <Card title="Lending" color="#00dae9" icon="building-columns" iconType="duotone" href="/guide/integration/lending">
    Open a position, use the funds, then settle.
  </Card>
</CardGroup>
