Docs

Contracts and interfaces

Everything an integrator needs: the addresses, the calls, the events and the numbers. Values marked live are read off the chain when this page loads.

Addresses

ContractAddress

Metrics

The registry, as it stands on chain.

IdNameUnitDirectionGap between eventsBar

Launching

struct Subject { string ticker; string company; uint256 metricId; string peer; uint64 firstEventAt; }
struct Meta { string logo; string description; string twitter; string telegram; string website; }
struct LaunchArgs { Subject subject; string name; string symbol; Meta meta; address feeWallet; uint256 devBuy; uint256 minOut; }

function launch(LaunchArgs calldata a) external payable returns (address market, address curve);
function keyOf(string ticker, uint256 metricId, string peer) pure returns (bytes32);
function marketOfKey(bytes32) view returns (address);
function predict(address creator, bytes32 key) view returns (address market);
function page(uint256 offset, uint256 limit) view returns (CompanyMarket.View[]);

msg.value must equal launchFee + devBuy. The ticker is 1 to 8 characters of A-Z, 0-9 or .; the peer is required by metrics that need one and refused by the rest. firstEventAt must be ahead of now and within the metric's maxGap. A zero feeWallet means the caller.

Trading

function buy(uint256 minTokensOut) payable returns (uint256);
function sell(uint256 tokensIn, uint256 minEthOut) returns (uint256);
function quoteBuy(uint256 ethIn) view returns (uint256 tokensOut, uint256 fee, uint256 spent);
function quoteSell(uint256 tokensIn) view returns (uint256 ethOut, uint256 fee);
function migrate();                         // disabled until the pool adapter is live
function sweep() returns (uint256 burned);  // permissionless after migration
function claimCreatorFees(); function claimProtocolFees();

Readings

// on the oracle
function propose(bytes32 id, int256 value, uint64 nextAt) payable;  // after the event, msg.value == bond()
function dispute(bytes32 id) payable;                               // inside the window, msg.value == the standing bond
function finalise(bytes32 id);                                      // after the window, anyone
function answerOf(bytes32 id) view returns (bool isFinal, int256 value, uint64 nextAt);

// on the market
function questionId(uint256 epoch) view returns (bytes32);  // keccak256(abi.encode(market, epoch))
function settle();                                          // permissionless, once the answer is final
function flush();                                           // reserved until the pool adapter is live
function history() view returns (Reading[]);

A reading is an int256 in the metric's fixed point: with two decimals, 2600000 is 26,000.00. nextAt must fall between now + minGap and now + maxGap of the metric, measured at the moment of the proposal.

Numbers

Total supply1,000,000,000 per coin
Sold on the curve800,000,000; the rest stays reserved for reviewed migration
Fee per curve trade1.00%: 0.50 pot, 0.30 creator, 0.20 protocol
Pool migrationNot enabled in this mainnet build yet
Oracle bondlive
Challenge windowlive
Launch feelive

Events

event Launched(address indexed market, bytes32 indexed key, address indexed creator, address curve, uint256 metricId, string ticker, uint64 firstEventAt);
event Settled(uint256 indexed epoch, int256 value, bool beat, uint256 potSpent, uint64 nextEventAt);
event Bought(address indexed buyer, uint256 ethIn, uint256 tokensOut, uint256 fee);
event Sold(address indexed seller, uint256 tokensIn, uint256 ethOut, uint256 fee);
event PotBurned(uint256 ethIn, uint256 tokensBurned);
event Proposed(bytes32 indexed id, address indexed proposer, int256 value, uint64 nextAt);
event Disputed(bytes32 indexed id, address indexed disputer);
event Finalised(bytes32 indexed id, int256 value, uint64 nextAt);
event Ruled(bytes32 indexed id, bool proposerWins, int256 value, uint64 nextAt);