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

AccountHolds
ConfigThe authority, the resolver key, the swap fee, the protocol share, the pause flag.
EventThe question, the quote mint, the close time, the resolution rule and the state: open, closed or resolved with its outcome.
VaultOne per event and mint. Holds the underlying and is the mint authority of its two branch mints.
PoolOne per event, branch and asset: a constant-product pool of the asset’s branch token against the quote’s.
OddsPoolOne per event: quote·YES against quote·NO.
LpPositionOne per event, asset and owner: shares in the YES pool and in the NO pool.
FeeVaultA program address no key signs for, holding the protocol’s share of swap fees.

Instructions

InstructionDoes
split, mergeMint or burn a matched pair of branch tokens against the vault.
swap, swap_oddsTrade in a branch pool or in the odds pool.
add_liquidity, remove_liquidityEnter or leave an asset’s two branch pools.
close_eventStop trading at the close time. Anyone can call it.
resolve_pyth, resolveSettle from a signed Pyth price, or from the resolver.
redeemBurn winning-branch tokens for the underlying, 1:1.
create_event, list_assetList an event and its assets.
initialize, collect_protocol_feesSet 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.