Program
One Anchor program, everett. Branch tokens are plain SPL tokens that any wallet shows and any program can hold.
Addresses
- Program
- Network
- Token program
- SPL Token
- Swap fee
- 0.30%
Accounts
| Account | Holds |
|---|---|
Config | The authority, the resolver key, the swap fee, the protocol share, the pause flag. |
Event | The question, the quote mint, the close time, the resolution rule and the state: open, closed or resolved with its outcome. |
Vault | One per event and mint. Holds the underlying and is the mint authority of its two branch mints. |
Pool | One per event, branch and asset: a constant-product pool of the asset’s branch token against the quote’s. |
OddsPool | One per event: quote·YES against quote·NO. |
LpPosition | One per event, asset and owner: shares in the YES pool and in the NO pool. |
FeeVault | A program address no key signs for, holding the protocol’s share of swap fees. |
Instructions
| Instruction | Does |
|---|---|
split, merge | Mint or burn a matched pair of branch tokens against the vault. |
swap, swap_odds | Trade in a branch pool or in the odds pool. |
add_liquidity, remove_liquidity | Enter or leave an asset’s two branch pools. |
close_event | Stop trading at the close time. Anyone can call it. |
resolve_pyth, resolve | Settle from a signed Pyth price, or from the resolver. |
redeem | Burn winning-branch tokens for the underlying, 1:1. |
create_event, list_asset | List an event and its assets. |
initialize, collect_protocol_fees | Set the program up, and turn the fee vault’s winning tokens into the quote. |
A conditional buy is split and swap in one transaction. Closing a position is swap and merge.
Composes with
- SPL Token, for every branch mint.
- The Pyth receiver, for oracle events.
- Jupiter, for the swap the protocol’s fee share makes.