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 curve);
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();                         // permissionless, once graduated
function sweep() returns (uint256 burned);  // permissionless, once migrated
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();                                           // spends what a beat owed, once the pool exists
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 seeds the pool
Fee per curve trade1.00%: 0.50 pot, 0.30 creator, 0.20 protocol
Pool fee1.00%, tick spacing 200, full range, locked
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 Trade(address indexed trader, bool indexed isBuy, uint256 ethAmount, uint256 tokenAmount, uint256 fee, uint256 newReserve, uint256 newSold);
event PotSpent(uint256 ethIn, uint256 burnedAmount, bool onPool);
event Proposed(bytes32 indexed id, address indexed proposer, int256 value, uint64 nextAt, uint256 bond);
event Finalised(bytes32 indexed id, int256 value, uint64 nextAt, address indexed by);