Core Concepts
Markets, tokens, resolution, and reputation tiers — the primitives behind AGON.
Markets
- Binary prediction markets with YES/NO outcomes
- CPMM AMM:
price = shares_YES / (shares_YES + shares_NO) - USDC as collateral (6 decimals). Min trade: 1 USDC
- Markets resolve to 0 (NO) or 1 (YES) at expiry
CPMM pricing formula
The on-chain AMM uses a Constant Product Market Maker. The
FixedPointMath.getYesPrice() library function computes the YES price
as:
price_YES = noReserve / (yesReserve + noReserve)This is the standard constant-product formula applied to a two-outcome
market. When demand for YES tokens increases, yesReserve decreases
(tokens leave the pool) and noReserve increases (collateral enters),
pushing price_YES up. The NO price is always 1 - price_YES.
Worked example
A market starts with 1 000 USDC of liquidity split 50/50:
| State | yesReserve | noReserve | price_YES |
|---|---|---|---|
| Initial | 500 | 500 | 0.50 |
Alice wants to buy YES with 100 USDC. After the dynamic fee is
deducted (assume roughly 0.50 USDC at this pool depth), her net
input is ~99.50 USDC. The AMM applies the constant-product swap
formula (FixedPointMath.getAmountOut):
tokensOut = (netInput * yesReserve) / (noReserve + netInput)
= (99.50 * 500) / (500 + 99.50)
≈ 83.0 YES tokensAfter the trade the reserves shift:
| State | yesReserve | noReserve | price_YES |
|---|---|---|---|
| After Alice buys YES | 417 | 599.50 | ~0.59 |
Alice received 83 YES tokens. If the market resolves YES, each token redeems for 1 USDC -- she profits ~83 - 100 = net depends on resolution. If it resolves NO, her YES tokens are worth zero.
Slippage and price impact
Because the pool is finite, larger trades move the price more. The
ConditionalTokens contract enforces a maximum price impact of 10%
per trade (MAX_PRICE_IMPACT_PCT = 1000 bps) and a maximum trade
cap that varies by pool depth:
| Pool depth | Max trade (% of pool) | Base fee | Dynamic fee multiplier |
|---|---|---|---|
| Large (>= 50k USDC) | 10% | 25 bps | 2x |
| Medium (>= 10k USDC) | 5% | governance feeBps | governance dynamicFeeMultiplier |
| Small (>= 1k USDC) | 5% | 75 bps | 6x |
| Micro (< 1k USDC) | 5% | 100 bps | 6x |
The dynamic fee scales linearly from the base fee up to base * multiplier
as the trade size approaches the cap. This protects LPs from large
single-trade impermanent loss while keeping fees low for small trades.
An anti-sandwich mechanism enforces a 1-block cooldown per wallet per market, preventing MEV bots from front-running user trades within the same block.
Tokens
- ERC-1155 tokens:
tokenId = marketId * 2(YES),marketId * 2 + 1(NO) - 1 YES + 1 NO = 1 USDC at resolution (always redeemable)
- Tokens are fungible within a market — no NFT mechanics
- ConditionalTokens contract handles minting and redemption
Token ID scheme
The ConditionalTokens contract derives token IDs deterministically
from the market ID:
function yesTokenId(uint256 marketId) public pure returns (uint256) {
return marketId * 2;
}
function noTokenId(uint256 marketId) public pure returns (uint256) {
return marketId * 2 + 1;
}For example, market 7 has YES token ID 14 and NO token ID 15. This scheme guarantees unique, collision-free token IDs across all markets within a single ERC-1155 contract.
Redemption invariant
The fundamental invariant is: 1 YES + 1 NO = 1 USDC. This holds because:
splitPosition(marketId, amount)depositsamountUSDC and mints equal quantities of YES and NO tokens.mergePositions(marketId, amount)burns equal quantities of YES and NO tokens and returnsamountUSDC.- After resolution, only the winning side redeems at 1:1.
redeemPositions(marketId)burns the winning tokens and pays out their full balance in USDC. If the outcome is INVALID, both sides redeem at face value (refund).
This invariant means the system is always fully collateralized. The total USDC held by the contract equals the total supply of either token type for each market.
Resolution
- AI Oracle: multi-LLM concordance (Claude Haiku + Gemini 2.0 Flash + GPT-4o)
- Resolves in <60s for supported event types
- Requires 2/3 LLM agreement + confidence ≥ 0.80
- OracleDAO fallback for disputed or ambiguous markets
For details on the concordance algorithm, validator mechanics, and edge signal generation, see AI Oracle.
Reputation Tiers
F (REKT) → D (ROOKIE) → C (ACTIVE) → B (RANKED) → A (ELITE) → S (APEX)- Tier determined by cumulative PnL and prediction accuracy
- Tier unlocks arenas, higher API rate limits, and cosmetics
- Tiers reset seasonally — earned, never bought
How tiers are computed
The trader_score worker runs every 6 hours. It evaluates all wallets
with at least 5 trades and computes a composite copy_score that
factors in real PnL, ROI, win rate, profit factor, Sharpe ratio,
Sortino ratio, max drawdown, and consistency. Wallets are then ranked
by copy_score and assigned tiers based on percentile:
| Tier | Percentile | Label |
|---|---|---|
| S | Top 1% | APEX |
| A | Top 5% | ELITE |
| B | Top 15% | RANKED |
| C | Top 35% | ACTIVE |
| D | Remaining with PnL >= 0 | ROOKIE |
| F | Negative PnL | REKT |
Tiers are stored in the trader_scores table and surfaced via the
API leaderboard. Higher tiers unlock access to competitive arenas,
increased API rate limits, and seasonal cosmetic rewards.
On-chain, staking AGON in ReputationStaking.sol provides a fee
distribution boost (10-30% depending on stake amount). Staking at
least 100 000 AGON grants guaranteed APEX league entry regardless of
the off-chain percentile tier.
