This document describes the business entrypoints and their arguments. All argument lists are represented in Michelson as location retaining right combed trees.
FA2 entrypoints are at the time unimplemented, making the internal tokens untransferrable. Internal structure is in place to implement a standard FA2 token interface.
Create a new prediction market
market_id
has to be unique
operation_details
market_id : nat
: An arbitrary identifier for the new marketexecution_deadline : timestamp
: Time after which to consider the operation stale, and abort it
metadata
ipfs_hash : string option
: An optional hash for relevant metadata of the market stored in ipfsdescription : string
: A human-readable description of the market questionadjudicator : address
: The address authorized to resolve the marketcurrency
: Union type describing the token used as the market currency, of the following options:FA12 : address
: The address of an FA1.2 token contractFA2
token_address : address
token_id : nat
auction_period_end : timestamp
:bet
: Details of the creator's initial betpredicted_probability : fixedpoint
: A fixed point representation of the probability of a Yes outcome predicted in the betquantity : nat
: The amount of currency tokens placed down for the bet
Place a new bet in the auction (or augmenting an existing one)
- The market has to exist
- The market must not have been cleared
operation_details
market_id : nat
: Arbitrary market identifierexecution_deadline : timestamp
: Time after which to consider the operation stale, and abort it
bet
predicted_probability : fixedpoint
: A fixed point representation of the probability of a Yes outcome predicted in the betquantity : nat
: The amount of currency tokens placed down for the bet
Clear a market after the auction phase
- The market has to exist
- The market must not have been cleared
auction_period_end
has to be in the past
market_id : nat
Withdraw allocated tokens from a bet in the auction
- The market has to exist
- The market must have been cleared
market_id : nat
Enter or exit the market by minting or burning outcome token pairs in exchange for market currency tokens
- The market has to exist
- The market must have been cleared
- The market must not have been resolved
operation_details
market_id : nat
: Arbitrary market identifierexecution_deadline : timestamp
: Time after which to consider the operation stale, and abort it
direction
: Union type of the following optionsMint
: Enter the market by paying currency tokensBurn
: Exit the market and receive currency tokens
amount : nat
: The amount of outcome token pairs to mint or burn
Swap one outcome token through the liquidity pool for its opposing pair as a fixed input swap operation
- The market has to exist
- The market must have been cleared
- The market must not have been resolved
operation_details
market_id : nat
: Arbitrary market identifierexecution_deadline : timestamp
: Time after which to consider the operation stale, and abort it
token_to_sell
: Union type of the following optionsYes
No
fixed_input : nat
: The amount of token to sellmin_output : nat
: Minimum amount of bought token accepted
Add or remove liquidity from the liquidity pool at the current ratio
- The market has to exist
- The market must have been cleared
- The market must not have been resolved
intended_token_amounts
must be greater than 0min_token_amounts
must be greater than 0
operation_details
market_id : nat
: Arbitrary market identifierexecution_deadline : timestamp
: Time after which to consider the operation stale, and abort it
intended_token_amounts
: Intended amounts of tokens to add as liquidity, committing to a market pricetoken_a : nat
: Yes tokentoken_b : nat
: No token
min_token_amounts
: Minimal token amounts to add, defining accepted price slippagetoken_a : nat
: Yes tokentoken_b : nat
: No token
Add or remove liquidity from the liquidity pool at the current ratio
- The market has to exist
- The market must have been cleared
- The market must not have been resolved
operation_details
market_id : nat
: Arbitrary market identifierexecution_deadline : timestamp
: Time after which to consider the operation stale, and abort it
amount : nat
: The amount of liquidity tokens to burn for outcome tokensmin_token_amounts
: Minimum token amounts acceptedtoken_a : nat
: Yes tokentoken_b : nat
: No token
Resolve the market to a known outcome
- The market has to exist
- The caller must be the market's
adjudicator
- The market must not have been resolved
market_id : nat
winning_prediction
: Union type of the following optionsYes
No
Claim winnings in market currency tokens from a resolved market. The sum received is a composite payout from burning tokens of the following types held by the caller:
- Winning outcome token
- Pool liquidity token (converted to winning outcome token through a remove liquidity operation)
- Liquidity provider time reward token
- Auction participant reward token
- The market has to exist
- The market must have been resolved
market_id : nat