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

# Vaults and custody

> How Totalis holds collateral: non-custodial on-chain Solana vaults, delegated signing inside a secure enclave, sponsored gas, and automatic settlement.

Totalis is **non-custodial**: your funds sit in an on-chain Solana vault that the protocol's program
controls, not in a Totalis held account. You enable trading once by delegating signing permission.
After that, you place, settle, and close parlays without signing each transaction by hand.

## At a glance

* One vault per account, with three balances: gross, locked, and free.
* Totalis signs trades inside a secure enclave and can never extract your key. You can revoke the permission at any time.
* Your stake and the maker's collateral lock in one atomic transaction when the maker confirms your trade.
* Network fees are sponsored. Your wallet only ever needs USDC.

<img className="block dark:hidden rounded-2xl" src="https://mintcdn.com/ucalledit/YdiR6y3UIknGsFJp/images/pictures/vault-architecture-light.png?fit=max&auto=format&n=YdiR6y3UIknGsFJp&q=85&s=cbeb525a8c42ea59700643f276ab7f3d" alt="Your wallet funds your vault, your stake and the maker's collateral lock in a position, the fee vault takes 1% of profit, and settlement follows the venues" width="1540" height="952" data-path="images/pictures/vault-architecture-light.png" />

<img className="hidden dark:block rounded-2xl" src="https://mintcdn.com/ucalledit/YdiR6y3UIknGsFJp/images/pictures/vault-architecture-dark.png?fit=max&auto=format&n=YdiR6y3UIknGsFJp&q=85&s=49ad53fd8fcc73c3885be388fb206ded" alt="Your wallet funds your vault, your stake and the maker's collateral lock in a position, the fee vault takes 1% of profit, and settlement follows the venues" width="1540" height="952" data-path="images/pictures/vault-architecture-dark.png" />

## Your vault

Your vault is persistent and reused across every parlay. It tracks three balances:

| Balance | Meaning |
| - | - |
| Gross | Total USDC in the vault. |
| Locked | Collateral committed to your active positions. |
| Free | `gross - locked`. Available to trade or withdraw. |

Read them any time from [`GET /v1/vault`](/solana/api-reference/funds/get-vault). To fund the vault, send
USDC to your wallet (see [Funding](/solana/guides/funding)). Placing a parlay moves your stake into the
vault and locks it in one atomic step.

## Delegated signing

Your wallet is a Privy embedded wallet. Its private key lives inside a Trusted Execution Environment,
a secure enclave the key never leaves. Privy cannot extract it either.

To trade, you grant Totalis permission to sign on your behalf inside that enclave. This is a one
time consent in the app, described under [Enable trading](/solana/guides/funding#enable-trading).

While trading is enabled, Totalis can sign transactions for your wallet, including sending unlocked
USDC. The API does that only for a withdrawal that you, or a key with `funds:withdraw`, request.
You stay in control:

| To | In the app |
| - | - |
| Stop Totalis signing for you | **Settings**, **Trading**, **Revoke**. Trading and API withdrawals stop until you enable trading again. |
| Hold your own key | **Settings**, **Wallet**, export the private key, then use Phantom, Backpack or any Solana wallet. Move vault free balance to your wallet first. |

## Gas is sponsored

Totalis pays the network fees (gas) for trading and settlement. Your wallet only ever needs to hold
USDC, never SOL.

## How a position locks and settles

When the maker confirms your trade, your stake and the maker's collateral lock together in a single
atomic transaction. There is no window where one side is funded and the other is not.

Settlement moves funds in exactly one of three ways:

| Outcome | Result |
| - | - |
| You win | Your stake comes back and you receive the maker's collateral, minus the profit fee on your profit. |
| You lose | Your stake transfers to the maker, minus the fee on their profit. |
| A leg is voided | The position is cancelled and both sides' collateral is released. You get your full bet back, taker fee included. |

The fee rate is written onto each position when it is created, so settlement always uses the rate
that applied at trade time. Both fees and the full math are on
[Limits and fees](/solana/limits-and-fees).

## What Totalis can and cannot do

| Totalis can | Totalis cannot |
| - | - |
| Sign trading transactions inside the enclave, while your delegation is active | Extract or hold your private key |
| Settle each leg to its venue's official result | Move locked collateral to an arbitrary address |
| Send your unlocked USDC while trading is enabled, which the API does only on a withdrawal you request | Keep you from revoking trading or exporting your key |
| Collect the protocol fee defined on the position | Change the fee rate on a position that is already live |
| Cancel a position when a leg is voided | Change what a live position pays |

Every vault, position, and settlement is on the Solana blockchain and independently verifiable. The
vault program is `58LfwWEnq1aCG2R18voCBF7zzJNtVSWquQBvdaaDFhme`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.