| Program | Address | Version | Deprecated |
|---|---|---|---|
| futarchy | FUTKPrt66uGGCTpk6f9tmRX2325cWgXzGCwvWhyyzjea | 0.1.0 | |
| amm | AMMSgtnttAKx5Ad2Y1socKJ3CcQYCB2ctg8U2SAHcVEx | 0.1.0 | |
| vault | VLTEetGyPKtffi1u3Jr8btWATv33NeDyUuRsPENFPTU | 0.1.0 | |
| svault | GmH3zEvgmWoC6Y6hxinYYRWLCuxUikRN5SAmVDVF4Jjy | 0.1.0 | |
| vault | vLTgeZhLgcr4HvBGxKonSnmU4t7qLcgsVcVtUd3haZc | 0.0.0 | ❌ |
Fee Authority: FEEnkcCNE2623LYCPtLf63LFzXpCFigBLTu4qZovRGZC
A decision market protocol. Proposals create conditional token markets for each option, and the option with the highest TWAP wins.
INITIALIZE PROPOSAL
Moderator ──────────────────────────────────────────────►┌──────────┐
│ Proposal │
└────┬─────┘
│
┌─────────────────────────────────────────────┼─────────────────────────────────────────────┐
│ │ │
▼ ▼ ▼
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Vault │ │ Pool 0 │ │ Pool N │
│ (cond tkns) │ │ quote/base │ ... │ quote/base │
└─────────────┘ └──────┬──────┘ └──────┬──────┘
│ │
│ TWAP │ TWAP
▼ ▼
┌────────────────────────────────────────────────────────┐
│ FINALIZE PROPOSAL │
│ highest TWAP wins → vault finalized │
└────────────────────────────────────────────────────────┘
Creates a moderator account tied to a base/quote mint pair. Moderators can host multiple proposals.
Creates a proposal with 2 options. Initializes a vault (via CPI) and creates AMM pools for each option. Proposal starts in Setup state.
Adds additional options to a proposal (up to 6 total). Creates the corresponding conditional mints in the vault and a new AMM pool.
Activates the proposal for trading:
- Activates the vault
- Deposits base and quote tokens (mints conditional tokens)
- Seeds liquidity to all AMM pools
Proposal transitions to Pending state and the countdown begins.
After the proposal duration elapses:
- Cranks TWAP on each pool
- Determines winner by highest TWAP
- Ceases trading on all pools
- Finalizes vault with winning index
Proposal transitions to Resolved(winning_idx).
Allows the proposal creator to withdraw their liquidity from all pools after finalization.
A simple light-weight constant-product AMM with a manipulation-resistant Time-Weighted Average Price (TWAP) oracle. Designed for conditional token markets where the TWAP determines outcomes.
SWAP
Token A ──────────────────────────────────► Token B
│ │
│ ┌─────────┐ │
└─────────────►│ Pool │◄─────────────────┘
│ x * y=k │
└────┬────┘
│
│ crank_twap (rate-limited)
▼
┌─────────────┐
│ TWAP Oracle │
│ ┌───────┐ │
│ │ price │──┼──► bounded observation
│ └───────┘ │ │
│ │ ▼
│ cumulative_observations += obs * elapsed
└─────────────┘
Creates a new liquidity pool with configurable fee and TWAP parameters. Takes an optional liquidity_provider parameter:
- If provided: only that address can add/remove liquidity
- If omitted: defaults to
admin
Only the designated liquidity_provider can deposit or withdraw tokens. This single-provider model ensures controlled liquidity for conditional token markets.
Constant-product swap with configurable fee (basis points). Fee collected in token A (mint_a).
Updates the TWAP oracle with current pool price. Manipulation-resistant design:
- Rate limited: 60-second minimum between recordings
- Bounded movement: Observation moves toward price capped by
max_observation_delta - Warmup period: TWAP accumulation begins after
warmup_durationseconds
Admin freezes the pool, preventing further swaps. Used when finalizing proposals.
A Solana program that enables conditional token markets by allowing users to deposit base or quote tokens into a vault and receive conditional tokens for each possible outcome. Users can trade these conditional tokens on external markets, and once the vault is finalized with a winning outcome, holders of the winning conditional tokens can redeem them 1:1 for the underlying assets.
DEPOSIT
User Base/Quote Tokens ─────────────────────► Vault
│
│ receives
▼
┌─────────────────────────────────┐
│ N Conditional Base/Quote Tokens │
│ ┌────┐ ┌────┐ ┌────┐ │
│ │ 0 │ │ 1 │ ... │ N │ │
│ └────┘ └────┘ └────┘ │
└─────────────────────────────────┘
│
│ WITHDRAW (min balance burned) or REDEEM (after finalization)
▼
User Base/Quote Tokens ◄───────────────────── Vault
Creates a vault with 2 options. Use addOption to add more options (up to 8 total).
If using more than 4 options, user vault actions (deposit, withdraw, redeem) require compute budget limit >450k CU. The SDK's higher-level functions already include this compute budget instruction and wrap/unwrap SOL instructions.
Sets the vault state to "Active". This enables withdrawals & deposits. Disables adding additional options.
Sets the vault state to "Finalized" with a winning index — the index of the winning conditional mint. Disables withdrawals & deposits. Allows users to redeem winnings.
User deposits base or quote separately. User receives N conditional tokens (one for each option). Base and quote are completely separate — each has its own set of N conditional mints.
User withdraws base or quote separately. User receives the minimum balance across all N conditional tokens (for that type). Only that amount is burned from each, and the user keeps any excess.
User redeems base or quote separately. After the vault is finalized with a winning outcome:
- All N conditional token accounts (for that type) are burned and closed
- User receives underlying tokens 1:1 for their winning conditional token balance
- Losing conditional tokens are burned with no payout