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

# ERC-1155 Tokens and Prediction Markets

> How ERC-1155 tokens represent prediction markets

ERC-1155 tokens represent positions in prediction markets on-chain. Each unique combination of market and outcome side (e.g., "yes" or "no") is tokenized as a distinct ERC-1155 token, enabling on-chain ownership and transferability of prediction market positions.

## Token ID Generation

Each token ID is deterministically computed using a hash of:

* **Market ID** - The prediction market identifier (e.g., `"BTC-100K-2024-12"`)
* **Side** - The outcome side (e.g., `"yes"`, `"no"`, `"Lakers"`, `"Celtics"`)
* **Exchange** - The exchange name

This ensures that the same market and side combination always produces the same token ID across the system.

## Token Metadata

Each token includes metadata such as:

* Market title and description from the prediction market
* Outcome side information
* Token name and image
* Market rules and details

## Token Lifecycle

**Buy Orders:**

1. Order is placed on the prediction market
2. When filled, ERC-1155 tokens are minted to your smart wallet
3. Tokens represent your position in that market

**Sell Orders:**

1. You hold ERC-1155 tokens in your smart wallet
2. Order is placed on the prediction market
3. When filled, tokens are burned from your wallet

## Benefits

* **On-chain ownership** - Positions are held as NFTs in your wallet
* **Transferability** - Tokens can be transferred, traded, or used as collateral
* **Composability** - Tokens can be integrated with DeFi protocols
* **Transparency** - All positions are verifiable on-chain
