> 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/spinning.md).

# Spinning

## Buying a spin

You pay in **ETH**. Everything downstream is priced in USDG, but you never have to hold it.

```solidity
ZapRouter.spinWithETH(uint8 packId, address player) payable
```

In one transaction the router:

{% stepper %}
{% step %}

## Carves out the VRF fee

Carves out the VRF fee from your `msg.value` (currently zero).
{% endstep %}

{% step %}

## Wraps the rest to WETH

Wraps the remaining ETH to WETH.
{% endstep %}

{% step %}

## Swaps for USDG

Swaps **exactly** the pack price into USDG on Uniswap V3.
{% endstep %}

{% step %}

## Calls the Machine

Calls `spin()` on the Machine.
{% endstep %}

{% step %}

## Refunds leftover ETH

**Refunds every leftover wei of ETH**.
{% endstep %}
{% endstepper %}

It is an exact-output swap, so you pay the pool's price for the pack and not a wei more. Overpay deliberately if you like the change comes straight back.

## Packs

USDG has 6 decimals, so `$10 = 10_000_000` units.

| Pack   | Price     | Reserved per in-flight spin | Status                            |
| ------ | --------- | --------------------------- | --------------------------------- |
| Small  | **$10**   | $88.80                      | live                              |
| Medium | **$100**  | $888                        | live                              |
| Large  | **$1000** | $8,880                      | Activates with enough Vault depth |

The odds and face multiples are **identical on every pack**. A legendary is 8.88× whatever you paid. Bigger packs are bigger stakes, not better odds.

{% hint style="info" %}
The $1000 pack stays disabled until the bankroll is deep enough to reserve its worst-case payout. An enabled pack the vault cannot cover would revert inside `BankrollVault.reserve` with nothing explaining why, so it stays off until the depth is there.

Which stocks get racked on which pack is a liquidity decision — every card is a real market buy at restock. See [Odds & RTP](broken://pages/330521a6c390759cb54eb79ec1e53c6ae267bb25#which-stock-you-get).
{% endhint %}

## Batch spins

```solidity
ZapRouter.spinBatchWithETH(uint8 packId, address player, uint8 count) payable
```

Up to **5 spins on one signature**.

The USDG leg is a **single swap for the whole batch** rather than `count` separate ones — fewer fees, and one trip through the pool instead of walking the price up against yourself.

Each spin still gets its own randomness request, its own reservation and its own independent settlement. **A batch is N spins bought together, not one spin with N outcomes.** They can land on different tiers and settle in any order.

Everything unspent comes back as ETH.

## What happens next

Your spin is recorded as `Pending` and a house VRF request goes out. When the operator reveals the next preimage, the outcome is decided.

Nobody knows the result before that reveal — not you, not the operator — because it does not exist yet. See [How It Works](broken://pages/5cebb6414d768bab0a3476feb7513f67d3865b78#3-randomness-is-requested).

### You win a card

The Machine picks a tier, picks a card uniformly from that tier's rack, pops it off, and transfers the NFT to you. See [Cards](broken://pages/068cd7cbd54bdc7f4d78f237b440a091ddc903bf).

### The rack was empty

You are paid that tier's **face value in USDG** instead, claimable immediately. Same value, different form and it can always pay, because that money was reserved before your spin was accepted.

### You hit the jackpot tier

0.05% of spins. The whole growing jackpot card is yours, plus any un-swapped fund. See [Jackpot & Golden Chest](broken://pages/2908b27d6782cd6aa17a856a02b7fe1b36bd5348).

### The reveal never comes

After **2 days**, `cancelSpin(spinId)` refunds the entire pack price. It is permissionless — anyone can call it for anyone, and it needs no operator action. Fees are only taken at settlement, so a cancelled spin costs you nothing but gas.

## Claiming USDG

Cash winnings — fallback payouts, Golden Chest wins, consignment payouts, cancellation refunds — are booked as **credits** rather than pushed to you.

```solidity
credits(address) → uint256
claim(address to)
```

This is deliberate. Settlement runs inside the reveal callback, and a callback that reverts is never redelivered on its own it would strand the spin, holding its reservation until someone cancels it. Booking a credit cannot fail, so nothing a winner does can brick another player's settlement.

Cards transfer directly, using a raw transfer with no receiver hook, for the same reason.

## Concurrency

Every in-flight spin holds its reservation until it settles. With `$X` unreserved in the vault, the machine supports `floor(X ÷ 88.80)` concurrent $10 spins; further attempts revert until one settles.

That is a limit on **simultaneous** spins, not total ones. Reservations are released at settlement and each settled spin adds the house's share of its price to the vault, so capacity grows as people play.


---

# 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/spinning.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.
