> For the complete documentation index, see [llms.txt](https://docs.takara.gg/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.takara.gg/using-takara/bankroll.md).

# Bankroll

Stake USDG and you're the house. Your shares grow when players lose and shrink when they win.

## What you're buying

A single USDG vault. It funds the shelves where restock buys stock with vault USDG and pays every card the machine hands over. LPs underwrite the whole prize table and earn their share of spin revenue, pro-rata by shares. Positive in expectation, but it's a position in a game, not a yield product.

```solidity
deposit(uint256 amount) → uint256 shares
```

Shares are internal accounting non transferable LP token priced at NAV in and out. A virtual-share offset blocks the first-depositor inflation trick.

## NAV and inventory

The vault holds USDG **and** stock. When the restocker buys cards, `draw()` moves USDG off the cash book and onto the shelves as tokenized stock, carried at **what the vault paid** for it:

```solidity
nav() = trackedAssets + deployed   // cash + inventory at cost
```

Share price is quoted off NAV, so a restock doesn't move it, cash just became inventory of equal cost. NAV moves with **game results**, and it realizes the market's move on that inventory when the stock is rotated back to USDG. Racked stock is real equity exposure until it's won away or sold.

## The reservation system

This is what makes the machine solvent, and why the vault always looks like it's holding idle cash.

Before a spin is accepted, the machine reserves that spin's **worst-case payout**:

```
reserved = pack price × maxFaceBps   // the table's largest face
```

`reserve()` reverts if `available()` can't cover it — an unbacked spin can't exist. The reservation releases at settlement.

```solidity
available() = trackedAssets - reserved
```

Two consequences:

{% hint style="info" %}
**Idle cash isn't idle.** It's the solvency guarantee. Spend every dollar on inventory and `available()` is zero — nobody can spin.
{% endhint %}

{% hint style="info" %}
**Concurrency is capped by cash, not inventory.** More concurrent spins means more free USDG, not more cards. `draw()` (restock, buyback) only ever touches unreserved assets; in-flight liabilities are untouchable.
{% endhint %}

## Getting out

Two-step, two timers.

```solidity
requestWithdraw(uint256 shares) → uint256 id
cancelWithdraw(uint256 id)
executeWithdraw(uint256 id)
```

|                     |                                                                                                   |
| ------------------- | ------------------------------------------------------------------------------------------------- |
| **Deposit lockup**  | **48 h** after your last deposit before you can even request. Owner-adjustable, capped at 30 days |
| **Withdraw notice** | **6 h** after `requestWithdraw` before you can execute. Owner-adjustable, 1 h floor to 7-day cap  |

**The lockup** stops capital arriving just before a settled win and leaving right after taking edge it never underwrote.

**The notice** is the window the operator uses to convert racked stock back into USDG. Most of the vault can legitimately be inventory on the shelves; a pending withdrawal is the signal to unrack.

`executeWithdraw` prices at NAV **when executed**, not when requested, and pays only if the vault holds enough **liquid** USDG — `assets > available()` reverts. Racked cards count in NAV but can't pay a withdrawal until they're unracked. You carry the game's variance across the whole notice period.

{% hint style="warning" %}
**Every deposit re-stamps the lockup.** `depositedAt` is set on each one, so a top-up restarts the 48 h clock on your whole position — deliberate, or a dust top-up would keep a large stake permanently liquid.
{% endhint %}

Neither withdrawals nor settlement can ever be paused. The vault has no pause function at all.

## The risks, plainly

**Variance.** A run of top-tier pulls on a small bankroll is a real drawdown. The edge is a long-run average; volume heals it, a hot streak doesn't wait for volume.

**Equity exposure.** Racked inventory is real stock, carried at cost. When it's rotated back to USDG at a lower price, that's a realized loss to the vault — independent of anything players did.

**Not instant.** A notice period to exit, at a price you don't know when you request it, and only once the vault holds enough *liquid* USDG: racked cards count in NAV but can't pay a withdrawal until they're unracked.

**No fees to cushion it.** No deposit fee, withdrawal fee, management fee or performance fee. Good — but it means spin revenue is the entire compensation for the risk.

**Not audited.** See [Safety](broken://pages/e5f42ab111828b403e66708b6a864c836b30a2c2).

## What protects you

**The owner can't withdraw from the vault.** There's no function. `draw()` is `onlyMachine` and only ever buys inventory or pays a buyback.

**Reserved assets are untouchable.** `draw()` and `executeWithdraw` can only take from `available()`, which excludes everything spoken for by in-flight spins.

**Losses are bounded by loaded inventory.** Every spin reserves its worst case up front, so the vault can never owe more than it holds. An LP underwrites variance, a hot streak dents the vault before volume heals it but never more than the inventory on the shelves.

**The RTP band is in bytecode.** The operator can't raise the payout table to court players at your expense — `setTable` recomputes RTP and reverts outside 80–97%.

**You can always exit.** `executeWithdraw` needs no operator action. If the front-end vanishes, call it from Blockscout.

## Reading the vault

```solidity
nav()             // cash + inventory at cost — share price is quoted off this
trackedAssets()   // USDG on the cash book
deployed()        // inventory on the shelves, at cost
reserved()        // locked behind in-flight spins
available()       // trackedAssets - reserved
totalShares()
sharesOf(address)
previewRedeem(uint256 shares) → uint256   // informational; execution re-prices
depositedAt(address)                      // your lockup clock
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.takara.gg/using-takara/bankroll.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
