# Duels

This page covers everything about creating, joining, and viewing WAX Duel games.

***

## Team Composition <a href="#team-composition" id="team-composition"></a>

WAX Duel requires teams to follow the **2-2-1 composition rule**. This ensures balanced, strategic team building.

### The 2-2-1 Rule

Every team must have exactly:

* **2 Tanks** (blue badges) - High defense and health characters
* **2 Damage** (red badges) - High attack power characters
* **1 Support** (green badge) - Balanced, flexible character

You cannot proceed to the bet step until your team meets this composition requirement.

### Fighter Types

All 40 Street Fighter characters are classified into one of three types:

| Type        | Count | Examples                                 |
| ----------- | ----- | ---------------------------------------- |
| **Tank**    | 16    | M. Bison, Zangief, Sagat, Guile, Abigail |
| **Damage**  | 16    | Ryu, Ken, Akuma, Balrog, Juri            |
| **Support** | 8     | Chun-Li, Cammy, Karin, Menat, Poison     |

See [Fighter Types](/duel-white-paper/getting-started/fighters.md#fighter-types) for the complete list of character classifications.

### Composition Indicator

When creating a duel, a composition indicator shows your progress:

* **Tanks: 0/2** - Number of tanks selected vs required
* **Damage: 0/2** - Number of damage characters selected vs required
* **Support: 0/1** - Number of support characters selected vs required

Numbers turn **green** when you've met the requirement for that type. A checkmark appears when your full team composition is valid.

### Building a Valid Team

**Strategy tips:**

* Use the **fighter type filter** to quickly find characters of a specific type
* Characters that would exceed the type limit show a **"Type Full"** overlay
* Plan your team around the 2-2-1 requirement before selecting NFTs

***

## Creating a Duel <a href="#creating-a-duel" id="creating-a-duel"></a>

Create a new WAX Duel and challenge other players!

**URL:** [waxduel.io/stf-capcom/duels/create](https://waxduel.io/stf-capcom/duels/create)

### Requirements

Before creating a game, you need:

* At least **5 Street Fighter NFTs** in your wallet that satisfy the 2-2-1 composition rule
* **$FIGHT tokens** for your bet (minimum 1 FIGHT)
* A connected WAX wallet

### Step 1: Select Your Team

Choose 5 NFTs to form your battle team following the **2-2-1 composition rule**.

#### Team Slots

You'll see 5 slots at the top. Your selected fighters appear here with their **fighter type badges**, and you can drag to reorder them.

#### Composition Indicator

Below the title, a composition indicator shows:

* **Required: Tank 0/2 | Damage 0/2 | Support 0/1**
* Numbers turn green as you meet each requirement
* "Valid team!" appears with a checkmark when composition is correct

#### Fighter Type Filter

Filter available NFTs by type using the buttons:

* **All** - Show all your NFTs
* **Tank** - Show only tank characters (blue)
* **Damage** - Show only damage characters (red)
* **Support** - Show only support characters (green)

Each filter button shows your current selection count (e.g., "Tank (1/2)").

#### Selecting Fighters

Your NFTs are displayed below, **grouped by template** (character + rarity combination):

* **Fighter Type Badge** - Each card shows Tank (blue), Damage (red), or Support (green)
* **Single NFT templates:** Click the card to select it directly
* **Multiple NFT templates:** Card shows count like "Balrog (3)" - click to open asset overlay

#### Asset Selection Overlay

When you click a template with multiple NFTs, an overlay opens showing:

* All individual NFTs for that template
* **Battle stats** for each NFT (wins/losses, K/D ratio, damage dealt)
* **Cooldown status** - NFTs on cooldown are disabled
* Click an available NFT to select it for your team

#### Card Indicators

* **"In Team"** overlay - This character is already in your team
* **"Tank Full"** / **"Damage Full"** / **"Support Full"** overlay - You've already selected enough of this fighter type
* **"All on Cooldown"** overlay - All NFTs of this template are on cooldown
* **Frozen blue overlay** - Some NFTs are on cooldown (shows count like "2/3")
* **Normal appearance** - NFTs available for selection

#### Team Rules

* You must select exactly **5 different characters**
* Your team must follow the **2-2-1 composition** (2 Tanks, 2 Damage, 1 Support)
* Each character can only appear once in your team (you can't use two Ryu NFTs even if they're different rarities)
* Your opponent can use the same characters as you - the restriction only prevents duplicates within your own team
* NFTs must be in your wallet and not on cooldown

#### Changing Selections

* Click the **"Remove"** button below any selected fighter
* Drag fighters in the team slots to reorder them
* Removed characters become available for selection again

### Step 2: Set Your Bet

Configure how much $FIGHT you want to bet.

#### Bet Amount

* **Minimum:** 1 FIGHT
* **Quick Buttons:** 10, 50, 100, 500 FIGHT
* **Custom:** Type any amount

#### Prize Calculation

The total prize pool is displayed:

* **Total Pot:** Your bet x 2 (you and opponent bet same amount)
* **Winner Receives:** 80% of total pot
* **Example:** 10 FIGHT bet = 20 FIGHT pot = 16 FIGHT to winner

#### Balance Check

Your current $FIGHT balance is shown. You cannot bet more than you have.

### Step 3: Review & Create

Review your selections before creating the game.

#### Team Preview

Your 5 selected fighters are displayed with images and names.

#### Bet Summary

* Your bet amount
* Total prize pool
* Winner's reward

#### Important Notes

* Your team selection is stored locally until the opponent joins
* Do not clear your browser data until the game completes
* Once created, your $FIGHT is deposited to the game contract

#### Create Duel

Click **"Create Duel"** to submit. You'll need to:

1. Approve the transaction in your wallet
2. Wait for confirmation

### After Creating

Once your game is created:

1. The game appears in the "Open" games list
2. Other players can see and join your game
3. You'll match with an opponent who bets the same amount
4. Wait for someone to join!

### Team Hash System

When you create a game, your team is hidden using a cryptographic hash:

* Only the hash of your team is stored on-chain
* Your actual team is stored in your browser
* This prevents opponents from seeing your team before joining
* After they join, you must "reveal" your team

**Warning:** If you clear your browser data before revealing, you may lose access to your game.

### Tips for Creating Duels

* **Popular Bet Amounts:** 10, 50, and 100 FIGHT are common choices
* **Team Strategy:** Mix character types for better chances
* **Check Cooldowns:** See NFT cooldowns section below

### NFT Cooldowns

After an NFT is used in a completed game, it enters a cooldown period.

#### Cooldown Rules

| NFT Type      | Cooldown Duration                       |
| ------------- | --------------------------------------- |
| Standard NFTs | 24 hours after game completion          |
| Golden NFTs   | **No cooldown** (never stored on-chain) |

#### How to Check Cooldowns

1. Go to [My Fighters](/duel-white-paper/getting-started/fighters.md#my-fighters)
2. Template cards with cooldown show a frozen blue overlay with count (e.g., "2/3")
3. Click any template card to see individual NFT cooldown times in the overlay

#### Golden NFT Advantage

**Golden NFTs** bypass the cooldown system entirely:

* The smart contract **does not store cooldown** for golden assets
* Use them in multiple games per day without any waiting
* Perfect for active players who want to play frequently
* Identified by yellow "Golden" badge on the card
* Golden template cards never show cooldown indicators
* See [Golden Templates](/duel-white-paper/reference/stf-capcom.md#golden-templates) for the complete list

#### Cooldown Starts When

The 24-hour cooldown timer begins when:

* A game you participated in completes (win or lose)
* Not when you select the NFT for your team
* Not when you create the game

#### During Cooldown

While an NFT is on cooldown:

* It appears grayed out in the asset selection overlay
* The template card shows the frozen overlay if any NFTs are on cooldown
* You can still view stats and details but cannot select it
* Other players cannot see your cooldown status

***

## Joining a Game <a href="#joining" id="joining"></a>

Browse existing games and join one created by another player.

**URL:** [waxduel.io/stf-capcom/duels](https://waxduel.io/stf-capcom/duels)

### Finding Games to Join

#### Games List

The Games page shows all games with filters:

* **Open to Join** - Games waiting for an opponent (default)
* **My Games** - Your game history
* **In Progress** - Games currently being played
* **Completed** - Finished games
* **All Games** - Every game in the system

#### Game Cards

Each game card shows:

* **Game ID** - Unique identifier
* **Status** - Current game state
* **Creator** - Who created the game (P1)
* **Opponent** - Who joined (P2), if applicable
* **Bet Amount** - FIGHT required to join
* **Prize Pool** - Total pot
* **Time Created** - When the game was made

#### Finding Joinable Games

Look for games with:

* Status: "Open" or "Deposit Pending"
* A bet amount you can afford
* Created by someone other than you

### Joining Process

#### Step 1: Select a Game

Click the **"Join"** button on an open game.

#### Step 2: Select Your Team

Choose 5 NFTs for your team following the **2-2-1 composition rule**:

* Your NFTs are displayed **grouped by template** (character + rarity)
* Use the **fighter type filter** to find Tanks, Damage, or Support characters
* Each character can only appear once in your team (opponent can use same characters)
* Your team must have 2 Tanks, 2 Damage, and 1 Support
* See [Step 1: Select Your Team](#step-1-select-your-team) for full details on the selection process

#### Step 3: Deposit & Confirm

* Your $FIGHT will be deposited to match the bet
* Approve the transaction in your wallet
* Wait for confirmation

### What Happens After Joining

#### 1. Your Team is Revealed

When you join, your team is immediately visible since the creator's team is still hidden.

#### 2. Creator Reveals Their Team

The game creator (P1) must reveal their team:

* They click "Reveal Your Team" on the game page
* Their hidden team is verified against the original hash
* Both teams are now visible

#### 3. Battle Executes

Anyone can trigger the battle:

* Click "Execute Fight" on the game page
* The smart contract runs the auto-battler
* Winner is determined

#### 4. Prize Distribution

* Winner receives 80% of the total pot
* Prize is automatically sent to winner's account

### Bet Matching

* You must bet the exact same amount as the creator
* The total pot = your bet + creator's bet
* Winner gets 80% of total pot

**Example:**

* Creator bets 50 FIGHT
* You bet 50 FIGHT to join
* Total pot: 100 FIGHT
* Winner receives: 80 FIGHT

### Restrictions

#### Can't Join Your Own Games

You cannot join games you created.

#### NFT Requirements

* Must have 5 NFTs available in your wallet
* NFTs must not be in cooldown (24 hours between games)
* Golden NFTs have no cooldown

#### Sufficient Balance

You need enough $FIGHT to match the bet amount.

### Tips for Joining

* **Check Your Balance:** Make sure you have enough $FIGHT
* **Review the Bet:** Higher bets = higher risk and reward
* **NFT Selection:** Consider what team the opponent might have
* **Quick Response:** Popular games get joined fast

***

## Viewing Battles <a href="#viewing-battles" id="viewing-battles"></a>

Watch the battle unfold and see the results!

**URL:** [waxduel.io/stf-capcom/duels/\[gameId\]](https://waxduel.io/stf-capcom/duels)

### Show Results Toggle

When browsing game lists, use the **Show Results** checkbox in the header to control spoilers:

* **Unchecked:** Game cards show "Complete" instead of revealing the winner
* **Checked:** Game cards display the actual winner (P1 Win/P2 Win)

This prevents accidental spoilers when browsing completed games.

### Game Detail Page

Click on any game from the games list to view its details.

### Page Sections

#### Info Cards

Three cards at the top show:

1. **Prize Pool**
   * Total pot amount
   * Winner's share (80%)
2. **Players**
   * P1 (creator) username
   * P2 (challenger) username
3. **Result**
   * Winner (when game is complete)
   * Game status

#### Teams Display

Both teams are shown side-by-side:

**Player 1 Team** (left) | **Player 2 Team** (right)

Each fighter shows:

* Character image
* Health bar (during/after battle)
* Skull icon (if defeated)
* "Hidden" placeholder (if team not yet revealed)

#### Battle Log

After the battle executes, a turn-by-turn log shows:

* **Round number**
* **Attacker** vs **Defender**
* **Damage dealt**
* **Special events:**
  * Dodge (attack missed)
  * Combo (bonus damage)
  * Range penalty (reduced damage from distance)
  * Kill (defender was defeated)

### Watching the Battle

After a game completes, you can watch an animated replay of the battle.

#### Reveal Winner Button

For completed games you haven't viewed yet, a purple **"Reveal Winner"** button appears:

* Click to reveal who won without spoilers
* The result card changes from "Battle Complete" to showing the actual winner
* This lets you choose when to see the outcome

#### Watch Duel Button

After revealing the winner, a cyan **"Watch Duel"** button appears:

* Opens the full-screen animated Duel Viewer
* Watch the battle unfold turn-by-turn with animations

#### Duel Viewer Features

The Duel Viewer provides an immersive battle replay experience:

**Visuals:**

* Fighter cards arranged in battle formation
* Attack lines animate between attackers and defenders
* HP bars deplete as fighters take damage
* Damage numbers pop up showing hit amounts
* Visual indicators for attacking (yellow glow), defending (red border), defeated (grayscale)
* Combo and dodge notifications
* Round announcements with "FIGHT!" animation

**Sound Effects:**

* Attack sounds for each hit
* Special sounds for combos, dodges, and kills
* Round start and victory fanfares
* Mute toggle available

**Playback Controls:**

* **Play/Pause:** Start or pause the replay
* **Speed:** Choose 0.5x, 1x, 2x, or 4x playback speed
* **Step:** Move forward or backward one turn at a time
* **Progress Bar:** Click to jump to any point in the battle
* **Skip to End:** Jump directly to the final result

**Victory Screen:**

* Shows the winning team with celebration animation
* Highlights "Fighter of the Game" (best performer based on damage, kills, and combos)
* Displays battle statistics for top fighters

### Game Status Progression

Games progress through these states:

| Status         | Meaning                              |
| -------------- | ------------------------------------ |
| Created        | P1 created game, waiting for deposit |
| P1 Deposited   | P1's FIGHT deposited, waiting for P2 |
| All Deposited  | Both players deposited               |
| All Joined     | P2 joined, waiting for P1 reveal     |
| Ready to Fight | Both teams revealed, battle ready    |
| P1 Win         | Player 1 won the battle              |
| P2 Win         | Player 2 won the battle              |
| Canceled       | Game was canceled                    |
| P1/P2 Inactive | Other player timed out               |

### Timeouts and Inactivity

Games have built-in timeouts to prevent funds from being locked indefinitely.

#### 24-Hour Timeout Rules

| Situation              | Timeout                            | Result                            |
| ---------------------- | ---------------------------------- | --------------------------------- |
| P2 doesn't join        | 24 hours after game creation       | P1 can cancel and recover deposit |
| P1 doesn't reveal team | 24 hours after P2 joins            | P2 wins due to inactivity         |
| Battle not executed    | 24 hours after both teams revealed | Either player can execute         |

#### What Happens When Someone Times Out

**If P2 never joins:**

* After 24 hours, P1 can call "Cancel" to recover their $FIGHT deposit
* The game status changes to "P1 Canceled"

**If P1 doesn't reveal their team:**

* After 24 hours of waiting, P2 can claim victory
* P2 receives the full prize pool (minus fees)
* Game status changes to "P2 Win P1 Inactive"

#### Your Deposited Tokens

Your $FIGHT tokens are safe in these scenarios:

* **Game canceled before opponent joins:** Full deposit returned
* **Opponent times out:** You win and receive your deposit plus winnings
* **Normal game completion:** Winner receives 80% of total pot

### Actions

#### Reveal Your Team (P1 only)

If you created the game and P2 has joined:

1. Click **"Reveal Your Team"**
2. Your hidden team is verified against the hash
3. Both teams become visible

#### Execute Fight

Once both teams are revealed:

1. Anyone can click **"Execute Fight"**
2. The battle runs on the smart contract
3. Results appear immediately

#### Join Duel

If viewing an open game you didn't create:

* Click **"Join Duel"** to enter

### Understanding the Battle Log

#### Turn Format

Each turn shows:

```
Round X: [Attacker Name] attacks [Defender Name]
Damage: Y | HP: Start -> End
[Special events]
```

#### Special Events

**Dodge**

* Defender avoided the attack entirely
* Based on Speed comparison
* No damage dealt

**Combo**

* Attacker landed extra hits
* 1.75x damage multiplier
* Based on Combo stat

**Range Penalty**

* Attacker was too far from defender
* Damage reduced (75%, 50%, or 25%)
* Based on Range stat vs position distance

**Kill**

* Defender's HP reached 0
* That fighter is eliminated
* Shown with skull icon on team display

### After the Battle

#### Winner Determination

* Battle continues until one team has no fighters left
* The player with remaining fighters wins
* Prize is automatically distributed

#### Viewing Past Games

All completed games remain viewable:

* Battle log preserved
* Final team states shown
* Winner highlighted

***

## Game History <a href="#history" id="history"></a>

The **Game History** page shows all games you've participated in.

**URL:** [waxduel.io/stf-capcom/duels/my](https://waxduel.io/stf-capcom/duels/my)

### Overview

This page allows you to:

* View all your past and current games
* Filter games by outcome
* See your overall win/loss statistics
* Track your $FIGHT token performance

### Accessing Game History

1. Connect your WAX wallet
2. Click **Duels** in the navigation
3. Select **My Games** tab

### Filter Options

Use the filter buttons to show specific games:

| Filter    | Description               |
| --------- | ------------------------- |
| All       | Show all your games       |
| Won       | Only games you won        |
| Lost      | Only games you lost       |
| Active    | Games still in progress   |
| Cancelled | Games that were cancelled |

### Statistics Summary

The page header shows your overall performance:

* **Total Games** - Number of games played
* **Wins / Losses** - Your win/loss record
* **Net FIGHT** - Your total $FIGHT gains or losses (green = profit, red = loss)

### Game Card Information

Each game displays:

* **Game ID** - Unique identifier
* **Status** - Current game state
* **Bet Amount** - $FIGHT wagered per player
* **Opponent** - Who you played against
* **Your Role** - Whether you were Player 1 or Player 2
* **Result** - Win, Loss, or Pending

### Game Status Colors

| Status         | Color  | Meaning                     |
| -------------- | ------ | --------------------------- |
| Created        | Blue   | Waiting for opponent        |
| Deposited      | Cyan   | Waiting for deposits        |
| All Joined     | Purple | Both teams selected         |
| Ready to Fight | Yellow | Battle ready to start       |
| Win            | Green  | Game completed with winner  |
| Canceled       | Gray   | Game was cancelled          |
| Inactive Win   | Red    | Won due to opponent timeout |

### Viewing Game Details

Click any game card to view full details:

* Both teams' fighters
* Battle replay (if completed)
* Transaction history

### Wallet Connection Required

You must connect your WAX wallet to view your game history. The page shows games where your account was either Player 1 or Player 2.

***

## Tips

### Team Building

* **Follow 2-2-1:** Every team needs 2 Tanks, 2 Damage, and 1 Support
* **Use Filters:** The fighter type filter helps you find characters quickly
* **Check Your Roster:** Make sure you own enough of each type before starting

### NFT Management

* **Watch Cooldowns:** Your NFTs enter 24-hour cooldown after battle (except Golden NFTs)
* **Golden Advantage:** Golden NFTs never have cooldown - use them multiple times per day
* **Train Everything:** Use "Train Fighters" to register NFTs and "Collect $TRAIN" to claim rewards

### Strategy

* **Study Battles:** Watch replay logs to understand how stats affect combat
* **Character Stats:** High Attack beats low Defense, high Speed dodges attacks
* **Position Matters:** Range stat affects damage based on fighter positions
* **Know Your Types:** Tanks absorb damage, Damage dealers eliminate enemies, Support provides balance


---

# Agent Instructions: 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:

```
GET https://duel-2.gitbook.io/duel-white-paper/getting-started/duels.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
