NAV
Code

Overview

Augur is a decentralized prediction market platform that runs on Ethereum.

The stable Augur application is built and hosted at https://app.augur.net. If you want to use or help test Augur, you do not need to download or install anything! Just go to https://app.augur.net and start using it. (If you want to use our cutting-edge development client, this is maintained at https://dev.augur.net – warning, we push changes to augur-dev.firebaseapp.com pretty rapidly, so it can be a bit buggy! We suggest simply using https://app.augur.net for a more stable experience.)

Augur has its own dedicated Stack Exchange, which allows anyone to ask questions about Augur and get answers to those questions. It’s a great resource to find the answers for questions you might have that aren’t answered directly in these documents. Additionally, you can chat with us on Discord. If you’d like to join the conversation, just go to invite.augur.net and sign up. Most questions are best asked in the #dev or #general channels.

Getting Started

If you would like to help develop Augur, you’ll need to build the client from source. To do this, first install Node.js, and Git.

Next, clone the Augur GitHub repository by opening a terminal window and typing:

$ git clone https://github.com/AugurProject/augur.git

Navigate to the newly created augur folder by running:

$ cd augur

Once this has been done, Augur’s dependencies will need to be installed. This can be done using npm or yarn. Both methods are detailed in the next sections.

If you plan on submitting a pull request to the Augur Project, please be sure to read through the Contributing section of these documents before submitting the request.

Using NPM

Node.js comes with a built in package manager called npm. npm is used to install dependencies for Augur, build the Augur project from source code, run tests, and start a web server to host Augur, among other things. To install Augur’s dependencies using npm, run the following command:

$ npm install

To build Augur from the source code, run:

$ npm run build

After building Augur from the source files, a local web server will need to be started. This can be done using the following command:

$ npm start

To enable hot-reloading (which automatically loads changes made locally), run the following instead of npm start:

$ npm run dev

Doing this is an easy way to do some hacking on the Augur source code and see the changes reflected in real time.

Now open a web browser and go to http://localhost:8080. This should load Augur’s most popular categories page.

Congratulations, you’re ready to start hacking!

Using Yarn

Some people prefer to use yarn instead of npm. To use yarn, execute the following command to install the Augur dependencies:

$ yarn

To build Augur from the source code, run:

$ yarn build

After building, the following command will start a local web server:

$ yarn start

To enable hot-reloading for development purposes, run the following instead of yarn start:

$ yarn dev

Finally, open a web browser and go to http://localhost:8080. This should load Augur’s most popular categories page.

Congratulations, you’re ready to start hacking!

Architecture

Augur is designed to work with a locally-running Ethereum node; however, if one is not available, Augur can be configured to use a hosted Ethereum node instead. A hosted Ethereum node is one that is hosted on a public server by the Augur development team. The sections below explain a bit about each setup and provide a diagram of what’s going on under the hood.

Local Ethereum Node

Running a local Ethereum node, such as Geth, while using Augur provides the best performance and overall experience. This is because Augur sends RPC requests to a hosted Ethereum node takes more time than sending them to a local node. To use a local Ethereum node with Augur, either download and run the Augur app locally, or simply visit https://app.augur.net, which is configured to automatically talk to a local node, if present.

Note to Geth users: Since Geth’s RPC server uses regular (unencrypted) HTTP, the Augur app must also use regular HTTP to communicate with a local Geth node.

Hosted Ethereum Node

Since many users may not wish to go to the trouble of running a full Ethereum node solely to use Augur, the Augur development team maintains a public (testnet during the beta) Ethereum node at https://eth9000.augur.net, which is used automatically by https://app.augur.net (and by local.augur.net if a local Ethereum node is not detected).

Trading

Augur allows anyone to create an openly tradable Market about any upcoming event. Augur maintains an Order Book for each of the Markets created. Any trader can place or take an Order on the Market’s Order Book. When placing an trade, that trade request will be Filled immediately if there is an Order on the Order Book that will fulfill it. If there is no matching Order, or if the trade request can only be partially Filled, the remainder of what wasn’t filled of the trade will be placed on the Order Book as an Order. Order Creators may cancel their Order to remove it from the Order Book. Orders are executed on a “first come, first served” basis.

The Augur UI offers users the best prices first when displaying the Order Book on each Market page. Orders are never executed at a worse price than the limit price set by the trader, however they can settle for better than the limit price. Orders can also be partially filled. The UI will automatically include multiple backup/fallback Orders to attempt to fill the Order in the event that the best Order was filled before the transaction was sent. These backup/fallback Orders are always within the limit price set by the trader.

Trading Example

Let’s use an example Binary Market trading on the “super big event” coming up. For this example, we want to go long on Outcome A. We would submit a trade request to buy 100 Shares of Outcome A with a limit price of 0.5 ETH, which will cost 50.0 ETH plus gas used to send the transaction.

If there are Orders on the Order Book that match our request for 100 Shares of Outcome A at a price of 0.5 ETH, or cheaper, then Augur will fill those Orders. We will now own 100 Shares of Outcome A and we will have lost 50.0 ETH plus gas cost.

If no Order is available on the Order Book that would partially or completely fill our trade request then a Bid Order would be placed on the Order Book. Whenever an Order is placed on the Order Book something of value is escrowed by the Market. In our example, the value we are giving to the Market to place our bid would be our 50.0 ETH. If we were attempting to sell Shares that we currently owned then we would escrow the Shares instead of ETH. If we cancel our Order we can get our 50.0 ETH back, the only currency lost would be the gas used to pay to place the trade and cancel the trade. When a Filler decides to fill our Order on the Order Book, we will get our 100 shares of Outcome A transferred to us.

For more information on how to trade using the Augur API, check the trade section of the Transaction API.

Settlement Fees Explained

Creating a Market costs a small amount of ETH. Without some incentive people won’t create Markets as they get nothing in return for the ETH they spent to create it. Augur solves this problem by allowing Market Creators to set a Creator Fee for their Market. The Creator Fee must be between 0 and 50 percent. Once a Market is created the Creator Fee cannot be raised, only lowered.

Augur also extracts Fees to help support the Reporting System known as the Reporting Fee. Settlement Fees refer to both the Creator Fee and the Reporting Fee combined. The Reporting Fee isn’t set by the Market Creator, like the Creator Fee, but is instead set by an automated Augur Market.

Augur will automatically create a Market once every Thirty (30) days to use as a data feed for the REP price. This Market will act just like a regular Market and it will go through the Dispute Rounds process in order to be Resolved. Once the REP price is known, Augur can calculate the REP Market cap and the appropriate Reporting Fee to ensure the security of the Reporting System.

The Augur contracts will track the open interest of all Markets passively as people interact with Augur, which allows Augur to always have access to the open interest numbers. Once the open interest and REP market caps are known Augur can then determine wether the Reporting Fee is too high or too low. Augur then calculates the new Reporter Fee using the following formula:

current_reporting_fee * (augur_open_interest * 5 / rep_market_cap)

The Reporting Fee will be updated once every 30 days, or once every Reporting Window. If updates where to occur too frequently, the market will not have time to adjust to the new fees. If we update too infrequently, then we are at risk of the security model becoming invalid due to a sudden growth in Augur that isn’t yet accounted for by the fee system.

Settlement Fees are extracted anytime Settlement occurs and Shares are destroyed. This can happen for two reasons:

Selling a Complete Set can be thought of as exiting your market Position. Complete Sets are a set of Shares for each Outcome. Complete Sets are priced differently for each Market, and are determined by the Number of Ticks, which represents all possible price points, or Ticks, for a Market as well as the amount of attoeth it costs to purchase a Complete Set for the Market. If you own a set of Shares in each Outcome, you can Settle those Shares and receive ETH back for their value minus Settlement Fees.

Calculating Trades

In this section we break down all potential trade situations and their expected result. There are two types of Orders, Bid Orders (requesting to buy) and Ask Orders (requesting to sell). In our examples below we will go over all the potential trade possibilities around Bid Orders and Ask Orders. Orders are placed on the Order Book by Order Creators and contain four important details: The Creator of the Order, the price of the Order, The amount of Shares or ETH escrowed, and the Outcome we plan to trade on. The price can be any value between 0 and the Number of Ticks. The calculations below use num_shares as the number of Shares the Order is requesting, price as the price per Share for the Order, outcome for the Outcome our Order is trading on, num_ticks as the Number of Ticks, and fee_rate as the Settlement Fees extracted during the Settlement of Shares.

The Formulas for determining how much opening a Long or Short position costs are as follows:

Cost of Opening a Long Position(open_long_position_cost):

num_shares * price

Cost of Opening a Short Position(open_short_position_cost):

num_shares * (num_ticks - price)

The formulas for determining the payout and the fees required to be paid by each side of an Order are as follows:

Total payout for closing a Long Position(total_payout_closing_long):

num_shares * price / num_ticks

Total payout for closing a Short Position(total_payout_closing_short):

num_shares * (num_ticks - price) / num_ticks

Fees paid for closing a Long Position(long_position_fees):

total_payout_closing_long * fee_rate

Fees paid for closing a Short Position(short_position_fees):

total_payout_closing_short * fee_rate

Below are some more examples of specific order situations and their results:

Bid Order Trading

Creator of Bid Order Filler of Bid Order
Escrows: num_shares of all outcomes except outcome
Order Details: price, creator, outcome, escrow
Intent: close a short position for outcome.
Sends: open_short_position_cost ETH.
Intent: open a short position for outcome.
Gains: total_payout_closing_short ETH.
Loses: num_shares in all outcomes except outcome.
Gains: num_shares in all outcomes except outcome.
Loses: total_payout_closing_short ETH.
Creator of Bid Order Filler of Bid Order
Escrows: open_long_position_cost ETH
Order Details: price, creator, outcome, escrow
Intent: open a long position for outcome.
Sends:: open_short_position_cost ETH.
Intent: open a short position for outcome.
Gains: num_shares of outcome.
Loses: open_long_position_cost ETH
Gains: num_shares of all outcomes except for outcome.
Loses: open_short_position_cost ETH.
Creator of Bid Order Filler of Bid Order
Escrows: num_shares of all outcomes except outcome
Order Details: price, creator, outcome, escrow
Intent: close a short position for outcome.
Sends: num_shares of outcome.
Intent: close a long position for outcome.
Gains: total_payout_closing_short - short_position_fees ETH.
Loses: num_shares in all outcomes except outcome.
Gains: total_payout_closing_long - long_position_fees ETH.
Loses: num_shares in outcome.
Creator of Bid Order Filler of Bid Order
Escrows: open_long_position_cost ETH
Order Details: price, creator, outcome, escrow
Intent: open a long position for outcome.
Sends: num_shares of outcome.
Intent: close a long position for outcome.
Gains: num_shares in outcome.
Loses: open_long_position_cost ETH
Gains: total_payout_closing_short ETH.
Loses: num_shares of outcome.

Ask Order Trading

Creator of Ask Order Filler of Ask Order
Escrows: num_shares of outcome.
Order Details: price, creator, outcome, escrow
Intent: close a long position for outcome.
Sends: open_long_position_cost ETH.
Intent: open a long position for outcome.
Gains: total_payout_closing_long ETH.
Loses: num_shares in outcome
Gains: num_shares of outcome.
Loses: open_long_position_cost ETH
Creator of Ask Order Filler of Ask Order
Escrows: open_short_position_cost ETH.
Order Details: price, creator, outcome, escrow
Intent: open a short position for outcome.
Sends: open_long_position_cost ETH.
Intent: open a long position for outcome.
Gains: num_shares in all outcomes except outcome.
Loses: open_short_position_cost ETH
Gains: num_shares of outcome.
Loses: open_long_position_cost ETH.
Creator of Ask Order Filler of Ask Order
Escrows: num_shares of outcome.
Order Details: price, creator, outcome, escrow
Intent: close a long position for outcome.
Sends: Shares in all outcomes except outcome.
Intent: close a short position for outcome.
Gains: total_payout_closing_long - long_position_fees ETH.
Loses: num_shares of outcome
Gains: total_payout_closing_short - short_position_fees ETH.
Loses: num_shares in all outcomes except outcome.
Creator of Ask Order Filler of Ask Order
Escrows: open_short_position_cost ETH.
Order Details: price, creator, outcome, escrow
Intent: open a short position for outcome.
Sends: Shares in all outcomes except outcome.
Intent: close a short position for outcome.
Gains: num_shares in all outcomes except outcome.
Loses: open_short_position_cost ETH.
Gains: total_payout_closing_short ETH.
Loses: num_shares in all outcomes except outcome.

Reporting

Once the event underlying an Augur Market occurs, the Outcome needs to be determined in order for the Market to Finalize and begin Settlement. The Outcomes of events are reported by Augur’s Decentralized Oracle, which consists of profit-motivated Reporters reporting on the Outcome of events. Anyone who owns REP tokens may participate in the reporting and disputing of Outcomes. Reporters whose Reports concur with consensus are financially rewarded, while those whose Reports do not concur with consensus are financially penalized.

Fee Windows

Augur’s reporting system runs on a cycle of consecutive 7-day long Fee Windows. Any Reporting Fees collected by Augur during a given Fee Window are added to a Reporting Fee Fee Pool for that Fee Window. At the end of the Fee Window, the Reporting Fee Pool is paid out to REP holders who participated in that reporting process. Reporters receive rewards in proportion to the amount of REP they Staked during that Fee Window. Participation includes: Staking during an Initial Report, Disputing a Tentative Outcome, or purchasing a Participation Token.

Participation Tokens

During any Fee Window, REP holders may purchase any number of Participation Tokens for one attoREP each. At the end of the Fee Window, they may redeem their Participation Tokens for one attoREP each, in addition to a proportional share of the Fee Window’s Reporting Fee Pool.

It is important that REP holders are ready to participate in Market resolution the event of a threatened Fork of the Oracle. The Participation Token provides an incentive for REP holders to monitor the platform at least once per week, and, thus, be ready to participate if the need arises. Even REP holders who don’t want to participate in the reporting process are incentivized to check in with Augur once per 7-day Fee Window in order to buy Participation Tokens and collect fees. This regular, active checking in means they will be familiar with how to use Augur, will be aware of Forks when they occur, and thus should be more ready to participate in Forks when they happen.

Reporting States

The Reporting Diagram above is a high level overview of Reporting implemented by Augur. There are two ways for a Market to attempt to Finalize: if the Tentative Outcome was not disputed during a Dispute Round, or (rarely) during a Fork. Augur Markets have 6 potential states after creation. The potential states, or “phases”, of a Market are as follows:

  1. Designated Reporting
  2. Open Reporting
  3. Waiting for the Next Fee Window to Begin
  4. Dispute Round
  5. Fork
  6. Finalized

Designated Reporting

When creating a Market, the Market Creator is required to choose a Designated Reporter and post a No-Show Bond. During the Designated Reporting Phase (1), the Market’s Designated Reporter has at most three days to Report on the Outcome of the event. If the Designated Reporter fails to Report within the allotted 3 days, then the Market Creator forfeits the No-Show Bond, and the Market automatically enters the Open Reporting Phase (2).

If the Designated Reporter submits a Report on time, then the No-Show Bond is returned to the Market Creator. The Designated Reporter is required to post the Designated Reporter Stake on the Reported Outcome, which it will forfeit if the Market finalizes to any outcome other than the one they Reported. As soon as the Designated Reporter submits its Report, the Market enters the Waiting for the Next Fee Window to Begin Phase (3), and the Reported Outcome becomes the Market’s Tentative Outcome.

Open Reporting

If the Designated Reporter fails to Report within the allotted 3 days, then the Market Creator forfeits the No-Show Bond, and the Market immediately enters the Open Reporting Phase. As soon as the Market enters the Open Reporting Phase, every Augur participant has the opportunity to report the Outcome of the Market. In the event that the Designated Reporter fails to report, we refer to the first participant who Reports the Outcome of a Market as the Market’s First Public Reporter.

The Market’s First Public Reporter receives the No-Show Bond that was forfeited by the Market Creator when the Designated Reporter failed to Report. The No-Show Gas Bond is given directly to the First Public Reporter to cover their gas costs. The Designated Report No-Show REP Bond is given to the First Public Reporter in the form of Stake on their Reported Outcome.

The First Public Reporter does not need to Stake any of their own REP when Reporting the Outcome of the Market. Because the No-Show REP Bond is applied as Stake on the First Public Reporter’s chosen Outcome, they may claim the No-Show REP Bond only if their Reported Outcome ultimately agrees with consensus. In this way, any Market whose Designated Reporter fails to Report is expected to have its Outcome reported by someone very soon after entering the Open Reporting Phase.

Once a First Public Report has been received, the Reported Outcome becomes the Market’s Tentative Outcome, and the Market enters the Waiting for the Next Fee Window to Begin Phase (3).

Waiting for the Next Fee Window to Begin

Once the market receives its Initial Report – whether by the Designated Reporter or by a First Public Reporter from the community – the Market enters the Waiting for the Next Fee Window to Begin Phase. During this phase, Reporting for the Market is on hold until end of the current Fee Window. Once the current Fee Window comes to an end, the Market enters the Dispute Round Phase (4).

Dispute Round

The Dispute Round is a 7-day period, during which any REP holder has the opportunity to Dispute the Market’s Tentative Outcome. A Dispute consists of staking REP (referred to as Dispute Stake in this context) on a some outcome other than the Market’s current Tentative Outcome. A Dispute is successful if the total amount of Dispute Stake on some outcome meets the Dispute Bond size required for the current round.

The Dispute Bonds need not be paid in their entirety by a single user. Augur allows participants to crowdsource the Dispute Bonds. Any user who sees an incorrect Tentative Outcome can Dispute that Outcome by Staking some REP on some Outcome other than the Tentative Outcome. If, collectively, some Outcome (other than the Tentative Outcome) receives enough Dispute Stake to fill its Dispute Bond, the current Tentative Outcome will be successfully Disputed.

In the case of a successful Dispute, the Market will either undergo another Dispute Round or it will enter the Fork Phase (5). If the size of the filled Dispute Bond is greater than the Fork Threshold, then the market will enter the Fork Phase. If the size of the filled Dispute bond is less than the Fork Threshold, then the newly chosen Outcome becomes the market’s new Tentative Outcome, and the market undergoes another Dispute Round.

If no Dispute is successful during the 7-day Dispute Round, the Market enters the Finalized State (6) with its Tentative Outcome accepted as the Final Outcome.

All unsuccesful Dispute Stake is returned to the original owners at the end of every Dispute Round. All successful Dispute Stake is applied to the Outcome it championed, and will remain there until the Market is Finalized (or until a Fork occurs in some other Augur Market). All Dispute Stake (whether successful or unsuccessful) will receive a portion of the reward pool from the current Fee Window.

Fork

The Fork Phase is a special state that lasts up to 60 days and is intended to be an exceedingly rare occurrence. The outcome of a Fork cannot be Disputed. The Disputed Market that caused the Fork, referred to as the Forking Market, enters the Finalized State (6) at the end of the Fork Phase. For more information on the Forking process, refer to the Forking Details section.

Finalized

A Market enters the Finalized State anytime it passes through a 7-day Dispute Round without having its Tentative Outcome successfully Disputed. The Outcome of a Fork cannot be Disputed and is always considered final at the end of the Forking Phase. Once a Market is Finalized, traders can Settle their Positions directly with the Market. When a Market enters the Finalized State, we refer to its chosen Outcome as the Final Outcome.

Designated Reporting Details

During the creation of a Market, a Market Creator must assign a Designated Reporter. Designated Reporting is designed to be a quick way to bring about a Market Resolution. This is pleasing to Traders who want to Settle their Shares and collect their earnings as soon as possible after a Market’s End Time has passed. The Designated Reporting Phase begins immediately following the End Time of a Market. The result of Designated Reporting is still Challengeable with a Dispute Bond so if the Designated Reporter does incorrectly Report the Outcome of the Market, it can be adjudicated by Dispute Rounds. With the dispute system in place, we don’t actually lose any security or truth as an incorrect Tentative Outcome for a Market can be Challenged.

The Designated Reporting Phase lasts a maximum of three (3) days and ends immediately when the Designated Reporter submits their Report and the Tentative Outcome is set for the Market.

If the Designated Reporter fails to Report within the Designated Reporting Phase, the No-Show REP Bond, the No-Show Gas Bond, and the Market is moved into the Open Reporting Phase. These No-Show Bonds are then used to help pay for the gas costs and add to the REP Staked by the First Public Reporter.

If the Designated Reporter does successfully Report within the Designated Reporting Phase, the No-Show REP Bond and the No-Show Gas Bond is refunded to the Market Creator immediately and the Market enters the Dispute Round Phase, which lasts for seven (7) days. During this 7-day period, any REP holder can Stake REP on an outcome other than the Tentative Outcome and receive a proportionate amount of Participation Tokens in return. The Participation Tokens allow the holder to collect fees at the end of the current Fee Window. The Staked REP goes toward filling the Dispute Bond for the Outcome on which it was Staked. If that outcome gets enough REP Staked on it to fill the Dispute Bond size, that Outcome becomes the new Tentative Outcome, and the Market returns to the Waiting for the Next Fee Window to Begin Phase (or Forks if the Outcome gets more than the Fork Threshold Staked on it). If the Market is left unchallenged for the duration of the Dispute Round Phase, then the Market’s Tentative Outcome becomes the Final Outcome and the Market is considered Finalized, allowing the Settlement of Shares.

Fee Window Details

Fee Windows continually occur and last for seven (7) days. During a Fee Window, any REP holder is able to Stake REP on any Outcome other than the Tentative Outcome. By doing so, they receive an equal number of Participation Tokens in return, and the REP they Stake goes toward to a Dispute Bond to Challenge the Tentative Outcome of the Market. In order to earn fees as a REP holder in the current Fee Window, users need to participate in the Market’s Dispute Round in some way, such as submitting a Designated Report or First Public Report, Disputing the Tentative Outcome (i.e., staking on an outcome other than the Tentative Outcome), or simply purchasing Participation Tokens directly.

Any fees collected by Augur during a given Fee Window are added to a Reporting Fee Pool for that Fee Window. The Reporting Fee Pool is used to reward REP holders who participate in Augur’s reporting process. At the end of the Fee Window, the Reporting Fee Pool is paid out to holders of Participation Tokens in proportion to the number of Participation Tokens they hold.

Markets are placed into the next available Fee Window once the Designated Reporter or First Public Reporter submits a Report. For example, if a Market’s Designated Report is submitted at 12:00 AM EST on January 3rd, 2053 and a Fee Window was just started on January 1st 2053, the Market would move into the next Fee Window that would be starting on January 8th, 2053, or 7 days since the start of the January 1st Window.

Any REP holder can participate in a Fee Window. In fact, in some cases, someone without any REP is able to successfully Report on Markets in the Open Reporting Phase. This case only occurs when the Market’s Designated Reporter fails to Report during the Designated Reporting Phase. In this situation, the first person to submit a Report can do so and Stake 0 REP on the Report. This is the true because the No-Show REP Bond is added to the First Public Reporter’s Stake, so in this case the Stake can be 0 as it will get the bond added to it. (The First Public Reporter must still pay the gas cost to submit the Report, but they will receive the No-Show Gas Bond once the Market Finalizes if the Outcome they picked becomes the Final Outcome.) This creates a race to be the First Public Reporter so as to attempt to get free REP from reporting correctly and earning the No-Show REP Bond.

Forking Details

The Market Resolution method of last resort is the Fork. Forks are initiated when a Market has its Tentative Outcome successfully Disputed during a Dispute Round by filling a Dispute Bond greater than the Fork Threshold. We refer to such a Market as a Forking Market.

When a Fork is initiated, the usual 7-day Fee window is interrupted, and the Forking Period begins.

Forking is a very disruptive process and is intended to be rare. They are disruptive because Augur needs to assume its Decentralized Oracle is under attack if a Fork occurs. Since Augur assumes it’s under attack, Reporting for all other non-Finalized Markets is put on hold until the end of the Forking Period. The Forking Period is much longer than the usual Fee Window so that there can be ample time for REP holders and exchanges to prepare for a Fork. The Forking process has final jurisdiction; a Fork’s outcome cannot be disputed.

Every Augur Market exists in some Augur Universe. When Augur first launches, there will be only one Universe — the Genesis Universe. Users will be required to migrate their REP from the legacy REP contract into the Genesis Universe in order for their REP to be used with Augur. Importantly, REP can be used to Report on Outcomes (and thus earn fees) only if it exists in the same Universe as the Market on which it is reporting. When Augur first launches, all Markets and all REP will exist in the Genesis Universe.

When a Market Forks, new Universes are created. Forking creates a new Child Universe for each possible Outcome of the Forking Market (including the Invalid Outcome). A Binary Market, for example, has 3 possible outcomes: A, B, and Invalid. Thus a Binary Forking Market will create 3 new Child Universes: Universe A, Universe B, and Universe Invalid. Initially, these newly created Universes are empty; they contain no markets or REP tokens.

Once a Fork is initiated, the Parent Universe becomes permanently Locked. Markets are always tradable, no matter what state they are in or what Universe. However, while trading can still take place in the Parent Universe, no new Markets may be created, and no reporting rewards may be paid out there. In order for Markets or tokens in the Locked Universe to be useful, they must first be migrated to a Child Universe.

Holders of REP tokens in the Parent Universe may migrate their tokens to a Child Universe of their choice. This choice should be considered carefully, because migration is one-way; it cannot be reversed. Tokens cannot be sent from one sibling Universe to another. Migration is a permanent commitment of REP tokens to a particular Market Outcome. REP tokens sent to different Child Universes ought to be considered entirely separate currencies, and exchanges ought to list them as such.

When a Fork is initiated, all REP Staked on all non-Forking Markets is unstaked so that it is free to be migrated to a Child Universe during the Forking Period.

Whichever Child Universe receives the most migrated REP by the end of the Forking Period becomes the winning Universe, and its corresponding Outcome becomes the Final Outcome of the Forking Market. All un-Finalized Markets in the Parent Universe are automatically migrated to the Winning Universe and — if they have received an Initial Report — are reset back to the beginning of their first Dispute Round. The Fork is then complete and the regular 7-day Fee Window cycle continues.

There are a few important things to note about the Forking process:

First, there is no time limit on migrating tokens from the Parent Universe to a Child Universe. Tokens may be migrated after the Forking Period; they simply will not count towards the determination of the Winning Universe. To encourage greater participation during the Forking Period, all token holders who migrate their REP during the Forking Period will receive 5% additional REP in the Child Universe to which they migrated. This reward is paid for via currency inflation.

Second, Reporters that have Staked REP on one of the Forking Market’s Outcomes cannot change their position during a Fork. That is, REP that was Staked on an Outcome in the Parent Universe can be migrated only to the Child Universe that corresponds to that Outcome. For example, if a Reporter helped fulfill a successful Dispute Bond in favor of Outcome A during some previous Dispute Round, then the REP they have Staked on Outcome A can only be migrated to Universe A during a Fork.

Third, sibling Universes are entirely disjoint. REP tokens that exist in one Universe cannot be used to Report on events or earn rewards from Markets in another Universe. Only REP belonging to a Universe is valid REP to use within that Universe. Migrating REP from the Parent Universe to a Child Universe can be thought of as a permanent conversion of Parent Universe REP into Child Universe REP. Since users presumably will not want to create or trade on Markets in a Universe whose Oracle is untrustworthy, REP that exists in a Universe that does not correspond to objective reality is unlikely to earn its owner any fees, and therefore should not hold any significant market value. Thus REP tokens migrated to a Universe which doesn’t correspond to objective reality are effectively “burned” in the sense that they should hold no market value, regardless of whether or not the objectively false Universe ends up being the Winning Universe after a Fork.

API Overview

augur.js is a JavaScript SDK that is the developer-facing component of Augur’s middleware. It can be used to query for information about Augur’s Markets and interact with Augur’s smart contracts, and it is the recommended way to interact with Augur from a custom application.

The documentation for augur.js is divided into four sections: the Simplified API, the Call API, the Transaction API, and the Events API. The Simplified API provides general information about Markets within Augur, and many of its functions require a connection to an Augur Node. The Call and Transaction APIs provide direct mappings to Augur’s smart contract functions via the augur.api object. The Call API uses eth_call to make “get” requests for information stored on the blockchain. The Transaction API uses eth_sendTransaction to make “set” requests to the blockchain in order to modify the blockchain’s information in some way, like creating a new Order on the Order Book. The Events API enables listening for certain logged events and searching for them. The Call, Transaction, and Events APIs do not require a connection to an Augur Node. Each of these four components of augur.js is covered in greater detail in their respective sections below.

This API Overview section explains how to add augur.js to a custom application and how to connect it to an Ethereum node and an Augur Node. It also covers how augur.js’ account management works, how numbers should be used in augur.js, how to load and create Markets, and debugging options.

Augur Node

Anyone wishing to query for information about Augur’s markets will need to use the augur.js Simplified API, which requires a connection to an Augur Node for many of its functions. Augur Node is a standalone application that scans the Ethereum blockchain for all Augur event logs and stores them to a SQLite or PostgresSQL database.

Instead of looking up information about Augur-related events directly on the Ethereum blockchain, the Simplified API sends query requests to an Augur Node’s database. This is because looking up information directly on the blockchain can be a slow and difficult process, especially when sorting is required. For example, to run a query for all Markets created by a specific user, sorted by volume and limited to 100 results, would require scanning the blockchain for all Market creation events by that user, saving the results locally, querying each Market to obtain its volume, saving those results locally, and then sorting the Markets created by the user and discarding everything after the first 100 results. This would require a large number of RPC requests and would take a long time to complete.

To alleviate this problem, the Simplified API executes queries by submitting an RPC request to an Augur Node that is either running locally or remotely (hosted). The Augur Node then runs the request against its database and returns the result. This allows queries to be run on Augur much more quickly than would otherwise be possible.

To set up a local Augur Node, follow the instructions described in the Augur Node GitHub repository. Once a local Augur Node is running (or if the websocket address of a hosted node is known), a connection to it can be established by specifying the websocket address as shown by the JavaScript sample code in the Getting Started with augur.js section.

Getting Started with augur.js

// After installing, just require augur.js to use it.
var Augur = require('augur.js');
var augur = new Augur();

var ethereumNode = { 
  httpAddresses: [
    "http://127.0.0.1:8545", // local http address for Geth node
    "https://eth9000.augur.net" // hosted http address for Geth node
  ],
  wsAddresses: [
    "ws://127.0.0.1:8546", // local websocket address for Geth node
    "wss://ws9000.augur.net" // hosted websocket address for Geth node
  ]
  // ipc addresses can also be specified as:
  // ipcAddresses: [ ... ]
};
// To connect to a hosted Augur Node instead of a local Augur Node, substitute its websocket address below.
var augurNode = "ws://127.0.0.1:9001"; // local websocket address for an Augur Node

// Attempt to connect to a local Ethereum node
// If that fails, fall back to the hosted Ethereum node
augur.connect({ ethereumNode, augurNode }, function (vitals) { /* ... */ });
// example vitals object:
vitals = {
  networkID: '9000',
  blockNumber: '0xf69b5',
  coinbase: '0x05ae1d0ca6206c6168b42efcd1fbe0ed144e821b',
  gasPrice: 18000000000,
  api: {
    events: { ... },
    functions: { ... },
  },
  contracts: { ... },
  rpc: { ... },
};

The easiest way to install augur.js is using npm:

$ npm install augur.js

Alternatively, this can be done using yarn, as follows:

$ yarn add augur.js

Once augur.js has been installed, it will need to be connected to an Ethereum node and an Augur Node. These can be running locally or remotely (hosted).

To connect to the desired Ethereum node and Augur node, call the function augur.connect as shown to the right. Upon doing so, augur.js will iterate through the list of addresses provided in the ethereumNode argument and attempt to connect to each one until a successful connection is established or all attempts have failed. The Ethereum node may have multiple HTTP, websocket, or IPC addresses specified as arrays. Similarly, augur.js will attempt to use the augurNode parameter to connect to an Augur Node. However, augurNode may only be specified as a single-address string, not as an object containing an array of addresses.

In the example on the right, the first connection that will be tried is http://127.0.0.1:8545, which is our local Ethereum node being run using the Geth client. If a connection to the local Geth node cannot be established, the next provided address will be tried. In this case, we have provided a single hosted node (https://eth9000.augur.net) as another attempt to make after the local Geth node. If a connection is successfully established, then the vitals object will be returned; otherwise an error message will be returned.

Accounts

/**
 * Create an account using the augur.accounts.register method.
 */
var newAccount;
var registerParameters = { password: "thisismysupersecurepassword" };

augur.accounts.register(registerParameters, function (error, account) {
  console.log("Error:", error);
  console.log("Account:", account);
  newAccount = account;
});

// output
Error: null
Account: {
  address: "0xb1baa74babc22bad068e3055846fb76becad7da2",
  derivedKey: Uint8Array(32) [121, 199, 100, 210, 236, 254, 150, 229, 159, 182, 49, 89, 198, 158, 135, 200, 242, 108, 111, 245, 143, 135, 3, 216, 223, 48, 95, 214, 7, 112, 106, 246],
  keystore: {
    address: "0xb1baa74babc22bad068e3055846fb76becad7da2",
    crypto: {
      cipher: "aes-128-ctr",
      cipherparams: {
        iv: "1be316027cc38223635f54dced8fefb4"
      },
      ciphertext: "30722b1b8f84752813e67489a17e89fafcb768fcbdcee03e2aea220bc3e0173e",
      kdf: "pbkdf2",
      kdfparams: {
        c: 65536,
        dklen: 32,
        prf: "hmac-sha256",
        salt: "2d5e265588356263153d729f2b7151ffca65dba768b25ede61eb6475eff7cf01"
      },
      mac: "70bbd8c0324aba45404a8d67ae8af6ad0888654cb8e401a599f7f6b165261c59"
    },
    id: "3dd23c7f-74ab-4ce0-a3b1-30918e4f6cca",
    version: 3
  },
  privateKey: Uint8Array(32) [145, 195, 95, 10, 39, 106, 79, 107, 240, 160, 184, 204, 214, 23, 139, 203, 213, 38, 245, 16, 225, 209, 165, 144, 201, 130, 146, 88, 46, 20, 169, 10]
}

/**
 * Log into an account using the augur.accounts.login method.
 */
var loginParameters = { keystore: newAccount.keystore, password: registerParameters.password };

augur.accounts.login(loginParameters, function (error, account) {
  console.log("Error:", error);
  console.log("Account:", account);
});

// output
Error: null
Account: {
  address: undefined,
  derivedKey: Uint8Array(32) [121, 199, 100, 210, 236, 254, 150, 229, 159, 182, 49, 89, 198, 158, 135, 200, 242, 108, 111, 245, 143, 135, 3, 216, 223, 48, 95, 214, 7, 112, 106, 246],
  keystore: {
    address: "0xb1baa74babc22bad068e3055846fb76becad7da2",
    crypto: {
      cipher: "aes-128-ctr",
      cipherparams: {
        iv: "1be316027cc38223635f54dced8fefb4"
      },
      ciphertext: "30722b1b8f84752813e67489a17e89fafcb768fcbdcee03e2aea220bc3e0173e",
      kdf: "pbkdf2",
      kdfparams: {
        c: 65536,
        dklen: 32,
        prf: "hmac-sha256",
        salt: "2d5e265588356263153d729f2b7151ffca65dba768b25ede61eb6475eff7cf01"
      },
      mac: "70bbd8c0324aba45404a8d67ae8af6ad0888654cb8e401a599f7f6b165261c59"
    },
    id: "3dd23c7f-74ab-4ce0-a3b1-30918e4f6cca",
    version: 3
  },
  privateKey: Uint8Array(32) [145, 195, 95, 10, 39, 106, 79, 107, 240, 160, 184, 204, 214, 23, 139, 203, 213, 38, 245, 16, 225, 209, 165, 144, 201, 130, 146, 88, 46, 20, 169, 10]
}

// augur.js does not store any account data. augur.js simply returns the important information. You can use the privateKey Buffer returned to sign your transactions.

augur.js includes a trustless account management system. The purpose of the accounts system is to allow people to use Augur without needing to run an Ethereum node themselves, as running a full Ethereum node can be resource-intensive.

To use the account system, the user specifies a password. Everything else is done automatically for the user. The only requirement for the password is that it be at least 6 characters long.

A private key (+ derived public key and address) is automatically generated for the user. A secret key derived from the password using PBKDF2, along with a random 128-bit initialization vector, is used to encrypt the private key (using AES-256). Nothing is stored by augur.js. The account object will be returned to the callback provided or simply returned if no callback is provided.

The Augur UI will handle your account information for you, but if you are using augur.js on its own you will need to manage the account yourself. augur.js doesn’t sign any transactions for you if you aren’t using the Augur UI.

If you want to use the augur.js API directly, you will need to sign any transaction that will modify information on the blockchain (non-call transactions). All transactions take a _signer parameter which should be set to the sending account’s privateKey Buffer or a function that will sign a transaction (hardware wallet).

Numbers

Before we move on, let’s quickly talk about Numbers. There are three acceptable ways to pass numerical inputs to the Augur API:

Floating-point (decimal) values should be passed to augur.js as strings (e.g., instead of 0.07, use "0.07"), for reasons described in enormous detail elsewhere.

Initial market loading

To get a list of all Markets, first call augur.markets.getMarkets({ universe[, sortBy, isSortDescending, limit, offset] }[, callback]). More detailed market info (including prices) for each market can then be loaded using augur.markets.getMarketsInfo({ marketIDs }[, callback]). getMarketsInfo does not return the Open Orders for the Market; to get the Open Orders, call augur.trading.getOrders({ [universe, marketID, outcome, orderType, creator, orderState, earliestCreationTime, latestCreationTime, sortBy, isSortDescending, limit, offset] }[, callback]).

Debugging Options

augur.rpc.setDebugOptions({ broadcast: true });
augur.api.Universe.getCurrentReportingWindow();
// example output:
packaged: {
  from: "0x56ddb80fe4e5aa05182d794526ab1eff78c90688", 
  to: "0xa1d76546015cfe50183497ca65fcbd5c656f7813", 
  data: "0x6235eef3", 
  gas: "0x2fd618", 
  returns: "address"
}
Blockchain RPC to http://127.0.0.1:8545 via SyncTransport with payload: 
{
  "id":429,
  "jsonrpc":"2.0",
  "method":"eth_call",
  "params":[{"from":"0x56ddb80fe4e5aa05182d794526ab1eff78c90688",
             "to":"0xa1d76546015cfe50183497ca65fcbd5c656f7813",
             "data":"0x6235eef3",
             "gas":"0x2fd618"},
             "latest"]
}
"0x54d134699764375417e4b5dda1e2ac62f62e9725"

augur.rpc.setDebugOptions({ connect: true });
augur.connect({ 'ethereumNode': { http: "http://rinkeby.augur.net:8545", ws: "ws://rinkeby.augur.net:8546" }, 'augurNode': "ws://127.0.0.1:9001"}, function (err, vitals) { console.log(err); console.log(vitals); });
// example output:
connecting to augur node... 
{ 
  augurNode: "ws://127.0.0.1:9001",
  ethereumNode: { http: "http://rinkeby.augur.net:8545", ws: "ws://rinkeby.augur.net:8546" }
}
connecting to ethereum node... 
{ 
  augurNode: "ws://127.0.0.1:9001",
  ethereumNode: { http: "http://rinkeby.augur.net:8545", ws: "ws://rinkeby.augur.net:8546" }
}
connected to augur
Web3: not connected
Sync: http://rinkeby.augur.net:8545
HTTP: http://rinkeby.augur.net:8545
WS: ws://rinkeby.augur.net:8546
IPC: not connected
connected to ethereum
{
  augurNode: "ws://127.0.0.1:9001",
  ethereumNode: {
    abi: {events: {...}, functions: {...}},
    blockNumber: "0x133773",
    coinbase: null,
    contracts: {...},
    gasPrice: 20000000000,
    networkID: "4",
    rpc: {...}
  }
}

augur.rpc.setDebugOptions({ tx: true });
augur.api.Universe.getOrCacheMarketCreationCost({
  onSent: function (result) {...},
  onSuccess: function (result) {...},
  onFailed: function (result) {...}
});
// example output:
payload transact: 
{
  constant: false,  
  from: "0x40485264986740c8fb3d11e814bd94cf86012d29"
  name: "getOrCacheMarketCreationCost"
  params: [],
  returns: "uint256",
  send: true,
  to: "0xa282b625053e80da550098fdb325a8ece6dfe8ac"
}
callReturn: 10000000006000000
txHash: 0x26f731c948568d9c0a4983fa134431f3fba0c68248f95d35536c9157cafa785a

The function augur.rpc.setDebugOptions allows several debugging options to be enabled:

Simplified API

Accounts Functions

augur.accounts.getAccountTransferHistory({
  account: "0x0000000000000000000000000000000000000b0b",
  token: null,
  isSortDescending: false
}, function (error, result) { 
  console.log(result);
});
// example output:
[
  {
    transactionHash: "0x00000000000000000000000000000000000000000000000000000000deadbeef",
    logIndex: 0,
    creationBlockNumber: 1400000,
    blockHash: "0x1400000",
    creationTime: 1506473474,
    sender: " 0x0000000000000000000000000000000000000b0b",
    recipient: " 0x000000000000000000000000000000000000d00d",
    token: " 0x1000000000000000000000000000000000000000",
    value: 10,
    symbol: "shares",
    marketID: " 0x0000000000000000000000000000000000000001",
    outcome: 0,
  },
  {
    transactionHash: "0x00000000000000000000000000000000000000000000000000000000d3adb33f",
    logIndex: 0,
    creationBlockNumber: 1400001,
    blockHash: "0x1400001",
    creationTime: 1506473500,
    sender: " 0x000000000000000000000000000000000000d00d",
    recipient: " 0x0000000000000000000000000000000000000b0b",
    token: " 0x1000000000000000000000000000000000000000",
    value: 2,
    symbol: "shares",
    marketID: " 0x0000000000000000000000000000000000000001",
    outcome: 0,
  },
  {
    transactionHash: "0x00000000000000000000000000000000000000000000000000000000deadb33f",
    logIndex: 1,
    creationBlockNumber: 1400001,
    blockHash: "0x1400001",
    creationTime: 1506473500,
    sender: " 0x0000000000000000000000000000000000000b0b",
    recipient: " 0x000000000000000000000000000000000000d00d",
    token: " 0x7a305d9b681fb164dc5ad628b5992177dc66aec8",
    value: 47,
    symbol: "REP",
    marketID: null,
    outcome: null,
  }
]

augur.accounts.importAccount({
  address: "0xacad0e04f71c7f202d546ab71b047410bce3277c",
  keystore: {
    address: "0xacad0e04f71c7f202d546ab71b047410bce3277c",
    crypto: {
      cipher: "aes-128-ctr",
      cipherparams: {
        iv: "1be316027cc38223635f54dced8fefb4"
      },
      ciphertext: "30722b1b8f84752813e67489a17e89fafcb768fcbdcee03e2aea220bc3e0173e",
      kdf: "pbkdf2",
      kdfparams: {
        c: 65536,
        dklen: 32,
        prf: "hmac-sha256",
        salt: "2d5e265588356263153d729f2b7151ffca65dba768b25ede61eb6475eff7cf01"
      },
      mac: "70bbd8c0324aba45404a8d67ae8af6ad0888654cb8e401a599f7f6b165261c59"
    },
    id: "3dd23c7f-74ab-4ce0-a3b1-30918e4f6cca",
    version: 3
  },
  password: "thisismysupersecurepassword"
}, function (error, account) {
  console.log(account);
});
// example output:
{
  address: "0xacad0e04f71c7f202d546ab71b047410bce3277c",
  derivedKey: Uint8Array(32) [121, 199, 100, 210, 236, 254, 150, 229, 159, 182, 49, 89, 198, 158, 135, 200, 242, 108, 111, 245, 143, 135, 3, 216, 223, 48, 95, 214, 7, 112, 106, 246],
  keystore: {
    address: "0xacad0e04f71c7f202d546ab71b047410bce3277c",
    crypto: {
      cipher: "aes-128-ctr",
      cipherparams: {
        iv: "1be316027cc38223635f54dced8fefb4"
      },
      ciphertext: "30722b1b8f84752813e67489a17e89fafcb768fcbdcee03e2aea220bc3e0173e",
      kdf: "pbkdf2",
      kdfparams: {
        c: 65536,
        dklen: 32,
        prf: "hmac-sha256",
        salt: "2d5e265588356263153d729f2b7151ffca65dba768b25ede61eb6475eff7cf01"
      },
      mac: "70bbd8c0324aba45404a8d67ae8af6ad0888654cb8e401a599f7f6b165261c59"
    },
    id: "3dd23c7f-74ab-4ce0-a3b1-30918e4f6cca",
    version: 3
  },
  privateKey: Uint8Array(32) [154, 195, 95, 10, 39, 106, 79, 107, 240, 160, 184, 204, 214, 23, 139, 203, 213, 38, 245, 16, 225, 209, 165, 144, 201, 130, 146, 88, 46, 20, 169, 10]
}

augur.accounts.login({
  keystore: {
    address: "0xacad0e04f71c7f202d546ab71b047410bce3277c",
    crypto: {
      cipher: "aes-128-ctr",
      cipherparams: {
        iv: "1be316027cc38223635f54dced8fefb4"
      },
      ciphertext: "30722b1b8f84752813e67489a17e89fafcb768fcbdcee03e2aea220bc3e0173e",
      kdf: "pbkdf2",
      kdfparams: {
        c: 65536,
        dklen: 32,
        prf: "hmac-sha256",
        salt: "2d5e265588356263153d729f2b7151ffca65dba768b25ede61eb6475eff7cf01"
      },
      mac: "70bbd8c0324aba45404a8d67ae8af6ad0888654cb8e401a599f7f6b165261c59"
    },
    id: "3dd23c7f-74ab-4ce0-a3b1-30918e4f6cca",
    version: 3
  },
  password: "thisismysupersecurepassword"
}, function (error, account) {
  console.log(account);
});
// example output:
{
  address: undefined,
  derivedKey: Uint8Array(32) [121, 199, 100, 210, 236, 254, 150, 229, 159, 182, 49, 89, 198, 158, 135, 200, 242, 108, 111, 245, 143, 135, 3, 216, 223, 48, 95, 214, 7, 112, 106, 246],
  keystore: {
    address: "0xacad0e04f71c7f202d546ab71b047410bce3277c",
    crypto: {
      cipher: "aes-128-ctr",
      cipherparams: {
        iv: "1be316027cc38223635f54dced8fefb4"
      },
      ciphertext: "30722b1b8f84752813e67489a17e89fafcb768fcbdcee03e2aea220bc3e0173e",
      kdf: "pbkdf2",
      kdfparams: {
        c: 65536,
        dklen: 32,
        prf: "hmac-sha256",
        salt: "2d5e265588356263153d729f2b7151ffca65dba768b25ede61eb6475eff7cf01"
      },
      mac: "70bbd8c0324aba45404a8d67ae8af6ad0888654cb8e401a599f7f6b165261c59"
    },
    id: "3dd23c7f-74ab-4ce0-a3b1-30918e4f6cca",
    version: 3
  },
  privateKey: Uint8Array(32) [154, 195, 95, 10, 39, 106, 79, 107, 240, 160, 184, 204, 214, 23, 139, 203, 213, 38, 245, 16, 225, 209, 165, 144, 201, 130, 146, 88, 46, 20, 169, 10]
}

augur.accounts.loginWithMasterKey({
  privateKey: [154, 195, 95, 10, 39, 106, 79, 107, 240, 160, 184, 204, 214, 23, 139, 203, 213, 38, 245, 16, 225, 209, 165, 144, 201, 130, 146, 88, 46, 20, 169, 10]
});
// example output:
{
  address: "0x0cad0e04f71c7f202d546ab71b047410bce3277c"
  derivedKey: Uint8Array(32) [201, 255, 60, 63, 53, 230, 36, 85, 169, 202, 221, 48, 231, 73, 203, 250, 107, 208, 201, 39, 72, 68, 185, 10, 218, 102, 13, 174, 197, 154, 41, 196]
  privateKey: Uint8Array(32) [154, 195, 95, 10, 39, 106, 79, 107, 240, 160, 184, 204, 214, 23, 139, 203, 213, 38, 245, 16, 225, 209, 165, 144, 201, 130, 146, 88, 46, 20, 169, 10]
}

augur.accounts.logout();
// This function does not produce any output.

augur.accounts.getAccountTransferHistory(p, callback)

Returns the token transfers made to or from a specific Ethereum address.

This function will fail if:

Parameters:

Returns:

augur.accounts.importAccount(p, callback)

Description pending.

Parameters:

Returns:

augur.accounts.login(p, callback)

Logs into an account using a password

Parameters:

Returns:

augur.accounts.loginWithMasterKey(p)

Logs into an account with a user-supplied plaintext private key.

Parameters:

Returns:

augur.accounts.logout()

Logs out the account that is currently logged in.

Assets Functions

augur.assets.sendEther({
    etherToSend: "0.001", 
    from: "0x8fa56abe36d8dc76cf85fecb6a3026733e0a12ac",
    to: "0x40485264986740c8fb3d11e814bd94cf86012d29", 
    meta: {
        signer: [251, 62, 32, 94, 233, 213, 105, 71, 89, 162, 243, 247, 56, 81, 213, 103, 239, 75, 212, 240, 234, 95, 8, 201, 217, 55, 225, 0, 85, 109, 158, 51],
        accountType: "privateKey"
    },
    onSent: function() {},
    onSuccess: function(result) {
        console.log(result);
    },
    onFailed: function() {},
});
// example output:
{
  "callReturn": null,
  "blockHash": "0xbb21d95d9370d88fd7a8259300476b1084cfcf54ae6c6684f77a60876107c980",
  "blockNumber": 1599690,
  "from": "0x8fa56abe36d8dc76cf85fecb6a3026733e0a12ac",
  "gas": "0xcf08",
  "gasPrice": "0x4a817c800",
  "hash": "0xf6f476c21bb4084729d268eb1392ac9bfc1b543fb89862ad188e1c3f2db4f4b7",
  "input": "0x3af39c21",
  "nonce": "0x16",
  "to": "0x40485264986740c8fb3d11e814bd94cf86012d29",
  "transactionIndex": "0x0",
  "value": "0x38d7ea4c68000",
  "v": "0x2b",
  "r": "0x5239d5ccf324ed41125e63ef6b49ba5f79a4f27678a9caad0f1c480f36faa026",
  "s": "0x33184fe7ebaa3bdfc414c0147cb902d6a9d43033f3254996a3283cc990adb50f",
  "timestamp": 1516065072,
  "gasFees": "0.00042544"
}

augur.assets.sendReputation({
    universe: "0x1f732847fbbcc46ffe859f28e916d993b2b08831",
    reputationToSend: "0.001", 
    _to: "0x40485264986740c8fb3d11e814bd94cf86012d29", 
    meta: {
        signer: [251, 62, 32, 94, 233, 213, 105, 71, 89, 162, 243, 247, 56, 81, 213, 103, 239, 75, 212, 240, 234, 95, 8, 201, 217, 55, 225, 0, 85, 109, 158, 51],
        accountType: "privateKey"
    },
    onSent: function() {
    },
    onSuccess: function(result) {
        console.log(result);
    },
    onFailed: function() {
    },
});

// example output:
{
  "callReturn": null,
  "blockHash": "0xd4bbd077575d2006b19570d546a6f02a4ef45d4cb91d64286026431eda313fb8",
  "blockNumber": 1599717,
  "from": "0x8fa56abe36d8dc76cf85fecb6a3026733e0a12ac",
  "gas": "0x2fd618",
  "gasPrice": "0x4a817c800",
  "hash": "0x39618f9552bad2ee24ac48fa1b634ffbe1c33a157793cd458ae2cbe68c988cde",
  "input": "0xa9059cbb00000000000000000000000040485264986740c8fb3d11e814bd94cf86012d2900000000000000000000000000000000000000000000000000038d7ea4c68000",
  "nonce": "0x17",
  "to": "0x13fa2334966b3cb6263ed56148323014c2ece753",
  "transactionIndex": "0x2",
  "value": "0x0",
  "v": "0x2c",
  "r": "0xc2b1869475afa6e7b6ecc4965da765f71fee57cd8863c340e3ce02e0ee47ab37",
  "s": "0x4b6baec6d873fa784d70ac9867005204febdf6d1d0274dbf6f774971e01daf7b",
  "timestamp": 1516065477,
  "gasFees": "0.00146872"
}

augur.assets.sendEther(p)

Sends Ether to a specified Ethereum address.

Parameters:

augur.assets.sendReputation(p)

Sends REP to a specified Ethereum address. This function will trigger a TokensTransferred event if the REP is successfully sent.

Parameters:

Augur-Node Functions

augur.augurNode.getContractAddresses(
  function(error, result) {
    console.log(result);
  }
);
// example output:
{
  "version": "4.7.0-47",
  "addresses": {
    "Controller": "0x392be0a9d1ab1bde2931c2ddf1d722f9e13b6085",
    "Universe": "0x1f732847fbbcc46ffe859f28e916d993b2b08831",
    "Augur": "0x852684b374fe03ab77d06931f1b2831028fd58f5",
    "LegacyReputationToken": "0x097c198dcc997086d1555ad9ae6f52375cfb58d0",
    "CancelOrder": "0x389c0b3f0d51cfba9e4d214712a1142f5685814d",
    "Cash": "0xd2ee83a8a2a904181ccfddd8292f178614062aa0",
    "ClaimTradingProceeds": "0x8aa774927fb928ee1df0d0d3f94c8217658e0bce",
    "CompleteSets": "0xbf749b00e42751dba8e0872e66d3ba854f6c2632",
    "CreateOrder": "0xdadc071ecc3b7e97b139d2ef692defdc398c8211",
    "FillOrder": "0x0c77f6af7b3b5fed8ca980414a97c62da283098a",
    "Order": "0x4811d582f64e68e657bec21834012af38ef093bc",
    "Orders": "0x1ba5cf0ce546bf7d7943c4d4fb21ea59f6bb0eee",
    "OrdersFetcher": "0xb9f2cf78542de87ba7542d92e2937d0eedec5feb",
    "ShareToken": "0x925bee44fec28deb228d2251e1a9d32f7c73ebed",
    "Trade": "0x0dec7fd04933b8673cef99b64978113065b03926",
    "TradingEscapeHatch": "0x157a8998f5470a2be3917aab31d334109f56c30c"
  }
}

augur.augurNode.getContractAddresses(callback)

Returns the version and contract address set from an Augur Node.

This function will fail if:

Parameters:

Returns:

Connect Function

augur.connect({ 
  ethereumNode: {  
    httpAddresses: [
      "http://127.0.0.1:8545", // local http address for Geth node
      "https://eth9000.augur.net" // hosted http address for Geth node
    ],
    wsAddresses: [
      "ws://127.0.0.1:8546", // local websocket address for Geth node
      "wss://ws9000.augur.net" // hosted websocket address for Geth node
    ]
  },
  augurNode: "ws://127.0.0.1:9001" // local websocket address for an Augur Node
}, function (error, connectionInfo) {
  console.log(connectionInfo);
});
// example output:
connecting to augur-node: ws://127.0.0.1:9001
connecting to ethereum-node: {"httpAddresses":["http://127.0.0.1:8545","https://eth9000.augur.net"],"wsAddresses":["ws://127.0.0.1:8546","wss://ws9000.augur.net"]}
connected to augur
Web3: not connected
Sync: http://127.0.0.1:8545
HTTP: http://127.0.0.1:8545
WS: ws://127.0.0.1:8546
IPC: not connected
connected to ethereum
{
  augurNode: "ws://127.0.0.1:9001",
  ethereumNode: {
    abi: { ... },
    blockNumber: "0x184e24",
    coinbase: "0x40485264986740c8fb3d11e814bd94cf86012d29",
    contracts: { ... },
    gasPrice: 20000000000,
    networkID: "4"
    rpc: { ... }
  }
}

augur.connect(connectOptions, callback)

Connects augur.js to an Ethereum node and an Augur Node.

Parameters:

Create-Market Functions

var _extraInfo = { 
  "resolutionSource": "http://www.nasdaq.com/symbol/msft", 
  "tags": [ "Stocks", "Microsoft" ], 
  "longDescription": "" 
};
augur.createMarket.createBinaryMarket({
  universe: "0x1f732847fbbcc46ffe859f28e916d993b2b08831",
  _endTime: 1546300799,
  _feePerEthInWei: 1193046,
  _denominationToken: "0xd2ee83a8a2a904181ccfddd8292f178614062aa0",
  _designatedReporterAddress: "0x01114f4bda09ed6c6715cf0baf606b5bce1dc96a",
  _topic: "stocks",
  _description: "Will Microsoft stock (MSFT) be below $50 at any point during 2018?",
  _extraInfo: JSON.stringify(_extraInfo),
  meta: {
    signer: [251, 62, 32, 94, 233, 213, 105, 71, 89, 162, 243, 247, 56, 81, 213, 103, 239, 75, 212, 240, 234, 95, 8, 201, 217, 55, 225, 0, 85, 109, 158, 51],
    accountType: "privateKey"
  },
  onSent: function (result) { console.log("onSent result:", result); },
  onSuccess: function (result) { console.log("onSuccess result:", result); },
  onFailed: function (result) { console.log("onFailed result:", result); }
});
// example output coming soon

var _extraInfo = { 
  "resolutionSource": "http://www.espn.com", 
  "tags": ["college football", "football"], 
  "outcomeNames": ["Georgia", "Florida"], 
  "longDescription": "" 
};
augur.createMarket.createCategoricalMarket({
  universe: "0x1f732847fbbcc46ffe859f28e916d993b2b08831",
  _endTime: 1540875600,
  _feePerEthInWei: 1193046,
  _denominationToken: "0xd2ee83a8a2a904181ccfddd8292f178614062aa0",
  _designatedReporterAddress: "0x01114f4bda09ed6c6715cf0baf606b5bce1dc96a",
  _outcomes: ["outcome1","outcome2"],
  _topic: "sports",
  _description: "Who will win the University of Georgia vs. University of Florida football game in 2018?",
  _extraInfo: JSON.stringify(_extraInfo),
  meta: {
    signer: [251, 62, 32, 94, 233, 213, 105, 71, 89, 162, 243, 247, 56, 81, 213, 103, 239, 75, 212, 240, 234, 95, 8, 201, 217, 55, 225, 0, 85, 109, 158, 51],
    accountType: "privateKey"
  },
  onSent: function (result) { console.log("onSent result:", result); },
  onSuccess: function (result) { console.log("onSuccess result:", result); },
  onFailed: function (result) { console.log("onFailed result:", result); }
});
// example output coming soon

var _extraInfo = { 
  "resolutionSource": "http://forecast.weather.gov", 
  "tags": ["San Francisco", "weather"], 
  "longDescription": "" 
};
augur.createMarket.createScalarMarket({
  universe: "0x1f732847fbbcc46ffe859f28e916d993b2b08831",
  _endTime: 1530507600,
  _feePerEthInWei: 1193046,
  _denominationToken: "0xd2ee83a8a2a904181ccfddd8292f178614062aa0",
  _designatedReporterAddress: "0x01114f4bda09ed6c6715cf0baf606b5bce1dc96a",
  _minPrice: -10,
  _maxPrice: 120,
  _numTicks: 10,
  _topic: "temperature",
  _description: "High temperature (in degrees Fahrenheit) in San Francisco, California, on July 1, 2018",
  _extraInfo: JSON.stringify(_extraInfo),
  meta: {
    signer: [251, 62, 32, 94, 233, 213, 105, 71, 89, 162, 243, 247, 56, 81, 213, 103, 239, 75, 212, 240, 234, 95, 8, 201, 217, 55, 225, 0, 85, 109, 158, 51],
    accountType: "privateKey"
  },
  onSent: function (result) { console.log("onSent result:", result); },
  onSuccess: function (result) { console.log("onSuccess result:", result); },
  onFailed: function (result) { console.log("onFailed result:", result); }
});
// example output coming soon

augur.createMarket.getMarketCreationCost({
    universe: "0x1f732847fbbcc46ffe859f28e916d993b2b08831", 
}, function (error, result) { 
  console.log(result);
});
// example output:
{
  designatedReportNoShowReputationBond: "0.174840291341145834",
  etherRequiredToCreateMarket: "0.025"
}

augur.createMarket.getMarketCreationCostBreakdown({
    universe: "0x1f732847fbbcc46ffe859f28e916d993b2b08831", 
}, function (error, result) { 
  console.log(result);
});
// example output:
{
  validityBond: "0.01",
  designatedReportNoShowReputationBond: "0.174840291341145834",
  targetReporterGasCosts: "0.015"
}

augur.createMarket.createBinaryMarket(p)

Creates a Binary Market in a specified Universe. This function will trigger a MarketCreated event and TokensTransferred event if the Market is created successfully.

Parameters:

augur.createMarket.createCategoricalMarket(p)

Creates a Categorical Market in a specified Universe. This function will trigger a MarketCreated event and TokensTransferred event if the Market is created successfully.

Parameters:

augur.createMarket.createScalarMarket(p)

Creates a Scalar Market in a specified Universe. This function will trigger a MarketCreated event and TokensTransferred event if the Market is created successfully.

Parameters:

augur.createMarket.getMarketCreationCost(p, callback)

Retrieves the Designated Report No-Show REP Bond amount and total Ether required to create a new Market.

Note: This function will send a transaction if needed to create the current Reporting Window.

Parameters:

Returns:

augur.createMarket.getMarketCreationCostBreakdown(p, callback)

Similar to augur.createMarket.getMarketCreationCost, but provides more detail about the ether costs required to create a new Market. These Ether costs are broken down by the gas cost paid to the First Public Reporter and the cost of the Validity Bond.

Note: This function will send a transaction if needed to create the current Reporting Window.

Parameters:

Returns:

Markets Functions

augur.markets.getCategories({
  universe: "0x000000000000000000000000000000000000000b",
  sortBy: "popularity",
  isSortDescending: true
}, function (error, result) { 
  console.log(result);
});
// example output:
[
  { category: "finance", popularity: 12345 },
  { category: "politics", popularity: 5000 },
  { category: "ethereum", popularity: 1000 },
  { category: "augur", popularity: 500 },
]

// NOTE: This function has not be implemented yet, so the format of the returned data is still pending.
augur.markets.getDisputableMarkets({ 
  reportingWindow: "0x1000000000000000000000000000000000000000"
}, function (error, result) { 
  console.log(result);
});
// example output: coming soon

augur.markets.getMarketPriceHistory({
  marketID: "0x0000000000000000000000000000000000000001",
  sortBy: null,
  isSortDescending: null,
  limit: null,
  offset: null,
}, function (error, result) { 
  console.log(result);
});
// example output:
{
  0: [{
    price: 5.5,
    timestamp: 1506474500,
  }],
}

augur.markets.getMarkets({
  universe: "0x000000000000000000000000000000000000000b"
}, function (error, result) { 
  console.log(result);
});
// example output:
[
  "0x0000000000000000000000000000000000000001",
  "0x0000000000000000000000000000000000000002",
  "0x0000000000000000000000000000000000000003",
  "0x0000000000000000000000000000000000000011",
]

augur.markets.getMarketsAwaitingDesignatedReporting({
  universe: "0x000000000000000000000000000000000000000b",
  sortBy: "volume",
  isSortDescending: false,
}, function (error, result) { 
  console.log(result);
});
// example output:
[
  "0x0000000000000000000000000000000000000001",
  "0x0000000000000000000000000000000000000002",
  "0x0000000000000000000000000000000000000003",
  "0x0000000000000000000000000000000000000012",
  "0x0000000000000000000000000000000000000014",
  "0x0000000000000000000000000000000000000015",
  "0x0000000000000000000000000000000000000016",
  "0x0000000000000000000000000000000000000017",
]

augur.markets.getMarketsAwaitingReporting({
  universe: "0x000000000000000000000000000000000000000b"
}, function (error, result) { 
  console.log(result);
});
// example output: 
[
  "0x0000000000000000000000000000000000000012",
  "0x0000000000000000000000000000000000000013",
  "0x0000000000000000000000000000000000000014",
  "0x0000000000000000000000000000000000000015",
  "0x0000000000000000000000000000000000000016",
  "0x0000000000000000000000000000000000000017",
  "0x0000000000000000000000000000000000000018",
  "0x0000000000000000000000000000000000000019",
  "0x0000000000000000000000000000000000000001",
  "0x0000000000000000000000000000000000000002",
  "0x0000000000000000000000000000000000000003",
  "0x0000000000000000000000000000000000000011"
]

augur.markets.getMarketsClosingInDateRange({
  universe: "0x000000000000000000000000000000000000000b",
  earliestClosingTime: 1506573450,
  latestClosingTime: 1506573470,
  limit: 10,
}, function (error, result) { 
  console.log(result);
});
// example output:
[
  "0x0000000000000000000000000000000000000001",
]

augur.markets.getMarketsCreatedByUser({
  universe: "0x000000000000000000000000000000000000000b",
  creator: "0x000000000000000000000000000000000000d00d",
}, function (error, result) { 
  console.log(result);
});
// example output:
[
  {
    creationTime: 1506480015,
    marketID: " 0x0000000000000000000000000000000000000003",
  }
]

augur.markets.getMarketsInCategory({
  universe: "0x000000000000000000000000000000000000000b",
  category: "augur",
}, function (error, result) { 
  console.log(result);
});
// example output:
[
  "0x0000000000000000000000000000000000000001",
  "0x0000000000000000000000000000000000000002",
  "0x0000000000000000000000000000000000000003",
  "0x0000000000000000000000000000000000000011",
]

augur.markets.getMarketsInfo({
  marketIDs: [
    "0x0000000000000000000000000000000000000001",
    "0x0000000000000000000000000000000000000002",
  ],
}, function (error, result) { 
  console.log(result);
});
// example output:
[
  {
    id: "0x0000000000000000000000000000000000000001",
    universe: "0x000000000000000000000000000000000000000b",
    marketType: "categorical",
    numOutcomes: 8,
    minPrice: 0,
    maxPrice: 1,
    cumulativeScale: "1",
    author: "0x0000000000000000000000000000000000000b0b",
    creationTime: 1506473474,
    creationBlock: 1400000,
    creationFee: 10,
    settlementFee: "0.03",
    reportingFeeRate: 0.02,
    marketCreatorFeeRate: 0.01,
    marketCreatorFeesCollected: 0,
    category: "test category",
    tags: ["test tag 1", "test tag 2"],
    volume: 0,
    outstandingShares: 0,
    reportingState: "DESIGNATED_REPORTING",
    reportingWindow: "0x1000000000000000000000000000000000000000",
    endDate: 1506573470,
    finalizationTime: null,
    description: "This is a categorical test market created by b0b.",
    extraInfo: null,
    designatedReporter: "0x0000000000000000000000000000000000000b0b",
    designatedReportStake: 10,
    resolutionSource: "http://www.trusted-third-party.com",
    numTicks: 10000,
    tickSize: "0.0001",
    consensus: null,
    outcomes: [{
      id: 0,
      volume: 100,
      price: 0.125,
      name: "outcome 0",
    }, {
      id: 1,
      volume: 100,
      price: 0.125,
      name: "outcome 1",
    }, {
      id: 2,
      volume: 100,
      price: 0.125,
      name: "outcome 2",
    }, {
      id: 3,
      volume: 100,
      price: 0.125,
      name: "outcome 3",
    }, {
      id: 4,
      volume: 100,
      price: 0.125,
      name: "outcome 4",
    }, {
      id: 5,
      volume: 100,
      price: 0.125,
      name: "outcome 5",
    }, {
      id: 6,
      volume: 100,
      price: 0.125,
      name: "outcome 6",
    }, {
      id: 7,
      volume: 100,
      price: 0.125,
      name: "outcome 7",
    }],
  },
  {
    id: "0x0000000000000000000000000000000000000002",
    universe: "0x000000000000000000000000000000000000000b",
    marketType: "binary",
    numOutcomes: 2,
    minPrice: 0,
    maxPrice: 1,
    cumulativeScale: "1",
    author: "0x0000000000000000000000000000000000000b0b",
    creationTime: 1506480000,
    creationBlock: 1400100,
    creationFee: 10,
    settlementFee: "0.03",
    reportingFeeRate: 0.02,
    marketCreatorFeeRate: 0.01,
    marketCreatorFeesCollected: 0,
    category: "test category",
    tags: ["test tag 1", "test tag 2"],
    volume: 0,
    outstandingShares: 0,
    reportingState: "DESIGNATED_REPORTING",
    reportingWindow: "0x1000000000000000000000000000000000000000",
    endDate: 1506573480,
    finalizationTime: null,
    description: "This is a binary test market created by b0b.",
    extraInfo: null,
    designatedReporter: "0x0000000000000000000000000000000000000b0b",
    designatedReportStake: 10,
    resolutionSource: "http://www.trusted-third-party.com",
    numTicks: 10000,
    consensus: null,
    outcomes: [{
      id: 0,
      volume: 1000,
      price: 0.5,
      name: "outcome 0",
    }, {
      id: 1,
      volume: 1000,
      price: 0.5,
      name: "outcome 1",
    }]
  }
]

augur.markets.getUnclaimedMarketCreatorFees({
  marketIDs: [
    "0x0000000000000000000000000000000000000001",
    "0x0000000000000000000000000000000000000002"
  ]
}, function(error, result) {
  console.log(result);
});
// example output:
[
  {
    marketID: "0x0000000000000000000000000000000000000001",
    unclaimedFee: 0,
  },
  {
    marketID: "0x0000000000000000000000000000000000000002",
    unclaimedFee: 0,
  }
]

augur.markets.getCategories(p, callback)

Returns the Market Categories in a specific Universe.

This function will fail if:

Parameters:

Returns:

augur.markets.getDisputableMarkets(p, callback)

This function has not been implemented yet. Returns the Markets in a specific Reporting Window that are able to be disputed, along with the value of the Dispute Bond needed to dispute each Market’s result.

This function will fail if:

Parameters:

Returns:

augur.markets.getMarketPriceHistory(p, callback)

Returns the prices and timestamps of a specific Market’s Outcomes over time.

This function will fail if:

Parameters:

Returns:

augur.markets.getMarkets(p, callback)

Returns an array of Markets in a specific Universe.

This function will fail if:

Parameters:

Returns:

augur.markets.getMarketsAwaitingDesignatedReporting(p, callback)

Returns the Markets in a specific Universe that are waiting for a Designated Report to be submitted.

This function will fail if:

Parameters:

Returns:

augur.markets.getMarketsAwaitingReporting(p, callback)

Returns the Markets in a particular Universe or Reporting Window that are waiting for a Designated Report to be submitted or waiting for the Reporting Phase to end. Either the Universe or Reporting Window must be specified.

This function will fail if:

Parameters:

Returns:

augur.markets.getMarketsClosingInDateRange(p, callback)

Returns the Markets closing between a given time range in a specific Universe.

This function will fail if:

Parameters:

Returns:

augur.markets.getMarketsCreatedByUser(p, callback)

Returns the Markets created by a specific user, as well as the total amount of fees earned so far by that user.

This function will fail if:

Parameters:

Returns:

augur.markets.getMarketsInCategory(p, callback)

Returns the Markets within a specific category.

This function will fail if:

Parameters:

Returns:

augur.markets.getMarketsInfo(p, callback)

Returns information about Markets that are stored on-contract. The returned result includes basic information about the Markets as well as information about each Market Outcome. It does not include Order Book information; however the function augur.trading.getOrders can be used to get information about Orders for the specified Market.

This function will fail if:

Parameters:

Returns:

augur.markets.getUnclaimedMarketCreatorFees

Returns information about unclaimed Market Creator Fees. Fees are only available on Finalized Markets.

Parameters:

Returns:

Reporting Functions

augur.reporting.getReportingHistory({
  reporter: "0x0000000000000000000000000000000000000021",
  universe: "0x000000000000000000000000000000000000000b",
}, function (error, result) { 
  console.log(result);
});
// example output:
{
  "0x000000000000000000000000000000000000000b": {
    "0x0000000000000000000000000000000000000011": [{
      transactionHash: "0x0000000000000000000000000000000000000000000000000000000000000D00",
      logIndex: 0,
      creationBlockNumber: 1400051,
      blockHash: "0x1400051",
      creationTime: 1506474500,
      marketID: "0x0000000000000000000000000000000000000011",
      marketReportingState: "DESIGNATED_REPORTING",
      reportingWindow: "0x1000000000000000000000000000000000000000",
      payoutNumerators: [0, 2],
      amountStaked: 17,
      stakeToken: "0x0000000000000000001000000000000000000001",
      isCategorical: false,
      isScalar: false,
      isIndeterminate: false,
      isSubmitted: true,
    }],
    "0x0000000000000000000000000000000000000019": [{
      transactionHash: "0x0000000000000000000000000000000000000000000000000000000000000D03",
      logIndex: 0,
      creationBlockNumber: 1400052,
      blockHash: "0x1400052",
      creationTime: 1506474515,
      marketID: "0x0000000000000000000000000000000000000019",
      marketReportingState: "FIRST_REPORTING",
      reportingWindow: "0x1000000000000000000000000000000000000000",
      payoutNumerators: [1, 1],
      amountStaked: 229,
      stakeToken: "0x0000000000000000001000000000000000000003",
      isCategorical: false,
      isScalar: false,
      isIndeterminate: false,
      isSubmitted: true,
    }],
  }
}

augur.reporting.getReportingSummary({ 
  reportingWindow: "0x1000000000000000000000000000000000000000"
}, function (error, result) { 
  console.log(result);
});
// example output: 
{
  "AWAITING_FINALIZATION": 1,
  "DESIGNATED_REPORTING": 8,
  "FIRST_REPORTING": 2,
  "FINALIZED": 1,
}

// NOTE: This function has not be implemented yet, so the format of the returned data is still pending.
augur.reporting.getReportingWindowsWithUnclaimedFees({ 
  universe: "0x000000000000000000000000000000000000000b",
  account: "0x0000000000000000000000000000000000000021"
}, function (error, result) { 
  console.log(result);
});
// example output: coming soon

augur.reporting.getStakeRequiredForDesignatedReporter({
    universe: "0x000000000000000000000000000000000000000b"
}, function (error, result) { 
  console.log(result);
});
// example output:
"1.2345"

augur.reporting.getStakeTokens({ 
  universe: "0x000000000000000000000000000000000000000b",
  account: "0x0000000000000000000000000000000000000021",
  stakeTokenState: "UNFINALIZED",
}, function (error, result) { 
  console.log(result);
});
// example output: 
{
  "0x0000000000000000001000000000000000000001": {
    stakeToken: "0x0000000000000000001000000000000000000001",
    marketID: "0x0000000000000000000000000000000000000011",
    payout0: 0,
    payout1: 2,
    payout2: null,
    payout3: null,
    payout4: null,
    payout5: null,
    payout6: null,
    payout7: null,
    isInvalid: false,
    amountStaked: 17,
    winningToken: null,
    claimed: false,
    reportingState: "FIRST_REPORTING",
  },
}

augur.reporting.finalizeMarket(p)

Description pending.

Parameters:

augur.reporting.getReportingHistory(p, callback)

Returns information about the reports submitted by a particular user. For Reporting Windows that have ended, this includes the Final Outcome of the Market, whether the user’s Report matched that Final Outcome, how much REP the user gained or lost from redistribution, and how much the user earned in reporting fees.

This function will fail if:

Parameters:

Returns:

augur.reporting.getReportingSummary(p, callback)

Returns the number of Markets in various reporting phases, including “DESIGNATED_REPORTING”, “FIRST_REPORTING”, “LAST_REPORTING”, “AWAITING_FINALIZATION” (when a Market has been reported on and is in a Dispute Round Phase), “FORKING” (for the Market that has forked), “AWAITING_FORK_MIGRATION” (for Markets that are waiting for a forked Market to resolve), and “FINALIZED”.

This function will fail if:

Parameters:

Returns:

augur.reporting.getReportingWindowsWithUnclaimedFees(p, callback)

This function has not been implemented yet. Returns the Reporting Windows where a specific user has unclaimed reporting fees.

This function will fail if:

Parameters:

Returns:

augur.reporting.getStakeRequiredForDesignatedReporter(p, callback)

Returns the amount of REP a Designated Reporter must Stake when submitting a Designated Report in a given Universe.

Parameters:

Returns:

augur.reporting.getStakeTokens(p, callback)

Returns the Stake tokens owned by a specific user that are either unclaimed or are in Markets that have not been Finalized.

This function will fail if:

Parameters:

Returns:

Trading Functions

augur.trading.calculateProfitLoss({
  trades: [{
    type: "buy",
    amount: "1",
    price: "2",
    maker: false,
  }], 
  lastPrice: "2"
});

// example output:
{
  position: "1",
  meanOpenPrice: "2",
  realized: "0",
  queued: "0",
  unrealized: "0"
}

augur.trading.claimMarketsTradingProceeds({
  _markets: [
    "0x0000000000000000000000000000000000000001",
    "0x0000000000000000000000000000000000000002",
  ],
  meta: {
    signer: [251, 62, 32, 94, 233, 213, 105, 71, 89, 162, 243, 247, 56, 81, 213, 103, 239, 75, 212, 240, 234, 95, 8, 201, 217, 55, 225, 0, 85, 109, 158, 51],
    accountType: "privateKey"
  },
  onSent: function() {},
  onSuccess: function(result) {
    console.log(result);
  },
  onFailed: function() {}
});
// example output coming soon

augur.trading.claimTradingProceeds({
  _market: "0x0000000000000000000000000000000000000001",
  meta: {
    signer: [251, 62, 32, 94, 233, 213, 105, 71, 89, 162, 243, 247, 56, 81, 213, 103, 239, 75, 212, 240, 234, 95, 8, 201, 217, 55, 225, 0, 85, 109, 158, 51],
    accountType: "privateKey"
  },
  onSent: function() {},
  onSuccess: function(result) {
    console.log(result);
  },
  onFailed: function() {}
});
// example output coming soon

augur.trading.denormalizePrice({
  minPrice: "0",
  maxPrice: "2",
  normalizedPrice: "0.2",
});
// example output:
"0.4"

augur.trading.getBetterWorseOrders({
  marketID: "0x0000000000000000000000000000000000000001",
  outcome: 0,
  orderType: "buy",
  price: 0.65,
}, function (error, result) { 
  console.log(result);
});
// example output: 
{
  betterOrderID: "0x1000000000000000000000000000000000000000000000000000000000000000",
  worseOrderID: "0x2000000000000000000000000000000000000000000000000000000000000000",
}

augur.trading.getOrders({
  marketID: "0x0000000000000000000000000000000000000001",
  universe: "0x000000000000000000000000000000000000000b",
  outcome: null,
  orderType: "buy",
  creator: null,
  orderState: "OPEN",
}, function (error, result) { 
  console.log(result);
});
// example output:
{
  "0x0000000000000000000000000000000000000001": {
    0: {
      buy: {
        "0x1000000000000000000000000000000000000000000000000000000000000000": {
          orderID: "0x1000000000000000000000000000000000000000000000000000000000000000",
          shareToken: "0x1000000000000000000000000000000000000000",
          transactionHash: "0x0000000000000000000000000000000000000000000000000000000000000A00",
          logIndex: 0,
          owner: "0x0000000000000000000000000000000000000b0b",
          creationTime: 1506473500,
          creationBlockNumber: 1400001,
          orderState: "OPEN",
          price: 0.7,
          amount: 1,
          fullPrecisionPrice: 0.7,
          fullPrecisionAmount: 1,
          tokensEscrowed: 0.7,
          sharesEscrowed: 0,
        },
        "0x2000000000000000000000000000000000000000000000000000000000000000": {
          orderID: "0x2000000000000000000000000000000000000000000000000000000000000000",
          shareToken: "0x1000000000000000000000000000000000000000",
          transactionHash: "0x0000000000000000000000000000000000000000000000000000000000000A01",
          logIndex: 0,
          owner: "0x000000000000000000000000000000000000d00d",
          creationTime: 1506473515,
          creationBlockNumber: 1400002,
          orderState: "OPEN",
          price: 0.6,
          amount: 2,
          fullPrecisionPrice: 0.600001,
          fullPrecisionAmount: 2,
          tokensEscrowed: 1.200002,
          sharesEscrowed: 0,
        },
        "0x5000000000000000000000000000000000000000000000000000000000000000": {
          orderID: "0x5000000000000000000000000000000000000000000000000000000000000000",
          amount: 1,
          creationBlockNumber: 1400001,
          creationTime: 1506473500,
          transactionHash: "0x0000000000000000000000000000000000000000000000000000000000000A06",
          logIndex: 0,
          fullPrecisionAmount: 1,
          fullPrecisionPrice: 0.7,
          orderState: "OPEN",
          owner: "0x0000000000000000000000000000000000000b0b",
          price: 0.7,
          shareToken: "0x1000000000000000000000000000000000000000",
          sharesEscrowed: 0,
          tokensEscrowed: 0.7,
        },
      },
    },
    1: {
      buy: {
        "0x3000000000000000000000000000000000000000000000000000000000000000": {
          orderID: "0x3000000000000000000000000000000000000000000000000000000000000000",
          shareToken: "0x2000000000000000000000000000000000000000",
          transactionHash: "0x0000000000000000000000000000000000000000000000000000000000000A02",
          logIndex: 0,
          owner: "0x000000000000000000000000000000000000d00d",
          creationTime: 1506473515,
          creationBlockNumber: 1400002,
          orderState: "OPEN",
          price: 0.6,
          amount: 2,
          fullPrecisionPrice: 0.6,
          fullPrecisionAmount: 2.0000001,
          tokensEscrowed: 1.20000006,
          sharesEscrowed: 0,
        },
      },
    },
  },
}

augur.trading.getPositionInMarket({
  address: "0x25ff5dc79a7c4e34254ff0f4a19d69e491201dd3",
  market: "0x2221185d7f125b84ac4a1837a0688d2bb58e8491",
  tickSize: "0.0001",
}, function (error, result) { 
  console.log(result);
});
// example output:
["1", "0.5", "1", "0", "0", "1", "1.5"]

augur.trading.getUserTradingHistory({
      account: "0x000000000000000000000000000000000000d00d",
      universe: null,
      marketID: "0x0000000000000000000000000000000000000001",
      outcome: 0,
      orderType: null,
      sortBy: null,
      isSortDescending: null,
      limit: null,
      offset: null,
}, function (error, result) { 
  console.log(result);
});
// example output:
[
  {
    transactionHash: "0x0000000000000000000000000000000000000000000000000000000000000C00",
    logIndex: 0,
    type: "sell",
    price: 5.5,
    amount: 0.2,
    maker: false,
    marketCreatorFees: 0,
    reporterFees: 0,
    settlementFees: "0",
    marketID: "0x0000000000000000000000000000000000000001",
    outcome: 0,
    shareToken: "0x1000000000000000000000000000000000000000",
    timestamp: 1506474500,
    tradeGroupID: null,
  }
]

augur.trading.getUserTradingPositions({
  account: "0x000000000000000000000000000000000000d00d",
  universe: "0x000000000000000000000000000000000000000b",
  marketID: null,
  outcome: null,
  sortBy: null,
  isSortDescending: null,
  limit: null,
  offset: null,
}, function (error, result) { 
  console.log(result);
});
// example output:
[
  {
    "marketID": "0x0000000000000000000000000000000000000001",
    "outcome": 0,
    "numShares": 0.2,
    "numSharesAdjustedForUserIntention": 0.2,
    "realizedProfitLoss": 0,
    "unrealizedProfitLoss": 11,
    "averagePrice": 0,
  }, {
    "marketID": "0x0000000000000000000000000000000000000001",
    "outcome": 1,
    "numShares": 0,
    "numSharesAdjustedForUserIntention": 0,
    "realizedProfitLoss": 0,
    "unrealizedProfitLoss": 0,
    "averagePrice": 0,
  }, {
    "marketID": "0x0000000000000000000000000000000000000001",
    "outcome": 2,
    "numShares": 0,
    "numSharesAdjustedForUserIntention": 0,
    "realizedProfitLoss": 0,
    "unrealizedProfitLoss": 0,
    "averagePrice": 0,
  }, {
    "marketID": "0x0000000000000000000000000000000000000001",
    "outcome": 3,
    "numShares": 0,
    "numSharesAdjustedForUserIntention": 0,
    "realizedProfitLoss": 0,
    "unrealizedProfitLoss": 0,
    "averagePrice": 0,
  }, {
    "marketID": "0x0000000000000000000000000000000000000001",
    "outcome": 4,
    "numShares": 0,
    "numSharesAdjustedForUserIntention": 0,
    "realizedProfitLoss": 0,
    "unrealizedProfitLoss": 0,
    "averagePrice": 0,
  }, {
    "marketID": "0x0000000000000000000000000000000000000001",
    "outcome": 5,
    "numShares": 0,
    "numSharesAdjustedForUserIntention": 0,
    "realizedProfitLoss": 0,
    "unrealizedProfitLoss": 0,
    "averagePrice": 0,
  }, {
    "marketID": "0x0000000000000000000000000000000000000001",
    "outcome": 6,
    "numShares": 0,
    "numSharesAdjustedForUserIntention": 0,
    "realizedProfitLoss": 0,
    "unrealizedProfitLoss": 0,
    "averagePrice": 0,
  }, {
    "marketID": "0x0000000000000000000000000000000000000001",
    "outcome": 7,
    "numShares": 0,
    "numSharesAdjustedForUserIntention": 0,
    "realizedProfitLoss": 0,
    "unrealizedProfitLoss": 0,
    "averagePrice": 0,
  }
]

augur.trading.normalizePrice({
  minPrice: "0",
  maxPrice: "2",
  price: "0.4",
});
// example output:
"0.2"

augur.trading.placeTrade({
  amount: "10",
  limitPrice: "2",
  minPrice: "1",
  maxPrice: "3",
  tickSize: "0.0001",
  _direction: 0,
  _market: "MARKET_ADDRESS",
  _outcome: 2,
  _tradeGroupId: "0x1",
  doNotCreateOrders: false,
  meta: {
    signer: [251, 62, 32, 94, 233, 213, 105, 71, 89, 162, 243, 247, 56, 81, 213, 103, 239, 75, 212, 240, 234, 95, 8, 201, 217, 55, 225, 0, 85, 109, 158, 51],
    accountType: "privateKey"
  },
  onSent: function() {},
  onSuccess: function(result) {
      console.log(result);
  },
  onFailed: function() {},
});
// example output coming soon

augur.trading.simulateTrade({
  orderType: 0,
  outcome: 0,
  shares: "3",
  shareBalances: ["0", "5"],
  tokenBalance: "0",
  userAddress: "0x111327d07fc17907b4db788e5adf2ed424addff6",
  minPrice: "0",
  maxPrice: "1",
  price: "0.7",
  marketCreatorFeeRate: "0",
  reportingFeeRate: "0.01",
  shouldCollectReportingFees: 1,
  marketOrderBook: {
    buy: {
      BID_0: {
        amount: "2",
        fullPrecisionPrice: "0.7",
        sharesEscrowed: "2",
        owner: "0x2228238db7ad03e505840bd361dc2f521a72adbc",
      },
    },
    sell: {
      ASK_0: {
        amount: "2",
        fullPrecisionPrice: "0.7",
        sharesEscrowed: "2",
        owner: "0x2228238db7ad03e505840bd361dc2f521a72adbc",
      },
    },
  },
}, function (error, result) { 
  console.log(result);
});
// example output:
{
  settlementFees: "0.006",
  worstCaseFees: "0.009",
  gasFees: "0",
  otherSharesDepleted: "3",
  sharesDepleted: "0",
  tokensDepleted: "0",
  shareBalances: ["0", "4"],
}

augur.trading.tradeUntilAmountIsZero({
  _price: "0.5",
  _fxpAmount: "10",
  numTicks: "10000",
  tickSize: "0.0001",
  _direction: 1,
  _market: "MARKET_ADDRESS",
  _outcome: 2,
  _tradeGroupId: "0x1",
  doNotCreateOrders: true,
  meta: {
      signer: [251, 62, 32, 94, 233, 213, 105, 71, 89, 162, 243, 247, 56, 81, 213, 103, 239, 75, 212, 240, 234, 95, 8, 201, 217, 55, 225, 0, 85, 109, 158, 51],
      accountType: "privateKey"
  },
  onSent: function() {},
  onSuccess: function(result) {
      console.log(result);
  },
  onFailed: function() {}
});
// example output coming soon

augur.trading.calculateProfitLoss(p)

Calculates realized and unrealized profit/loss for trades in a single Outcome. Note: buy/sell labels are from taker’s point of view.

Parameters:

Returns:

augur.trading.claimMarketsTradingProceeds(p)

Similar to the function augur.trading.claimTradingProceeds, but attempts to collect trading profits in Ether from a user’s outstanding Shares in multiple Finalized Markets instead of a single Finalized Market.

Parameters:

augur.trading.claimTradingProceeds(p)

Attempts to collect trading profits in Ether from a user’s outstanding Shares in a single Finalized Market.

This function will fail if:

Parameters:

augur.trading.denormalizePrice(p)

Rescales a price to its display range [minPrice, maxPrice]: displayPrice = normalizedPrice*(maxPrice - minPrice) + minPrice.

Parameters:

Returns:

augur.trading.getBetterWorseOrders(p, callback)

Returns the IDs of the Orders for a given Outcome that have a better and worse price than the specified price. If no better/worse Orders exist, null will be returned. This function should be called prior to calling augur.api.CreateOrder.publicCreateOrder in order to get the _betterOrderId and _worseOrderId parameters that it accepts. (_betterOrderId and _worseOrderId are used to optimize the sorting of Orders on the Order Book.)

This function will fail if:

Parameters:

Returns:

augur.trading.getOrders(p, callback)

Returns a list of orders in a given Universe or Market.

This function will fail if:

Parameters:

Returns:

augur.trading.getPositionInMarket(p, callback)

Gets the number of Shares held by a specific Ethereum address for each Outcome of a Market.

Parameters:

Returns:

augur.trading.getUserTradingHistory(p, callback)

Returns information about the trades a specific user has made.

This function will fail if:

Parameters:

Returns:

augur.trading.getUserTradingPositions(p, callback)

Returns the trading positions held by a specific user.

This function will fail if:

Parameters:

Returns:

augur.trading.normalizePrice(p)

Rescales a price to lie on [0, 1]: normalizedPrice = (price - minPrice) / (maxPrice - minPrice).

Parameters:

Returns:

augur.trading.placeTrade(p)

Parameters:

augur.trading.simulateTrade(p, callback)

Determines the sequence of makes/takes that will be executed to Fill the specified Order, and returns the user’s projected balances and fees paid after this sequence is completed. Note: This function automatically normalizes Share prices, so “display prices” can be passed in directly for minPrice, maxPrice, and price.

Parameters:

Returns:

augur.trading.tradeUntilAmountIsZero(p, callback)

Parameters:

Type Definitions

Account (Object)

Properties:

AccountTransfer (Object)

Properties:

AugurEventLog (Object)

Properties:

BetterWorseOrders (Object)

Properties:

ContractAddresses (Object)

Properties:

Category (Object)

Properties:

CipherParams (Object)

Properties:

ConnectOptions (Object)

Properties:

EthereumNode (Object)

Properties:

ExtraInfo (Object)

Properties:

Keystore (Object)

Properties:

KeystoreCrypto (Object)

Properties:

MarketCreationCost (Object)

Properties:

MarketCreationCostBreakdown (Object)

Properties:

MarketCreatorFee (Object)

Properties:

MarketInfo (Object)

Properties:

MarketOrderBook (Object)

Properties:

MarketPriceTimeSeries (Object)

Properties:

MarketsContractAddressRow (Object)

Properties:

Meta (Object)

Authentication metadata for raw transactions.

Properties:

NoKeystoreAccount (Object)

Properties:

Order (Object)

Properties:

ORDER_STATE (Object)

Serves as an enum for the state of an order.

Properties:

OutcomeInfo (Object)

Properties:

Pbkdf2Params (Object)

Properties:

ProfitLoss (Object)

Properties:

Report (Object)

Properties:

REPORTING_STATE (Object)

Serves as an enum for the state of a stake token.

Properties:

ScryptParams (Object)

Properties:

SingleOutcomeOrderBook (Object)

Properties:

SingleOutcomeOrderBookSide (Object)

Properties:

SingleOutcomePriceTimeSeries (Object)

Properties:

STAKE_TOKEN_STATE (Object)

Serves as an enum for the state of a stake token.

Properties:

StakeToken (Object)

Properties:

TimestampedPrice (Object)

Properties:

UserTrade (Object)

Properties:

UserTradePosition (Object)

Properties:

Call API

// Call API Example
/**
* Get the Number of Outcomes for the Market at address:
* 0x9368ff3e9ce1c0459b309fac6dd4e69229b91a42
*/

var market = "0x9368ff3e9ce1c0459b309fac6dd4e69229b91a42";
var params = { tx: { to: market } };

// augur.api.<Contract Name>.<Contract Method>(<Params Object>, <Callback Function>);

// Asynchronous call -- STRONGLY RECOMMENDED.
augur.api.Market.getNumberOfOutcomes(params, function (error, numOutcomes) {
  console.log(error);
  console.log(numOutcomes);
});
// console prints 2

// Synchronous call -- Possible, but not recommended.
var outcomes = augur.api.Market.getNumberOfOutcomes(error, params);
// outcomes = 2

The Call API of augur.js is made up of “getter” functions that retrieve information from Augur’s Solidity smart contracts using Ethereum’s eth_call RPC; however, these functions do not write any information to the Ethereum blockchain. The Call API is intended for more granular “gets” than the Simplified API allows, and its functions are mapped directly to the public functions of Augur’s Solidity smart contracts.

All functions in the Call API accept two arguments:

  1. A params object that contains the Ethereum contract address to call and any key/value pairs that match the input parameters for the contract method.
  2. A callback function.

The Call API functions are part of the augur.api object and follow a pattern of augur.api.<Contract Name>.<Contract Function>(<Params Object>, <Callback Function>).

While technically optional, the Augur development team strongly recommends using a callback. Without it, the calls will be synchronous, which can lock up the web browser until they complete.

Augur Call API

var augur = "0xd6d6eaefcfaf7ea1e17c4768a554d57800699eb7";

augur.api.Augur.isKnownUniverse({ 
  tx: { to: augur },
  _universe: "0x22d6eaefcfaf7ea1e17c4768a554d57800699ecc"
}, function (error, isKnownUniverse) { console.log(isKnownUniverse); });
// example output:
"1"

Augur Contract Code

The Augur contract maintains the existing Universes within Augur and handles much of Augur’s event logging.

augur.api.Augur.isKnownUniverse({ tx, _universe }[, callback])

Augur keeps track of the Genesis Universe and all Child Universes internally. This function returns 1 if the specified _universe is in that list of known Universes, or 0 otherwise.

Dispute Crowdsourcer Call API

// Dispute Crowdsourcer Contract Call API Examples:
var disputeCrowdsourcer = "0xafa6eaefcfaf7ea1e17c4768a554d57800699ec5";

augur.api.DisputeCrowdsourcer.getFeeWindow({ tx: { to: disputeCrowdsourcer } }, function (error, feeWindow) { console.log(feeWindow); });
// example output:
"0x1f90cc6b4e89303e451c9b852827b5791667f570"

augur.api.DisputeCrowdsourcer.getMarket({ tx: { to: disputeCrowdsourcer } }, function (error, market) { console.log(market); });
// example output:
"0xaa90cc6b4e89303e451c9b852827b5791667f5aa"

augur.api.DisputeCrowdsourcer.getPayoutDistributionHash({ tx: { to: disputeCrowdsourcer } }, function (error, payoutDistributionHash) { console.log(payoutDistributionHash); });
// example output:
"0x4480ed40f94e2cb2ca244eb862df2d350300904a96039eb53cba0e34b8ace90a"

augur.api.DisputeCrowdsourcer.getPayoutNumerator({ tx: { to: disputeCrowdsourcer } }, function (error, payoutNumerator) { console.log(payoutNumerator); });
// example output:
"1000"

augur.api.DisputeCrowdsourcer.getReputationToken({ tx: { to: disputeCrowdsourcer } }, function (error, reputationToken) { console.log(reputationToken); });
// example output:
"0xff90cc6b4e89303e451c9b852827b5791667f5ff"

augur.api.DisputeCrowdsourcer.getSize({ tx: { to: disputeCrowdsourcer } }, function (error, size) { console.log(size); });
// example output:
"174435000000000000"

augur.api.DisputeCrowdsourcer.getStake({ tx: { to: disputeCrowdsourcer } }, function (error, stake) { console.log(stake); });
// example output:
"78123523"

augur.api.DisputeCrowdsourcer.isDisavowed({ tx: { to: disputeCrowdsourcer } }, function (error, isDisavowed) { console.log(isDisavowed); });
// example output:
"1"

augur.api.DisputeCrowdsourcer.isInvalid({ tx: { to: disputeCrowdsourcer } }, function (error, isInvalid) { console.log(isInvalid); });
// example output:
"1"

DisputeCrowdsourcer Contract Code

augur.api.DisputeCrowdsourcer.getFeeWindow({ tx }[, callback])

Returns the Ethereum address of the Fee Window to which the specified Dispute Crowdsourcer belongs, as a hexadecimal string.

augur.api.DisputeCrowdsourcer.getMarket({ tx }[, callback])

Returns the Market Ethereum address for the specified Dispute Crowdsourcer, as a hexadecimal string.

augur.api.DisputeCrowdsourcer.getPayoutDistributionHash({ tx }[, callback])

Returns the Payout Distribution Hash for the specified Dispute Crowdsourcer, as a 32-byte hexadecimal string.

augur.api.DisputeCrowdsourcer.getPayoutNumerator({ tx }[, callback])

Returns the Payout Numerator for the specified Dispute Crowdsourcer, as an unsigned integer.

augur.api.DisputeCrowdsourcer.getReputationToken({ tx }[, callback])

Returns the Reputation Token (REP) Ethereum address for the specified Dispute Crowdsourcer, as a hexadecimal string. In order to Challenge a Tentative Outcome by Staking on a Dispute Crowdsourcer, Reporters need REP. A Dispute Crowdsourcer only accepts one REP contract as the source of Staked REP, and this method returns that contract’s address.

augur.api.DisputeCrowdsourcer.getSize({ tx }[, callback])

Returns the amount of attoREP required to be Staked on the Outcome of the specified Dispute Crowdsourcer in order to Challenge the Tentative Outcome of a Market.

augur.api.DisputeCrowdsourcer.getStake({ tx }[, callback])

Returns the amount of attoREP Staked on the specified Dispute Crowdsourcer.

augur.api.DisputeCrowdsourcer.isDisavowed({ tx }[, callback])

Returns whether the Dispute Crowdsourcer is no longer valid. A Dispute Crowdsourcer will get disavowed when its Market migrates to a new Universe after a Fork in another Market is resolved. If the Market has been migrated to a new Universe, it will get reset back to the Designated Reporting Phase or Open Reporting Phase (if it was in either of those Phases when the Fork occurred), or if it was in the middle of a Dispute Round when the Fork occurred, it will get reset to the Waiting for the Next Fee Window to Begin Phase and all Stake in the Market’s Dispute Crowdsourcers will be reset.

Returns: 1 if the Dispute Crowdsourcer has been disavowed, or 0 otherwise.

augur.api.DisputeCrowdsourcer.isInvalid({ tx }[, callback])

Returns whether the Dispute Crowdsourcer is for the Invalid Outcome of a Market. If it is, the function will return 1; otherwise, it will return 0.

Fee Window Call API

// Fee Window Contract Call API Examples:
var feeWindow = "0x06cbcd92af2571f1419b622a794d65db524f682a";

augur.api.FeeWindow.getAvgReportingGasPrice({ tx: { to: feeWindow } }, function (error, avgReportingGasPrice) { console.log(avgReportingGasPrice); });
// example output:
"340000"

augur.api.FeeWindow.getEndTime({ tx: { to: feeWindow } }, function (error, endTime) { console.log(endTime); });
// example output:
"1500388730"

augur.api.FeeWindow.getNumDesignatedReportNoShows({ tx: { to: feeWindow } }, function (error, numDesignatedReportNoShows) { console.log(numDesignatedReportNoShows); });
// example output:
"2"

augur.api.FeeWindow.getNumIncorrectDesignatedReportMarkets({ tx: { to: feeWindow } }, function (error, numIncorrectDesignatedReportMarkets) { console.log(numIncorrectDesignatedReportMarkets); });
// example output:
"10"

augur.api.FeeWindow.getNumInvalidMarkets({ tx: { to: feeWindow } }, function (error, numInvalidMarkets) { console.log(numInvalidMarkets); });
// example output:
"3"

augur.api.FeeWindow.getNumMarkets({ tx: { to: feeWindow } }, function (error, numMarkets) { console.log(numMarkets); });
// example output:
"65"

augur.api.FeeWindow.getReputationToken({ tx: { to: feeWindow } }, function (error, reputationToken) { console.log(reputationToken); });
// example output:
"0x2a73cec0b62fcb8c3120bc80bdb2b1351c8c2d1e"

augur.api.FeeWindow.getStartTime({ tx: { to: feeWindow } }, function (error, startTime) { console.log(startTime); });
// example output:
"14995895900"

augur.api.FeeWindow.getUniverse({ tx: { to: feeWindow } }, function (error, universe) { console.log(universe); });
// example output:
"0x0920d1513057572be46580b7ef75d1d01a99a3e5"

augur.api.FeeWindow.isActive({ tx: { to: feeWindow } }, function (error, isActive) { console.log(isActive); });
// example output:
"1"

var _market = "0x9368ff3e9ce1c0459b309fac6dd4e69229b91a42";
augur.api.FeeWindow.isContainerForMarket({
  tx: { to: feeWindow },
  _shadyMarket: _market
}, function (error, isContainerForMarket) { console.log(isContainerForMarket); });
// example output:
"1"

augur.api.FeeWindow.isForkingMarketFinalized({ tx: { to: feeWindow } }, function (error, isForkingMarketFinalized) { console.log(isForkingMarketFinalized); });
// example output:
"0"

augur.api.FeeWindow.isOver({ tx: { to: feeWindow } }, function (error, isOver) { console.log(isOver); });
// example output:
"0"

FeeWindow Contract Code

augur.api.FeeWindow.getAvgReportingGasPrice({ tx }[, callback ])

Returns the average amount of gas spent to submit either a Designated Report or First Public Report in the specified Fee Window.

augur.api.FeeWindow.getEndTime({ tx }[, callback])

Returns a Unix timestamp for when the specified Fee Window will end. A Fee Window is considered active for a total of 7 days, then ends, and is no longer considered to be active.

augur.api.FeeWindow.getNumDesignatedReportNoShows({ tx }[, callback])

Returns the number of Markets belonging to the specified Fee Window in which the Designated Reporter failed to Report during the Designated Reporting Phase. These Markets will have a Designated Report No-Show Gas Bond and Designated Report No-Show REP Bond up for grabs for the First Public Reporter because these Markets have yet to receive a Report. This only includes Markets where Designated Reporters failed to Report, and does not include Markets where the Designated Reporter’s Tentative Outcome was Challenged.

augur.api.FeeWindow.getNumIncorrectDesignatedReportMarkets({ tx }[, callback])

Returns the number of Unfinalized Markets belonging to the specified Fee Window in which Designated Reporter’s Tentative Outcome was Challenged during the current Dispute Round Phase, or the Designated Reporter failed to submit a Designated Report.

augur.api.FeeWindow.getNumInvalidMarkets({ tx }[, callback])

Returns the number of Markets that were Reported to be Invalid during the specified Fee Window. Invalid Markets are Markets that aren’t clearly defined or do not fit one of the Outcomes set for this Market. Reporters are encouraged to Report the Market as Invalid if they can’t confidently Stake their REP into a single Outcome for the Market.

augur.api.FeeWindow.getNumMarkets({ tx }[, callback])

Returns the total number of Markets that are in the Dispute Round Phase for the specified Fee Window.

augur.api.FeeWindow.getReputationToken({ tx }[, callback])

Returns the Reputation Token (REP) Ethereum address for the specified Fee Window, as a hexadecimal string. Every Fee Window has a Dispute Phase where Reporters can Challenge the Tentative Outcome of Markets. In order to Challenge a Tentative Outcome, Reporters need to Stake REP. A Fee Window only accepts one REP contract as the source of Staked REP, and this method returns that contract’s address.

augur.api.FeeWindow.getStartTime({ tx }[, callback])

Returns a Unix timestamp of when a Fee Window becomes active and starts. A Fee Window is considered active for a total of 7 days, then ends, and is no longer considered to be active. Only active Fee Windows allow Reporters to Challenge the Tentative Outcomes of Markets contained in the Fee Window.

augur.api.FeeWindow.getUniverse({ tx }[, callback])

Returns the Universe Ethereum address that the specified Fee Window belongs to, as a hexadecimal string. Every Fee Window belongs to a specific Universe in which they were created and can operate.

augur.api.FeeWindow.isActive({ tx }[, callback])

This method returns whether the specified Fee Window is currently active. Fee Windows are considered active during the Window’s Dispute Round Phase, which last a total of 7 days. Returns 1 if the specified Fee Window is active, or 0 otherwise.

augur.api.FeeWindow.isContainerForMarket({ tx, _shadyMarket }[, callback])

Returns whether the _shadyMarket address provided is a Market that is set to be Reported on during the Fee Window. Markets are assigned a Fee Window that is the first Fee Window following the Market’s End Time. Returns 1 if the Market belongs to the specified Fee Window, or 0 if not.

augur.api.FeeWindow.isForkingMarketFinalized({ tx }[, callback])

Returns whether the Forked Market that caused this Fee Window’s Universe to be created has been Finalized. Every Fee Window belongs to a Universe and all Universes, except for the first Universe, are created because of a Fork. Returns 1 if the Forked Market is Finalized, or 0 otherwise.

augur.api.FeeWindow.isOver({ tx }[, callback])

Returns whether the 7-day Fee Window specified has ended.

Initial Reporter Call API

// Initial Reporter Contract Call API Examples:
var initialReporter = "0xbcb6eaefcfaf7ea1e17c4768a554d57800699ed3";

augur.api.InitialReporter.designatedReporterShowed({ tx: { to: initialReporter } }, function (error, designatedReporterShowed) { console.log(designatedReporterShowed); });
// example output:
"1"

augur.api.InitialReporter.designatedReporterWasCorrect({ tx: { to: initialReporter } }, function (error, designatedReporterWasCorrect) { console.log(designatedReporterWasCorrect); });
// example output:
"1"

augur.api.InitialReporter.getDesignatedReporter({ tx: { to: initialReporter } }, function (error, designatedReporter) { console.log(designatedReporter); });
// example output:
"0xca3edca4ed326bbcb77e914b379913b12d49654d"

augur.api.InitialReporter.getFeeWindow({ tx: { to: initialReporter } }, function (error, feeWindow) { console.log(feeWindow); });
// example output:
"0x1f90cc6b4e89303e451c9b852827b5791667f570"

augur.api.InitialReporter.getMarket({ tx: { to: initialReporter } }, function (error, market) { console.log(market); });
// example output:
"0xaa90cc6b4e89303e451c9b852827b5791667f5aa"

augur.api.InitialReporter.getPayoutDistributionHash({ tx: { to: disputeCrowdsourcer } }, function (error, payoutDistributionHash) { console.log(payoutDistributionHash); });
// example output:
"0x4480ed40f94e2cb2ca244eb862df2d350300904a96039eb53cba0e34b8ace90a"

augur.api.InitialReporter.getPayoutNumerator({ tx: { to: initialReporter } }, function (error, payoutNumerator) { console.log(payoutNumerator); });
// example output:
"1000"

augur.api.InitialReporter.getReportTimestamp({ tx: { to: initialReporter } }, function (error, reportTimestamp) { console.log(reportTimestamp); });
// example output:
"1514956848"

augur.api.InitialReporter.getReputationToken({ tx: { to: initialReporter } }, function (error, reputationToken) { console.log(reputationToken); });
// example output:
"0x2a73cec0b62fcb8c3120bc80bdb2b1351c8c2d1e"

augur.api.InitialReporter.getSize({ tx: { to: initialReporter } }, function (error, size) { console.log(size); });
// example output:
"87443500000000000"

augur.api.InitialReporter.getStake({ tx: { to: initialReporter } }, function (error, stake) { console.log(stake); });
// example output:
"78000"

augur.api.InitialReporter.isInvalid({ tx: { to: initialReporter } }, function (error, isInvalid) { console.log(isInvalid); });
// example output:
"1"

InitialReporter Contract Code

The Initial Reporter contract handles functionality related to both Designated Reporting and Open Reporting.

augur.api.InitialReporter.designatedReporterShowed({ tx }[, callback])

Returns 1 if the Designated Reporter submitted a Report within the Designated Reporting Phase, or 0 otherwise.

augur.api.InitialReporter.designatedReporterWasCorrect({ tx }[, callback])

Returns 1 if the Payout Distribution Hash submitted in the Designated Report is the same as the winning Payout Distribution Hash for the specified InitialReporter contract.

augur.api.InitialReporter.getDesignatedReporter({ tx }[, callback])

Returns the Ethereum address for the Designated Reporter set for the specified InitialReporter contract, as a hexadecimal string.

augur.api.InitialReporter.getFeeWindow({ tx }[, callback])

Returns the Ethereum address of the Fee Window to which the specified InitialReporter contract belongs, as a hexadecimal string.

augur.api.InitialReporter.getMarket({ tx }[, callback])

Returns the Market Ethereum address for the specified InitialReporter contract, as a hexadecimal string.

augur.api.InitialReporter.getPayoutDistributionHash({ tx }[, callback])

Returns the Payout Distribution Hash for the specified InitialReporter contract, as a 32-byte hexadecimal string.

augur.api.InitialReporter.getPayoutNumerator({ tx }[, callback])

Returns the Payout Numerator for the specified InitialReporter contract, as an unsigned integer.

augur.api.InitialReporter.getReportTimestamp({ tx }[, callback])

Returns the Unix timestamp of when the Initial Report (either the Designated Report or the First Public Report) was submitted.

augur.api.InitialReporter.getReputationToken({ tx }[, callback])

Returns the Reputation Token (REP) Ethereum address for the specified InitialReporter contract. In order to Challenge a Tentative Outcome by Staking on a Dispute Crowdsourcer, Reporters need REP. A Dispute Crowdsourcer only accepts one REP contract as the source of Staked REP, and this method returns that contract’s address.

augur.api.InitialReporter.getSize({ tx }[, callback])

Returns the amount of attoREP Staked on the Reported Outcome for the Initial Report.

augur.api.InitialReporter.getStake({ tx }[, callback])

Returns the amount of attoREP Staked on the Initial Report for the Market of the specified InitialReporter contract.

augur.api.InitialReporter.isInvalid({ tx }[, callback])

Returns whether the Outcome submitted in the Initial Report is for the Invalid Outcome of a Market. If it is, the function will return 1; otherwise, it will return 0.

Market Call API

// Market Contract Call API Examples:
var market = "0x9368ff3e9ce1c0459b309fac6dd4e69229b91a42";

augur.api.Market.derivePayoutDistributionHash({
  tx: { to: market } },
  _payoutNumerators: [ 0, 1000 ],
  _invalid: false,
});
// example output:
"1"

augur.api.Market.designatedReporterShowed({ tx: { to: market } }, function (error, designatedReporterShowed) { console.log(designatedReporterShowed); });
// example output:
"1"

augur.api.Market.designatedReporterWasCorrect({ tx: { to: market } }, function (error, designatedReporterWasCorrect) { console.log(designatedReporterWasCorrect); });
// example output:
"1"

augur.api.Market.getDenominationToken({ tx: { to: market } }, function (error, denominationToken) { console.log(denominationToken); });
// example output:
"0x30e3852448f4ab5d62bbf7544ca3c92daca5c957"

augur.api.Market.getDesignatedReporter({ tx: { to: market } }, function (error, designatedReporter) { console.log(designatedReporter); });
// example output:
"0xca3edca4ed326bbcb77e914b379913b12d49654d"

augur.api.Market.getEndTime({ tx: { to: market } }, function (error, endTime) { console.log(endTime); });
// example output:
"1500388730";

augur.api.Market.getFeeWindow({ 
  tx: { to: market }, 
  _feeWindowId: 578,
}, function (error, feeWindow) { console.log(feeWindow); });
// example output:
"0x1f90cc6b4e89303e451c9b852827b5791667f570"

augur.api.Market.getFinalizationTime({ tx: { to: market } }, function (error, finalizationTime) { console.log(finalizationTime); });
// example output:
"1500647930";

augur.api.Market.getForkingMarket({ tx: { to: market } }, function (error, forkedMarket) { console.log(forkedMarket); });
// example output:
"0x0"

augur.api.Market.getMarketCreatorMailbox({ tx: { to: market } }, function (error, marketCreatorMailbox) { console.log(marketCreatorMailbox); });
// example output:
"0xeabdeaefcfaf7ea1e17c4768a554d5780069eabd"

augur.api.Market.getMarketCreatorSettlementFeeDivisor({ tx: { to: market } }, function (error, marketCreatorSettlementFee) { console.log(marketCreatorSettlementFee); });
// example output:
"20000000000000000"

augur.api.Market.getNumberOfOutcomes({ tx: { to: market } }, function (error, numOutcomes) { console.log(numOutcomes); });
// example output:
"2"

augur.api.Market.getNumTicks({ tx: { to: market } }, function (error, numTicks) { console.log(numTicks); });
// example output:
"1000"

augur.api.Market.getReputationToken({ tx: { to: market } }, function (error, reputationToken) { console.log(reputationToken); });
// example output:
"0x23b17188ce3c491f6ab4427258d92452be5c8045"

augur.api.Market.getShareToken({
  tx: { to: market },
  _outcome: 1
}, function (error, shareToken) { console.log(shareToken); });
// example output:
"0x18b17188ce3c491f6ab4427258d92452be5c8054"

augur.api.Market.getStakeInOutcome({ 
  tx: { to: market }, 
  _payoutDistributionHash: "0x4480ed40f94e2cb2ca244eb862df2d350300904a96039eb53cba0e34b8ace90a" 
}, function (error, stakeInOutcome) { console.log(stakeInOutcome); });
// example output:
"12378786123"

augur.api.Market.getTotalStake({ tx: { to: market } }, function (error, totalStake) { console.log(totalStake); });
// example output:
"161278368761238475"

augur.api.Market.getUniverse({ tx: { to: market } }, function (error, universe) { console.log(universe); });
// example output:
"0x0920d1513057572be46580b7ef75d1d01a99a3e5"

augur.api.Market.getWinningPayoutDistributionHash({ tx: { to: market } }, function (error, winningDistributionHash) { console.log(winningDistributionHash); });
// example output:
"0x4480ed40f94e2cb2ca244eb862df2d350300904a96039eb53cba0e34b8ace90a"

augur.api.Market.getWinningPayoutNumerator({
  tx: { to: market },
  _outcome: "0"
}, function (error, getWinningPayoutNumerator) { console.log(getWinningPayoutNumerator); });
// example output:
"1000"

augur.api.Market.isContainerForReportingParticipant({
  tx: { to: market },
  _shadyReportingParticipant: "0x18b17188ce3c491f6ab4427258d92452be5c8054"
}, function (error, isContainerForReportingParticipant) { console.log(isContainerForReportingParticipant); });
// example output:
"1"

augur.api.Market.isContainerForShareToken({
  tx: { to: market },
  _shadyShareToken: "0x18b17188ce3c491f6ab4427258d92452be5c8054"
}, function (error, isContainerForShareToken) { console.log(isContainerForShareToken); });
// example output:
"1"

augur.api.Market.isFinalized({
  tx: { to: market },
}, function (error, isFinalized) { console.log(isFinalized); });
// example output:
"1"

augur.api.Market.isInvalid({
  tx: { to: market }
}, function (error, isInvalid) { console.log(isInvalid); });
// example output:
"1"

Market Contract Code

augur.api.Market.derivePayoutDistributionHash({ tx, _payoutNumerators, _invalid, onSent, onSuccess, onFailed })

Returns the Payout Distribution Hash of the specified Market for the _payoutNumerators and _invalid passed in. If the Payout Set (referred to as Payout Numerators in the function), is valid, then a Payout Distribution Hash is created by hashing the Payout Set and _invalid using the keccak256 algorithm.

augur.api.Market.designatedReporterShowed({ tx }[, callback])

Returns 1 if the Designated Reporter submitted a Report within the Designated Reporting Phase, or 0 otherwise.

augur.api.Market.designatedReporterWasCorrect({ tx }[, callback])

Returns 1 if the Payout Distribution Hash submitted in the Designated Report is the same as the winning Payout Distribution Hash for the specified Market.

augur.api.Market.getDenominationToken({ tx }[, callback])

Returns the Ethereum address of the token used to denominate the specified Market, as a hexadecimal string. A Denomination Token is the ERC-20 Token used as the currency to trade on the Outcome of a Market. Currently, this function will always return the address of a Cash contract; however, Augur will eventually support other types of Denomination Tokens.

augur.api.Market.getDesignatedReporter({ tx }[, callback])

Returns the Ethereum address for the Designated Reporter set for the specified Market, as a hexadecimal string. Every Market is required to have an assigned Designated Reporter, which is set by the Market Creator during Market creation.

augur.api.Market.getEndTime({ tx }[, callback])

Returns the Unix timestamp for when the specified Market’s event has come to pass. When the Market’s End Time passes, the Market enters the Designated Reporting Phase.

augur.api.Market.getFeeWindow({ tx, _feeWindowId }[, callback])

Returns the Ethereum address of the Fee Window _feeWindowId in a Market, as a hexidecimal string.

augur.api.Market.getFinalizationTime({ tx }[, callback])

Returns the timestamp for when the specified Market was Finalized. A Finalized Market has a Final Outcome set from successful Market Resolution which cannot be Challenged, and the Market is considered Settled.

augur.api.Market.getForkingMarket({ tx }[, callback])

Returns the Ethereum address of the Forked Market for the Universe that contains the specified Market address. If the Market address specified belongs in a Universe that hasn’t had a Fork take place, this will return 0x0.

augur.api.Market.getMarketCreatorMailbox({ tx }[, callback])

Returns the Ethereum address of the Market Creator Mailbox for market. Market Creators can use this address to collect their fees.

augur.api.Market.getMarketCreatorSettlementFeeDivisor({ tx }[, callback])

Returns the Creator Fee set by the Market Creator, denominated in attotokens per Settlement of a Complete Set, for the specified Market.

augur.api.Market.getNumberOfOutcomes({ tx }[, callback])

Returns the number of Outcomes for a specified Market. The number of Outcomes is the number of potential results for the Market event.

augur.api.Market.getNumTicks({ tx }[, callback])

Returns the Number of Ticks set for a specific Market. The Number of Ticks represents the number of valid price points between the Market’s Minimum Price and Maximum Price.

augur.api.Market.getReputationToken({ tx }[, callback])

Returns the Ethereum address of the Reputation Token (REP) for the specified Market, as a hexadecimal string. REP is Staked whenever an Initial Report is submitted or when users attempt to Challenge the Tentative Outcome of a Market. A Market only accepts one REP contract as the source of Staked REP, and this method returns that contract’s address.

augur.api.Market.getShareToken({ tx, _outcome }[, callback])

Returns the Ethereum address of the Share Token for the specified Market and Outcome. Every Outcome of a Market has a separate Share Token used to handle trading around that Outcome and this method returns the contract address of the Share Tokens for the specified Outcome.

augur.api.Market.getStakeInOutcome({ tx, _payoutDistributionHash }[, callback])

Returns the amount of attoREP that has been Staked on the Outcome with the Payout Distribution Hash _payoutDistributionHash in the specified Market.

augur.api.Market.getTotalStake({ tx }[, callback])

Returns the total amount of attoREP Staked on the specified Market. This amount is combined total of attoREP Staked on the Initial Report and attoREP Staked on every successful Dispute Crowdsourcer.

augur.api.Market.getUniverse({ tx }[, callback])

Returns the Etherem address of the Universe that the specified market is contained within. All Markets are created in a specific Universe, and new Universes are created if a Fork occurs.

augur.api.Market.getWinningPayoutDistributionHash({ tx }[, callback])

Returns the winning Payout Distribution Hash for a particular Market, as a 32-byte hexadecimal string.

augur.api.Market.getWinningPayoutNumerator({ tx, _outcome }[, callback])

Returns the winning Payout Numerator for Outcome _outcome in a particular Market, as an unsigned integer.

augur.api.Market.isContainerForReportingParticipant({ tx, _shadyReportingParticipant }[, callback])

Returns whether the specified Market is a container for the Ethereum address of Reporting Participant contract _shadyReportingParticipant. If the Market is a container for the Reporting Participant contract, this function returns 1; otherwise, it returns 0. Both the DisputeCrowdsourcer and InitialReporter classes in Augur’s Solidity smart contracts are considered Reporting Participants, since they have the parent class BaseReportingParticipant.

augur.api.Market.isContainerForShareToken({ tx, _shadyShareToken }[, callback])

Returns whether the specified Market is a container for the Share Token Ethereum address _shadyShareToken. This function will return 1 if _shadyShareToken is a Share Token belonging to the Market, otherwise it will return 0.

augur.api.Market.isFinalized({ tx }[, callback])

Returns 1 if the Market has been Finalized (that is, its winning Payout Distribution Hash is set), or 0 otherwise.

augur.api.Market.isInvalid({ tx }[, callback])

Returns 1 if the specified Market has been Finalized as Invalid, or returns 0 otherwise.

Orders Call API

// Orders Contract Call API Examples:
var orders = "0x8868ff3e9ce1c0459b309fac6dd4e69229b91a56";
var _orderId = "0x7ca90ca9118db456d87e3d743b97782a857200b55039f7ffe8de94e5d920f870";
var _type = "1";
var _market = "0x9368ff3e9ce1c0459b309fac6dd4e69229b91a42";
var _outcome = "1";
var _fxpPrice = "450000000000000000"; // 0.45

augur.api.Orders.assertIsNotBetterPrice({
  tx: { to: orders },
  _type: _type,
  _fxpPrice: _fxpPrice,
  _betterOrderId: _orderId
}, function (error, isNotBetterPrice) { console.log(isNotBetterPrice); });
// example output:
"1"

augur.api.Orders.assertIsNotWorsePrice({
  tx: { to: orders },
  _type: _type,
  _fxpPrice: _fxpPrice,
  _worstOrderId: _orderId
}, function (error, isNotWorstPrice) { console.log(isNotWorstPrice); });
// example output:
"0"

augur.api.Orders.getAmount({ 
  tx: { to: orders }, 
  _orderId: _orderId 
}, function (error, amount) { console.log(amount); });
// example output:
"15"

augur.api.Orders.getBestOrderId({
  tx: { to: orders },
  _type: _type,
  _market: _market,
  _outcome: _outcome
}, function (error, bestOrderID) { console.log(bestOrderID); });
// example output:
"0x7ca90ca9118db456d87e3d743b97782a857200b55039f7ffe8de94e5d920f870"

augur.api.Orders.getBetterOrderId({ 
  tx: { to: orders },
  _orderId: "0x49cb49f610b5f6e31ee163a8ad65f964af1088e38c8a1b07f1218177b5e006b5"
}, function (error, betterOrderId) { console.log(betterOrderId); });
// example output:
"0x7ca90ca9118db456d87e3d743b97782a857200b55039f7ffe8de94e5d920f870"

augur.api.Orders.getLastOutcomePrice({
  tx: { to: orders },
  _market: _market,
  _outcome: _outcome
}, function (error, lastOutcomePrice) { console.log(lastOutcomePrice); });
// example output:
"490000000000000000"

augur.api.Orders.getMarket({ 
  tx: { to: orders },
  _orderId: _orderId
}, function (error, market) { console.log(market); });
// example output:
"0x9368ff3e9ce1c0459b309fac6dd4e69229b91a42";

augur.api.Orders.getOrderCreator({ 
  tx: { to: orders },
  _orderId: _orderId 
}, function (error, creator) { console.log(creator); });
// example output:
"0x438f2aeb8a16745b1cd711e168581ebce744ffaa";

augur.api.Orders.getOrderMoneyEscrowed({ 
  tx: { to: orders },
  _orderId: _orderId 
}, function (error, orderMoneyEscrowed) { console.log(orderMoneyEscrowed); });
// example output:
"5000000000000000000"

augur.api.Orders.getOrderSharesEscrowed({ 
  tx: { to: orders },
  _orderId: _orderId
}, function (error, orderSharesEscrowed) { console.log(orderSharesEscrowed); });
// example output:
"0"

augur.api.Orders.getOrderType({ 
  tx: { to: orders },
  _orderId: _orderId 
}, function (error, orderType) { console.log(orderType); });
// example output:
"1"

augur.api.Orders.getOutcome({ 
  tx: { to: orders },
  _orderId: _orderId 
}, function (error, outcome) { console.log(outcome); });
// example output:
"1"

augur.api.Orders.getPrice({ 
  tx: { to: orders },
  _orderId: _orderId 
}, function (error, price) { console.log(price); });
// example output:
"500000000000000000"

augur.api.Orders.getVolume({ 
  tx: { to: orders },
  _market: _market 
}, function (error, volume) { console.log(volume); });
// example output:
"100000000000000000000000"

augur.api.Orders.getWorseOrderId({ 
  tx: { to: orders },
  _orderId: "0x4b538f4de2517f7d7bbb227161981c51c40bf725da9941b3dc02e6c14cafd1f1" 
}, function (error, worseOrderID) { console.log(worseOrderID); });
// example output:
"0x9a8d5523ed521813533d1f8469f5040fa1404fcf470b9da43bccfe38c80ad035"

augur.api.Orders.getWorstOrderId({
  tx: { to: orders },
  _type: _type,
  _market: _market,
  _outcome: _outcome
}, function (error, worstOrderID) { console.log(worstOrderID); });
// example output:
"0x9a8d5523ed521813533d1f8469f5040fa1404fcf470b9da43bccfe38c80ad035"

augur.api.Orders.isBetterPrice({
  tx: { to: orders },
  _type: _type,
  _fxpPrice: _fxpPrice,
  _orderId: _orderId
}, function (error, isBetterPrice) { console.log(isBetterPrice); });
// example output:
"0"

augur.api.Orders.isWorsePrice({
  tx: { to: orders },
  _type: _type,
  _fxpPrice: _fxpPrice,
  _orderId: _orderId
}, function (error, isWorsePrice) { console.log(isWorsePrice); });
// example output:
"1"

Orders Contract Code

augur.api.Orders.assertIsNotBetterPrice({ tx, _type, _fxpPrice, _betterOrderId }[, callback])

Returns whether the specified _fxpPrice is not a better price than the _betterOrderId for a given Order _type. Returns 1 if true, 0 if false.

augur.api.Orders.assertIsNotWorsePrice({ tx, _type, _fxpPrice, _worstOrderId }[, callback])

Returns whether the specified _fxpPrice is not a worst price than the _worstOrderId for a given order _type. Returns 1 if true, 0 if false.

augur.api.Orders.getAmount({ tx, _orderId }[, callback])

Returns the amount of Shares requested on a specified _orderId.

augur.api.Orders.getBestOrderId({ tx, _type, _market, _outcome }[, callback])

Returns the order ID of the best order on the _market of _type trading on the provided _outcome.

augur.api.Orders.getBestOrderWorstOrderHash({ tx, _market, _outcome, _type }[, callback])

Returns a sha256 order hash containing the inputted params _market, _outcome, and _type.

augur.api.Orders.getBetterOrderId({ tx, _orderId }[, callback])

Returns a better order ID than the _orderId.

augur.api.Orders.getLastOutcomePrice({ tx, _market, _outcome }[, callback])

Returns the fixed point value of the last price traded for a specified _market and _outcome.

augur.api.Orders.getMarket({ tx, _orderId }[, callback])

Returns the Market address for the specified _orderId.

augur.api.Orders.getOrderCreator({ tx, _orderId }[, callback])

Returns the Creator address of the specified _orderId.

augur.api.Orders.getOrderMoneyEscrowed({ tx, _orderId }[, callback])

Returns the fixed point value of the amount of money escrowed by the Creator for a specified _orderId.

augur.api.Orders.getOrderSharesEscrowed({ tx, _orderId }[, callback])

Returns the fixed point value of the amount of shares escrowed by the Creator for a specified _orderId.

augur.api.Orders.getOrderType({ tx, _orderId }[, callback])

Returns the trade type, 1 for bid and 2 for ask, for a specified _orderId.

augur.api.Orders.getOutcome({ tx, _orderId }[, callback])

Returns the Outcome being traded on for the specified _orderId.

augur.api.Orders.getPrice({ tx, _orderId }[, callback])

Returns the fixed point value of the price of a specified _orderId.

augur.api.Orders.getVolume({ tx, _market }[, callback])

Returns the fixed point value of the volume of a specified _market.

augur.api.Orders.getWorseOrderId({ tx, _orderId }[, callback])

Returns a worse order ID than the _orderId.

augur.api.Orders.getWorstOrderId({ tx, _type, _market, _outcome }[, callback])

Returns the order ID of the worst order on the _market of _type trading on the provided _outcome.

augur.api.Orders.isBetterPrice({ tx, _type, _fxpPrice, _orderId }[, callback])

Returns whether the specified _fxpPrice is a better price than the _orderId for a given order _type. Returns 1 if true, 0 if false.

augur.api.Orders.isWorsePrice({ tx, _type, _fxpPrice, _orderId }[, callback])

Returns whether the specified _fxpPrice is a worst price than the _orderId for a given order _type. Returns 1 if true, 0 if false.

Orders Fetcher Call API

// Orders Fetcher Contract Call API Examples:
var ordersFetcher = "0x7768ff3e9ce1c0459b309fac6dd4e69229b91a77";
var _orderId = "0x7ca90ca9118db456d87e3d743b97782a857200b55039f7ffe8de94e5d920f870";
var _type = "1";
var _market = "0x9368ff3e9ce1c0459b309fac6dd4e69229b91a42";
var _outcome = "1";
var _fxpPrice = "450000000000000000"; // 0.45

augur.api.OrdersFetcher.ascendOrderList({
  tx: { to: ordersFetcher },
  _type: _type,
  _fxpPrice: _fxpPrice,
  _lowestOrderId: _orderId
}, function (error, ascendingOrderList) { console.log(ascendingOrderList); });
// example output:
[ "0x7ca90ca9118db456d87e3d743b97782a857200b55039f7ffe8de94e5d920f870",
  "0x4a8d07c2c9cd996484c04b7077d1fc4aeaeb8aa4750d7f26f2a896c4393fb6b0"]

augur.api.OrdersFetcher.descendOrderList({
  tx: { to: ordersFetcher },
  _type: _type,
  _fxpPrice: _fxpPrice,
  _highestOrderId: _orderId
}, function (error, decendingOrderList) { console.log(decendingOrderList); });
// example output:
[ "0x09502d4c2765d61a8e47fd4ada696966f3bc3bce6b780ecedded035e616c272e",
  "0x7ca90ca9118db456d87e3d743b97782a857200b55039f7ffe8de94e5d920f870"]

augur.api.OrdersFetcher.findBoundingOrders({
  tx: { to: ordersFetcher },
  _type: _type,
  _fxpPrice: _fxpPrice,
  _bestOrderId: _orderId,
  _worstOrderId: 0,
  _betterOrderId: 0,
  _worseOrderId: 0
}, function (error, boundingOrders) { console.log(boundingOrders); });
// example output:
[ "0x4a8d07c2c9cd996484c04b7077d1fc4aeaeb8aa4750d7f26f2a896c4393fb6b0",
  "0x09502d4c2765d61a8e47fd4ada696966f3bc3bce6b780ecedded035e616c272e"]

OrdersFetcher Contract Code

augur.api.OrdersFetcher.ascendOrderList({ tx, _type, _fxpPrice, _lowestOrderId }[, callback])

Returns an array containing the order IDs that should be the better Order ID and worse Order ID respectively for an order inserted at _fxpPrice. _lowestOrderId is an order ID expected to be a worse price than the _fxpPrice specified for an order of _type.

augur.api.OrdersFetcher.descendOrderList({ tx, _type, _fxpPrice, _highestOrderId }[, callback])

Returns an array containing the order IDs that should be set to better Order ID and worse Order ID respectively for an order inserted at _fxpPrice. _highestOrderId is an order ID expected to be a better price than the _fxpPrice specified for an order of _type.

augur.api.OrdersFetcher.findBoundingOrders({ tx, _type, _fxpPrice, _bestOrderId, _worstOrderId, _betterOrderId, _worseOrderId }[, callback])

Returns an array containing the order IDs that should be set to better Order ID and worse Order ID respectively for an order inserted at _fxpPrice. _betterOrderId and _worseOrderId should be orders that are better or worse than the _fxpPrice for an order of _type. _bestOrderId and _worstOrderId should be the best and worst order IDs on the order book for the specified _type.

Reputation Token Call API

// Reputation Token Contract Call API Examples:
var reputationToken = "0x2a73cec0b62fcb8c3120bc80bdb2b1351c8c2d1e";

augur.api.ReputationToken.getUniverse({ tx: { to: reputationToken } }, function (error, universe) { console.log(universe); });
// example output:
"0x0920d1513057572be46580b7ef75d1d01a99a3e5"

augur.api.ReputationToken.getTopMigrationDestination({ tx: { to: reputationToken } }, function (error, topMigrationDestination) { console.log(topMigrationDestination); });
// example output:
"0x1aa30942000ac72dee6580e1ac32d1d01ac1af00"

ReputationToken Contract Code

The Reputation Token, known as REP, is the key that allows Augur’s Decentralized Oracle system to function, and by extension the entirety of Augur. REP has three major functions, it’s used to Report on the Outcome of a Market, Challenge the Tentative Outcome of a Market, and as a Bond when creating a Market. Reporters Stake REP on the Outcome of a Market as a show of confidence in their Report. If the Reporter correctly staked on the Final Outcome of the Market they can claim their REP back, earn Reporting Fees proportional to their staked REP, and a portion of the REP incorrectly staked on other Outcomes.

REP is also used to Challenge the Tentative Outcome of Reports during the Dispute Round Phase. If the Challenge successfully changes the Tentative Outcome of a Market and that outcome becomes the Final Outcome, the Dispute Bond holder can redeem the bond for up to double the REP it cost to place. When creating a Market, the Market Creator is required to specify a Designated Reporter and pay a Designated Report No-Show REP Bond to ensure the Designated Reporter shows up. If the Designated Reporter doesn’t show up, the Market Creator’s Designated Report No-Show REP Bond will go to the First Public Reporter to Report on the Market. Their gas cost for the Report transaction will be covered by the Market Creator’s Designated Report No-Show Gas Bond, and the Designated Report No-Show REP Bond is added to whatever the First Public Reporter staked, there by improving her stake and potential rewards if correctly staked.

The Reputation Token is an ERC-20 token that implements all of the required functions listed in the ERC-20 Token Standard. It does not, however, implement the optional functions.

augur.api.ReputationToken.getUniverse({ tx }[, callback])

Returns the Universe address for the REP address provided. All of Augur’s information belongs to a Universe and each Universe has it’s own REP contract. New Universes are created in the event of a Fork.

augur.api.ReputationToken.getTopMigrationDestination({ tx }[, callback])

As mentioned in the previous method description, all of Augur’s Universes have their own REP contract, specific to that Universe. In the event of a Fork occurring, REP holders are expected to migrate their REP to one of the newly created Child Universes. The Child Universe with the most REP migrated to it at the end of the Fork Period will be the only Universe that allows for Settlement on the Forked Market and will be the Universe that all pending Markets will migrate to for Reporting. What this method does is returns the Universe address of the currently “winning” migration destination. In other words, this returns the Universe with the most REP migrated to it so far.

Share Token Call API

// Share Token Contract Call API Examples:
var shareToken = "0x18b17188ce3c491f6ab4427258d92452be5c8054";

augur.api.ShareToken.getMarket({ tx: { to: shareToken } }, function (error, market) { console.log(market); });
// example output:
"0x9368ff3e9ce1c0459b309fac6dd4e69229b91a42"

augur.api.ShareToken.getOutcome({ tx: { to: shareToken } }, function (error, outcome) { console.log(outcome); });
// example output:
"1"

ShareToken Contract Code

The Share Token is an ERC-20 token that implements all of the required functions listed in the ERC-20 Token Standard. It does not, however, implement the optional functions. Within Augur, it represents Shares in Market Outcomes.

augur.api.ShareToken.getMarket({ tx }[, callback])

Returns the Market Ethereum address for the specified ShareToken.

augur.api.ShareToken.getOutcome({ tx }[, callback])

Returns the Outcome of the Market that the specified ShareToken is for.

Universe Call API

// Universe Contract Call API Examples:
var universe = "0x0920d1513057572be46580b7ef75d1d01a99a3e5";
var _parentPayoutDistributionHash = "0x4480ed40f94e2cb2ca244eb862df2d350300904a96039eb53cba0e34b8ace90a";

augur.api.Universe.getChildUniverse({
  tx: { to: universe },
  _parentPayoutDistributionHash: _parentPayoutDistributionHash
}, function (error, childUniverse) { console.log(childUniverse); });
// example output:
"0xb4e8c1f85c4382d64954aca187f9f386c8bb1a6c"

augur.api.Universe.getCurrentFeeWindow({ tx: { to: universe } }, function (error, currFeeWindow) { console.log(currFeeWindow); });
// example output:
"0x1f90cc6b4e89303e451c9b852827b5791667f570"

augur.api.Universe.getDisputeRoundDurationInSeconds({ tx: { to: universe } }, function (error, disputeRoundDuration) { console.log(disputeRoundDuration); });
// example output:
"604800"

augur.api.Universe.getFeeWindow({ 
  tx: { to: universe }, 
  _feeWindowId: 578,
}, function (error, feeWindow) { console.log(feeWindow); });
// example output:
"0x1f90cc6b4e89303e451c9b852827b5791667f570"

augur.api.Universe.getFeeWindowByTimestamp({ 
  tx: { to: universe },
  _timestamp: 1514500367
}, function (error, feeWindow) { console.log(feeWindow); });
// example output:
"0x1f90cc6b4e89303e451c9b852827b5791667f570"

augur.api.Universe.getFeeWindowForForkEndTime({ tx: { to: universe } }, function (error, feeWindow) { console.log(feeWindow); });
// example output:
"0x1f90cc6b4e89303e451c9b852827b5791667f570"

augur.api.Universe.getFeeWindowId({ 
  tx: { to: universe },
  _timestamp: 1514500367
}, function (error, feeWindowId) { console.log(feeWindowId); });
// example output:
"578"

augur.api.Universe.getForkEndTime({ tx: { to: universe } }, function (error, forkEndTime) { console.log(forkEndTime); });
// example output:
"1489855429"

augur.api.Universe.getForkingMarket({ tx: { to: universe } }, function (error, forkingMarket) { console.log(forkingMarket); });
// example output:
"0x78f7b43150d27c464359e735781c16ac585f52a8"

augur.api.Universe.getForkReputationGoal({ tx: { to: universe } }, function (error, forkReputationGoal) { console.log(forkReputationGoal); });
// example output:
"150657"

augur.api.Universe.getInitialReportStakeSize({ tx: { to: universe } }, function (error, initialReportStakeSize) { console.log(initialReportStakeSize); });
// example output:
"0x000000000000000000000000000000000000000000000000026d285191d096ea"

augur.api.Universe.getNextFeeWindow({ tx: { to: universe } }, function (error, nextFeeWindow) { console.log(nextFeeWindow); });
// example output:
"0x45659544b89cce1dd53b1b566862189b25adec49"

augur.api.Universe.getOpenInterestInAttoEth({ tx: { to: universe } }, function (error, openInterestInAttoEth) { console.log(openInterestInAttoEth); });
// example output:
"7123876876123"

augur.api.Universe.getParentPayoutDistributionHash({ tx: { to: universe } }, function (error, universeParentPayoutDistributionHash) { console.log(universeParentPayoutDistributionHash); });
// example output:
"0xa310ca2018af3cb2ca244eb862df2d350300904a96039eb53cbaff012c92d10c"

augur.api.Universe.getParentUniverse({ tx: { to: universe } }, function (error, parentUniverse) { console.log(parentUniverse); });
// example output:
"0x63c59544b89cce1dd53b1b566862189b25adec41"

augur.api.Universe.getPreviousFeeWindow({ tx: { to: universe } }, function (error, previousFeeWindow) { console.log(previousFeeWindow); });
// example output:
"577"

augur.api.Universe.getRepMarketCapInAttoeth({ tx: { to: universe } }, function (error, repMarketCapInAttoeth) { console.log(repMarketCapInAttoeth); });
// example output:
"985864880000000000"

augur.api.Universe.getReputationToken({ tx: { to: universe } }, function (error, reputationTokenAddress) { console.log(reputationTokenAddress); });
// example output:
"0x2fb561b2bdbcd1ae1995bdd6aff6776d6f4292f2"

augur.api.Universe.getTargetRepMarketCapInAttoeth({ tx: { to: universe } }, function (error, targetRepMarketCapInAttoeth) { console.log(targetRepMarketCapInAttoeth); });
// example output:
"985865890000000000"

augur.api.Universe.getWinningChildUniverse({ tx: { to: universe } }, function (error, winningChildUniverse) { console.log(winningChildUniverse); });
// example output:
"0x432561b2bdbcd1ae1995bdd6aff6776d6f4292f2"

augur.api.Universe.isContainerForFeeToken({
  tx: { to: universe },
  _shadyFeeToken: "0x2a73cec0b62fcb8c3120bc80bdb2b1351c8c2d1e"
}, function (error, isContainerForFeeToken) { console.log(isContainerForFeeToken); });
// example output:
"1"

augur.api.Universe.isContainerForFeeWindow({
  tx: { to: universe },
  _shadyFeeWindow: "0x1233cec0b62fcb8c3120bc80bdb2b1351c8c2d1e"
}, function (error, isContainerForFeeWindow) { console.log(isContainerForFeeWindow); });
// example output:
"1"

augur.api.Universe.isContainerForMarket({
  tx: { to: universe },
  _shadyMarket: "0x9368ff3e9ce1c0459b309fac6dd4e69229b91a42"
}, function (error, isContainerForMarket) { console.log(isContainerForMarket); });
// example output:
"1"

augur.api.Universe.isContainerForReportingParticipant({
  tx: { to: universe },
  _shadyReportingParticipant: "0x6788ff3e9ce1c0459b309fac6dd4e69229b91a41"
}, function (error, isContainerForReportingParticipant) { console.log(isContainerForReportingParticipant); });
// example output:
"1"

augur.api.Universe.isContainerForShareToken({
  tx: { to: universe },
  _shadyShareToken: "0x9328ff3e9ce1c0459b309fac6dd4e69229b91a61"
}, function (error, isContainerForShareToken) { console.log(isContainerForShareToken); });
// example output:
"1"

augur.api.Universe.isForking({ tx: { to: universe } }, function (error, isForking) { console.log(isForking); });
// example output:
"0"

augur.api.Universe.isParentOf({
  tx: { to: universe },
  _shadyChild: "0xb4e8c1f85c4382d64954aca187f9f386c8bb1a6c"
}, function (error, isParentOf) { console.log(isParentOf); });
// example output:
"1"

Universe Contract Code

The Universe Contract is the contract that defines an Augur Universe and the methods used to interact with them. All of Augur’s Markets, Order Books, Fee Windows, and REP belong to a specific Universe. In the rare event that a Market’s Tentative Outcome is Challenged with a Dispute Bond greater than the Fork Threshold, a Fork will occur and new Universes will be created. The Universe that originally contained the Forked Market will become a Locked Universe, thereby not allowing any Market creation to take place in the Locked Universe. The newly created Universes are known as Child Universes, whereas the original and now Locked Universe is considered those Child Universes’ Parent Universe.

augur.api.Universe.getChildUniverse({ tx, _parentPayoutDistributionHash }[, callback])

Returns the Ethereum address of a Universe’s Child Universe that has its Forked Market’s Final Outcome set to _parentPayoutDistributionHash Payout Distribution Hash. The Ethereum address is returned as a hexidecimal string.

augur.api.Universe.getCurrentFeeWindow({ tx }[, callback])

Returns the Ethereum address of the current running Fee Window of a Universe. Every Universe has a Fee Window that runs for a duration of 7 days before immediately starting the next Window. The Ethereum address is returned as a hexidecimal string.

augur.api.Universe.getDisputeRoundDurationInSeconds({ tx }[, callback])

Returns the number of seconds in a Universe’s Dispute Round.

augur.api.Universe.getFeeWindow({ tx, _feeWindowId }[, callback])

Returns the Ethereum address of the Fee Window _feeWindowId in a Universe, as a hexidecimal string.

augur.api.Universe.getFeeWindowByTimestamp({ tx, _timestamp }[, callback])

Returns the Ethereum address of the Fee Window _feeWindowId running at _timestamp in a Universe, as a hexidecimal string.

augur.api.Universe.getFeeWindowForForkEndTime({ tx } [, callback])

Returns the Ethereum address of the Fee Window _feeWindowId in a Universe once the current Fork ends, as a hexidecimal string.

augur.api.Universe.getFeeWindowId({ tx, _timestamp } [, callback])

Returns the Fee Window ID for the Universe specified in tx and _timestamp, as an integer. This is calculated by dividing the timestamp by the Universe’s Fee Window duration in seconds.

augur.api.Universe.getForkEndTime({ tx }[, callback])

Returns the timestamp for when the Fork Phase ends that was started on the Universe specified in tx. If there is no Forked Market in the Universe, this function will return 0.

augur.api.Universe.getForkingMarket({ tx }[, callback])

Returns the Ethereum address of the Market that the Universe specified in tx is Forking over. This returns the null address (0x0000000000000000000000000000000000000000) if the Universe has never Forked and there is no Forked Market.

augur.api.Universe.getForkReputationGoal({ tx }[, callback])

Returns the estimated amount of REP that must be migrated to one Child Universe in order to allow a Fork in the Universe specified in tx to be Finalized before the end of the Fork Phase.

augur.api.Universe.getInitialReportStakeSize({ tx }[, callback])

Returns either the size of the No-Show REP Bond or the size of the Stake placed on the Designated Report (whichever is greater), in attoREP, as a hexadecimal string.

augur.api.Universe.getNextFeeWindow({ tx }[, callback])

Returns the Ethereum address of the Fee Window coming up after the current Fee Window ends in the Universe specified in tx. The Ethereum address is returned as a hexadecimal string.

augur.api.Universe.getOpenInterestInAttoEth({ tx }[, callback])

Returns the total value of all Complete Sets that exist across all Markets the Universe specified in tx, priced in attoETH. This value is returned as an integer.

augur.api.Universe.getParentPayoutDistributionHash({ tx }[, callback])

Returns the Payout Distribution Hash of a Universe’s Parent Universe for a Child Universe specified in tx. The Payout Distribution Hash is a hash of the winning Outcome of the Forked Market.

augur.api.Universe.getParentUniverse({ tx }[, callback])

Returns the Parent Universe Ethereum address of the Universe specified in tx, as a hexidecimal string. When a Fork occurs, Child Universes are created and the original Universe that contained the Forked Market would become a Parent Universe to the newly created Universes. If this is called on the Genesis Universe, it will return 0, as the first Universe has no Parent Universe.

augur.api.Universe.getPreviousFeeWindow({ tx }[, callback])

Returns the Ethereum address of the previous Fee Window for the Universe specified in tx, as a hexidecimal string.

augur.api.Universe.getRepMarketCapInAttoeth({ tx }[, callback])

Returns an estimate for the market cap of REP, priced in attoETH. This estimate is updated manually by the Augur development team, roughly once every Fee Window. It is used by Augur to set the price of the Reporting Fee.

augur.api.Universe.getReputationToken({ tx }[, callback])

Returns the Ethereum address of the Reputation Token for the Universe specified in tx, as a hexidecimal string. REP associated with this contract address are usable within this Universe.

augur.api.Universe.getTargetRepMarketCapInAttoeth({ tx }[, callback])

Returns the REP market cap that Augur targets when calculating Reporting Fees, in attoETH. Augur attempts to set Reporting Fees such that the REP market cap equals 5 times the amount of Open Interest.

augur.api.Universe.getWinningChildUniverse({ tx }[, callback])

Returns the Ethereum address of the Winning Universe for a particular Universe that has Forked.

augur.api.Universe.isContainerForFeeWindow({ tx, _shadyFeeWindow }[, callback])

Returns whether the specific universe is a container for the Fee Window _shadyFeeWindow Ethereum address. Returns 1 if true or 0 if false. Every Fee Window belongs to a Universe, and this method is used to see if a specific Fee Window address belongs to the Universe in question.

augur.api.Universe.isContainerForMarket({ tx, _shadyMarket }[, callback])

Returns whether the specific universe is a container for the Market _shadyMarket Ethereum address. Returns 1 if true or 0 if false. All Markets are created within a Universe, and this function is used to help confirm if a Market exists within the Universe in question.

augur.api.Universe.isContainerForReportingParticipant({ tx, _shadyReportingParticipant }[, callback])

Returns 1 if the specified Universe is a container for _shadyReportingParticipant Ethereum address provided, as a hexadecimal string. Otherwise, this function returns 0. Both the DisputeCrowdsourcers and InitialReporter classes in Augur’s Solidity smart contracts are considered Reporting Participants, since they have the parent class BaseReportingParticipant.

augur.api.Universe.isContainerForShareToken({ tx, _shadyShareToken }[, callback])

Shares are represented within Augur’s smart contracts as ERC-20 tokens called Share Tokens. Returns whether the specific universe is a container for the Share Token _shadyShareToken Ethereum address. Returns 1 if true or 0 if false.

augur.api.Universe.isForking({ tx }[, callback])

Returns 1 if the current Universe is Forking or 0 otherwise.

augur.api.Universe.isParentOf({ tx, _shadyChild }[, callback])

Returns whether the specific universe is a container for the _shadyChild Child Universe Ethereum address provided. Returns 1 if true or 0 if false. This function can be used to see if a specific Universe is the Parent Universe to a Child Universe.

Transaction API

// Transaction API (Tx API for short) example:
var privateKey = <Buffer ...>;
var reputationTokenAddress = "0x2a73cec0b62fcb8c3120bc80bdb2b1351c8c2d1e";
var transferTarget = "0xea674fdde714fd979de3edf0f56aa9716b898ec8";
var attotokens = "100000000000000000000"; // 1000.00 REP

// the Augur API is organized by Contract and then Method like so:
// augur.api.<Contract>.<Method>(<argument object>);
augur.api.ReputationToken.transfer({
  _signer: privateKey,
  reputationToken: reputationTokenAddress,
  _to: transferTarget,
  _value: attotokens,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSent output:
{
  callReturn: '100000000000000000000',
  hash: '0x915f8f0b13244b0dd9b7377b252d9245ef0fc109c82931a87410d1bdad671fe6'

}
// example onSuccess output:
{
  blockHash: "0xdc5e31404be698a6866fbe7d7cf435a2c6fab7deb3acf41d6c9bb981a2630fed",
  blockNumber: 1330897,
  callReturn: "100000000000000000000",
  from: "0x40485264986740c8fb3d11e814bd94cf86012d29",
  gas: "0x2fd618",
  gasFees: "0.00081266",
  gasPrice: "0x4a817c800",
  hash: "0x915f8f0b13244b0dd9b7377b252d9245ef0fc109c82931a87410d1bdad671fe6",
  input: "0x39d26051",
  nonce: "0x0",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1512018567,
  to: "0xfc6bba7d664e8cc242857f069e9fb1e7c25ecb44",
  transactionIndex: "0x1",
  v: "0x2c",
  value: "0x0"
}
// example onFailed output:
{
  error: '0x',
  message: 'no response or bad input'
}

Augur’s Transaction API (“Tx API” for short) is made up of “setter” methods that can both read from and write to the blockchain using Ethereum’s eth_sendTransaction RPC. Under the hood, the API uses augur.js’s convenience wrapper for eth_sendTransaction which can be accessed using augur.rpc.transact. Although it is possible to call augur.rpc.transact directly (which is discussed in greater detail below), it is generally better and easier to use the built in API functions. The API functions are attached to the augur.api object and follow a pattern of augur.api.<Contract>.<Method>(<Argument Object>). The API method name, as well as its parameters as keys in the params object, are generally identical to those of the underlying smart contract method.

Arguments

All Transaction API methods accept a single object argument. This single object must contain the onSent, onSuccess, and onFailed callback fields. This single object should contain all required params for the transactions as key/value pairs. This is different to the Call API methods which accept a params object and a second optional argument for the callback. It is strongly recommended that you use a callback, even if it’s optional in the Call API, as that will ensure your requests are made asynchronously.

Callbacks

All Transaction API methods accept three callback functions within the argument object. The following keys are used for each callback:

onSent(sentResponse)

Fires when the initial eth_sendTransaction response is received. If the transaction was broadcast to the network without problems, sentResponse will have two fields: txHash (the transaction hash as a hex string) and callReturn (the value returned by the invoked contract method). The optional returns field in the payload object sent to augur.rpc.transact can be used to specify the format of the callReturn value.

onSuccess(successResponse)

Fires when the transaction is successfully incorporated into a block and added to the blockchain, as indicated by a nonzero blockHash value. successResponse is structured the same way as eth_getTransactionByHash responses (see code example for details), with the addition of a callReturn field which contains the contract method’s return value.

onFailed(failedResponse)

Fires if the transaction is unsuccessful. failedResponse has error (error code) and message (error description) fields, describing the way in which the transaction failed.

Signer

In addition to the arguments and callbacks, all Transaction API functions require a _signer param. The _signer param should be set to the private key buffer or a signing function, provided by a hardware wallet, of the account who wishes to initiate the transaction. The Transaction API functions all attempt to modify information on the blockchain which requires a signed transaction. Anytime you plan to modify or “set” information on the blockchain you will need to include a _signer param. This concept is discussed in a bit more detail in the next section.

Using Transact Directly

// using augur.rpc.transact() directly example:
// payload object (generated by transfer method of the ReputationToken Contract)
var payload = {
  constant: false,  
  from: "0x40485264986740c8fb3d11e814bd94cf86012d29", 
  name: "getOrCacheMarketCreationCost",
  params: [],
  returns: "uint256",
  send: true,
  to: "0x6eabb9367012c0a84473e1e6d7a7ce39a54d77bb"
};

// privateKeyorSigner is either the privateKey buffer of the account trying to send the transaction or a function to sign a transaction (generally from a hardware wallet). Below we are going to use the Buffer returned from augur.accounts.login.
var privateKeyOrSigner = <Buffer ...>;

// accountType is a string set to "privateKey", "uPort", or "ledger".
var accountType = "privateKey";

// onSent callback fires when the initial eth_sendTransaction response is received
var onSent = function (sentResponse) { console.log("Transaction sent: ", sentResponse); };

// onSuccess callback fires
var onSuccess = function (successResponse) { console.log("Transaction successful: ", successResponse); };

// onFailed callback fires when the transaction is malformed, fails to confirm,
// or an object with an error field is received
var onFailed = function (failedResponse) { console.error("Transaction failed: ", failedResponse); };

augur.rpc.transact(payload, privateKeyOrSigner, accountType, onSent, onSuccess, onFailed);
// example onSent output:
Transaction sent: {
  callReturn: "10000000006000000",
  hash: "0x269011fe4ed9c7370f8e8237c525062988e8fcce485d93a1a6a419bb3a8e70d3"
}
// example onSuccess output:
Transaction successful: {
  blockHash: "0x5090c1a25a2accf4cb47a1d99f4fa4215146ac29402688ad3e554169af332e4c",
  blockNumber: 1348278,
  callReturn: "10000000006000000",
  from: "0x40485264986740c8fb3d11e814bd94cf86012d29",
  gas: "0x2fd618",
  gasFees: "0.001882121837379",
  gasPrice: "0x5b793ccec",
  hash: "0x0f8e4cdf3de1aa3c01bea8b12cbde32b2bc7701d2bc1b6403634cdd5999ad729",
  input: "0xec86fdbd",
  nonce: "0x12",
  r: "0x3bedf73900da86c9afb6721e472a268108c66694a589b3083935a3c3cc0cc764",
  s: "0x2c9c24f3bbdd63ba2218de2eddb120f52e966d36fa82989ef6b1e3df0b205ce2",
  timestamp: 1512278406,
  to: "0x6eabb9367012c0a84473e1e6d7a7ce39a54d77bb",
  transactionIndex: "0x1",
  v: "0x2c",
  value: "0x0"
}
//example onFailed output: 
Transaction failed: {
  error: 501,
  message: 'polled network but could not confirm transaction'
}

augur.rpc.transact(payload, privateKeyOrSigner, accountType, onSent, onSuccess, onFailed)

You can broadcast transactions to the Ethereum Network by calling augur.rpc.transact directly. If called directly, the payload object needs to be constructed by hand and must be structured correctly.

The payload object, also known as the “transaction object”, is structured as follows:

Required:

Optional:

The params and signature fields are required if your function accepts parameters; otherwise, these fields can be excluded. The returns field is used only to format the output, and does not affect the actual RPC request.

The privateKeyOrSigner is required if we are attempting to execute a transaction that will modify the blockchain (eth_sendTransaction). If we are simply getting information (eth_call) we don’t need to pass anything for privateKeyOrSigner. privateKeyOrSigner should be the Private Key Buffer for the logged in account or a function to sign transactions provided by a hardware wallet.

The accountType is a string that can be “privateKey”, “uPort”, or “ledger”, depending on the type of account that is sending the transaction.

Under the hood augur.rpc.transact carries out the following sequence:

  1. augur.rpc.transact will first attempt to use eth_call on the transaction submitted in order to determine if there is enough gas to perform the transaction and that the transaction is properly formed. If you have a malformed transaction, didn’t provide enough gas, or the transaction will fail then an error is passed to the onFailed handler and the augur.rpc.transact sequence terminates.

  2. After confirming that the Transaction is valid, augur.rpc.transact will send a eth_sendTransaction RPC request (or eth_sendRawTransaction for transactions which are already signed), which broadcasts the transaction to the Ethereum Network. If no transaction hash is received or there is an error, then the error will be passed to the onFailed handler and the augur.rpc.transact sequence will terminate. Otherwise, the onSent handler will be called and return an object containing the txHash and callReturn.

  3. After calling the onSent handler, Augur will add the transaction to the transactions object (which is indexed by transaction hash, e.g. transactions[txHash]) and assign the transaction a status of "pending". Use augur.rpc.getTransactions() to access the transactions object.

  4. Augur then uses eth_getTransactionByHash to determine if the transaction has been mined or not, indicated by a null response. A null response indicates that the transaction has been (silently) removed from geth’s transaction pool. This can happen if the transaction is a duplicate of another transaction that has not yet cleared the transaction pool (and therefore geth does not fire a duplicate transaction error), or if the transaction’s nonce (but not its other fields) is a duplicate. If a null response is received from eth_getTransactionByHash then Augur will attempt to re-submit the transaction to augur.rpc.transact as long the amount of attempts hasn’t exceeded augur.constants.TX_RETRY_MAX. If the attempts to submit the transaction exceed augur.constants.TX_RETRY_MAX then a TRANSACTION_RETRY_MAX_EXCEEDED error will be sent to the onFailed handler and the augur.rpc.transact sequence will terminate.

  5. Once the transaction has been successfully mined (eth_getTransactionByHash successfully returns the transaction object) the transaction is updated to include the blockNumber and blockHash and its status is changed to "sealed".

  6. When the amount of confirmations of our transaction exceeds augur.constants.REQUIRED_CONFIRMATIONS then the transaction is updated to a status of "confirmed". A callReturn field is added to the transaction object, which is then passed to the onSuccess handler, completing the sequence.

Augur Tx API

// Augur Transaction API Examples:
augur.api.Augur.createGenesisUniverse({
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320516,
  callReturn: "1",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0xa031604c8ef75ab5b1d07f7358d594e1cb57c927a86be92459d78ae3415bb3b0",
  input: "0x309d23e17ca90ca9118db456d87e3d743b97782a857200b55039f7ffe8de94e5d920f87000000000000000000000000000000000000000000000000000000000000000010000000000000000000000009368ff3e9ce1c0459b309fac6dd4e69229b91a420000000000000000000000000000000000000000000000000000000000000001",
  nonce: "0xf61",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

Provides JavaScript bindings for the Augur Solidity Contract, which handles Universe creation and event logging.

augur.api.Augur.createGenesisUniverse(p)

Allows the caller to create a new Genesis Universe. Users may wish to create a new Genesis Universe if, for example, they would like to create a separate Universe to compete with an existing Universe. Whenever a new Genesis Universe is created, it does not initially contain any Markets or REP supply. In order to add a supply of REP, users must migrate their Legacy REP from the Legacy REP smart contract into the Reputation Token smart contract of the new Genesis Universe using the function augur.api.ReputationToken.migrateFromLegacyReputationToken.

Parameters:

Returns:

Cancel Order Tx API

// Cancel Order Transaction API Examples:
var _orderId = "0x7ca90ca9118db456d87e3d743b97782a857200b55039f7ffe8de94e5d920f870";

augur.api.CancelOrder.cancelOrder({
  _orderId: _orderId,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320516,
  callReturn: "1",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0xa031604c8ef75ab5b1d07f7358d594e1cb57c927a86be92459d78ae3415bb3b0",
  input: "0x309d23e17ca90ca9118db456d87e3d743b97782a857200b55039f7ffe8de94e5d920f87000000000000000000000000000000000000000000000000000000000000000010000000000000000000000009368ff3e9ce1c0459b309fac6dd4e69229b91a420000000000000000000000000000000000000000000000000000000000000001",
  nonce: "0xf61",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

Provides JavaScript bindings for the CancelOrder Solidity Contract, which allows for cancellation of Orders on the Order Book.

augur.api.CancelOrder.cancelOrder(p)

Cancels and refunds an existing Order on the Order Book with ID _orderId. This transaction will trigger an OrderCanceled event if the Order is canceled without any errors.

This function will fail if:

Parameters:

Returns:

Claim Trading Proceeds Tx API

// Claim Trading Proceeds Transaction API Examples:
var _market = "0x9368ff3e9ce1c0459b309fac6dd4e69229b91a42";

var _outcome = "1";
var _numberOfShares = "50000000000000000000";
augur.api.ClaimTradingProceeds.calculateProceeds({
  _market: _market,
  _outcome: _outcome,
  _numberOfShares, _numberOfShares,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320522,
  callReturn: "1",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x0f6152b9a39055b34bc092d9e96e852e3137e3d42f4e78b1dc5848f8b2abf12f",
  input: "0x5fd65fba0000000000000000000000009368ff3e9ce1c0459b309fac6dd4e69229b91a42",
  nonce: "0xfc",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

var _shareHolder = "0x5678ff3e9ce1c0459b309fac6dd4e69229b91567";
augur.api.ClaimTradingProceeds.claimTradingProceeds({
  _market: _market,
  _shareHolder: _shareHolder,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320523,
  callReturn: "1",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x0f6152b9a39055b34bc092d9e96e852e3137e3d42f4e78b1dc5848f8b2abf12f",
  input: "0x5fd65fba0000000000000000000000009368ff3e9ce1c0459b309fac6dd4e69229b91a42",
  nonce: "0xfc",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

Provides JavaScript bindings for the ClaimTradingProceeds Solidity Contract, which allows profits earned from trading to be claimed.

augur.api.ClaimTradingProceeds.calculateProceeds(p)

Calculates the amount of attoETH that _numberOfShares attoshares of _outcome in _market are worth. (NOTE: This calculation does not deduct Reporting Fees

Parameters:

Returns:

augur.api.ClaimTradingProceeds.claimTradingProceeds(p)

Collects trading profits from outstanding Shares in Finalized Market _market owned by _shareHolder. This transaction will trigger a TradingProceedsClaimed event if the trading proceeds are claimed without any errors.

This transaction will fail if:

Parameters:

Returns:

Complete Sets Tx API

// Complete Sets Contract
var _market = "0x9368ff3e9ce1c0459b309fac6dd4e69229b91a42";
var _amount = "50000000000000000000"; // 50.0

augur.api.CompleteSets.publicBuyCompleteSets({
  _market: _market,
  _amount: _amount,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320523,
  callReturn: "1",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0xc77149d6a3fef8755a20aa2100fc79c02ca7dd198d6f3c65aabe638883d8d017",
  input: "0xfadc758a0000000000000000000000009368ff3e9ce1c0459b309fac6dd4e69229b91a42000000000000000000000000000000000000000000000002b5e3af16b1880000",
  nonce: "0xfd",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

augur.api.CompleteSets.publicSellCompleteSets({
  _market: _market,
  _amount: _amount,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320524,
  callReturn: "1",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x21121bf9a8d32969b5ce4d53b6021ad6b7b5e7c658e9d98d582c720c8abce220",
  input: "0x04b586670000000000000000000000009368ff3e9ce1c0459b309fac6dd4e69229b91a42000000000000000000000000000000000000000000000002b5e3af16b1880000",
  nonce: "0xfe",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

Provides JavaScript bindings for the CompleteSets Solidity Contract, which allows for buying and selling of Complete Sets.

augur.api.CompleteSets.publicBuyCompleteSets(p)

Purchases _amount worth of Shares in all Outcomes of Market _market.

This transaction will fail if:

When successful, this transaction will trigger a CompleteSets event, which will record to the Ethereum blockchain the msg.sender, _market, type (buy), _amount purchased, number of Outcomes in the _market, marketCreatorFee, and the reportingFee. During a buy, the marketCreatorFee and reportingFee will be 0 because no fees are paid for purchasing Shares, only selling/settling Shares.

Parameters:

Returns:

augur.api.CompleteSets.publicSellCompleteSets(p)

Sell _amount worth of Shares in all Outcomes of Market _market.

This transaction will fail if:

When successful, this transaction will trigger a CompleteSets event, which will record to the Ethereum blockchain the msg.sender, _market, type (sell), _amount sold, number of Outcomes in the _market, marketCreatorFee paid for selling the Shares, and the reportingFee paid for selling the Shares.

Parameters:

Returns:

Create Order Tx API

// Make Order Transaction API Examples:
var _type = "1";
var _attoshares = "10000000000000000000"; // 10 shares
var _displayPrice = "0.5";
var _market = "0xd3273eba07248020bf98a8b560ec1576a612102f";
var _outcome = "1";
var _betterOrderId = "0xea2c7476e61f5e2625e57df17fcce74741d3c2004ac657675f686a23d06e6091";
var _worseOrderId = "0xed42c0fab97ee6fbde7c47dc62dc3ad09e8d3af53517245c77c659f7cd561426";
var _tradeGroupId = "0x0000000000000000000000000000000000000000000000000000000000000001";

augur.api.CreateOrder.publicCreateOrder({
  _type: _type,
  _attoshares: _attoshares,
  _displayPrice: _displayPrice,
  _market: _market,
  _outcome: _outcome,
  _betterOrderId: _betterOrderId,
  _worseOrderId: _worseOrderId,
  _tradeGroupId: _tradeGroupId,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320525,
  callReturn: "0x5f80029d47ca806002b6b6bbbb0077124f8da9b69a885f7714907bd773bcf8a7",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0xcf6729b0e27fffc81c4f5c824992a780daf1f41bf590c7f62f16777edbc2c08e",
  input: "0x138dcef200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000008ac7230489e8000000000000000000000000000000000000000000000000000000000000fffffff1000000000000000000000000d3273eba07248020bf98a8b560ec1576a612102f0000000000000000000000000000000000000000000000000000000000000001ea2c7476e61f5e2625e57df17fcce74741d3c2004ac657675f686a23d06e6091ed42c0fab97ee6fbde7c47dc62dc3ad09e8d3af53517245c77c659f7cd5614260000000000000000000000000000000000000000000000000000000000000001",
  nonce: "0xff",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

Provides JavaScript bindings for the CreateOrder Solidity Contract, which enables new Orders to be created.

augur.api.CreateOrder.publicCreateOrder(p)

Creates a new Bid Order or Ask Order on the Order Book. The parameters _betterOrderId and worseOrderId are the Orders with the next best/next worse price after _displayPrice, and they are used to optimize the process of sorting the new Order on the Order Book. Their IDs can be obtained by calling augur.trading.getBetterWorseOrders. This transaction will trigger an OrderCreated event if the Order is created without any errors.

This transaction will fail if:

Parameters:

Returns:

Dispute Crowdsourcer Tx API

// Dispute Crowdsourcer Transaction API Examples:
var disputeCrowdsourcer = "0xe5d6eaefcfaf7ea1e17c4768a554d57800699ea4";

augur.api.DisputeCrowdsourcer.fork({
  disputeCrowdsourcer: disputeCrowdsourcer,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0x89c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320486,
  callReturn: "1",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0xf5681056bab571e0ec73411896a3e8f7a7b610e43f148ea96cd06f66a2e8472a",
  input: "0x0000000000000000000000000000000000000000000000000000000000000100",
  nonce: "0x3",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

var _redeemer = "0x55d6eaefcfaf7ea1e17c4768a554d57800699ae4";
augur.api.DisputeCrowdsourcer.redeem({
  disputeCrowdsourcer: disputeCrowdsourcer,
  _redeemer: _redeemer,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0xaac8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320486,
  callReturn: "1",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0xf5681056bab571e0ec73411896a3e8f7a7b610e43f148ea96cd06f66a2e8472a",
  input: "0x0000000000000000000000000000000000000000000000000000000000000100",
  nonce: "0x3",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

augur.api.DisputeCrowdsourcer.withdrawInEmergency({
  disputeCrowdsourcer: disputeCrowdsourcer,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0xbbc8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320486,
  callReturn: "1",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0xf5681056bab571e0ec73411896a3e8f7a7b610e43f148ea96cd06f66a2e8472a",
  input: "0x0000000000000000000000000000000000000000000000000000000000000100",
  nonce: "0x3",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

Provides JavaScript bindings for the DisputeCrowdsourcer Solidity Contract, which allows users to Stake and redeem REP on Outcomes other than a Market’s Tentative Outcome.

augur.api.DisputeCrowdsourcer.fork(p)

Causes a Child Universe to be created for the Outcome of Dispute Crowdsourcer disputeCrowdsourcer and migrates the REP in the Crowdsourcer to the Child Universe. This function can be called only on the Crowdsourcers of a Forked Market, and it can be called at any time after the Fork has begun (including after the Market has been Finalized).

Once this function has been called, augur.api.DisputeCrowdsourcer.redeem may be called by users who Staked on the Dispute Crowdsourcer’s Outcome to redeem their Staked REP and collect any Reporting Fees (in Ether) that they are owed.

This transaction will fail if:

Parameters:

Returns:

augur.api.DisputeCrowdsourcer.redeem(p)

Redeems REP that _redeemer Staked on a particular Dispute Crowdsourcer, as well as any Reporting Fees (in Ether) that _redeemer is owed.

If the Dispute Crowdsourcer’s Market has been Finalized, and the Dispute Crowdsourcer filled its Dispute Bond, the user will receive their Reporting Fees for the Fee Window plus 1.5 times the amount of REP they Staked (if the Outcome of the Dispute Crowdsourcer is the Final Outcome of the Market), or the user will just receive Reporting Fees for the Fee Window (if the Outcome of the Dispute Crowdsourcer is not the Final Outcome of the Market).

If the Dispute Crowdsourcer’s Market has been Finalized, and the Dispute Crowdsourcer did not fill its Dispute Bond, the user will receive Reporting Fees for the Fee Window (but not the REP they originally Staked).

If a Fork has occurred, all non-Forked Markets will have their Tentative Outcome reset to the Outcome submitted in the Initial Report and be put back in the Waiting for the Next Fee Window to Begin Phase. All non-Forked Markets will need to have augur.api.Market.disavowCrowdsourcers called before the redeem transaction can be called on any of their Dispute Crowdsourcers. Furthermore, all Dispute Crowdsourcers of the Forked Market will need to have augur.api.DisputeCrowdsourcer.fork called on them before the redeem transaction can be called.

When redeem is called on Dispute Crowdsourcers of non-Forked Markets, this transaction will redeem any REP that _redeemer Staked on that Crowdsourcer, as well as any Reporting Fees (in Ether) that _redeemer is owed, to the Universe containing the Forked Market.

When redeem is called on Dispute Crowdsourcers of a Forked Market, it will redeem any REP that _redeemer Staked on that Crowdsourcer, as well as any Reporting Fees (in Ether) that _redeemer is owed, to the Child Universe for the Outcome of that Crowdsourcer.

This transaction will trigger a WinningsRedeemed event if the REP/Ether was redeemed without any errors.

Parameters:

Returns:

augur.api.DisputeCrowdsourcer.withdrawInEmergency(p)

If a critical bug or vulnerability is found in Augur, the Augur development team can put Augur into a halted state until the issue is resolved. In such instances, most regularly-used functions in Augur’s backend will become unuseable until the system is returned to its normal state. When this happens, users can call the withdrawInEmergency function to withdraw the REP they Staked on the Dispute Crowdsourcer’s Outcome. Calling this function will not redeem any Reporting Fees because the total amount of Reporting Fees is not known until the end of the Fee Window.

This transaction will fail if:

Parameters:

Returns:

Fee Window Tx API

// Fee Window Transaction API Examples:
var feeWindow = "0xe5d6eaefcfaf7ea1e17c4768a554d57800699ea4";

var _attotokens = 100;
augur.api.FeeWindow.buy({
  feeWindow: feeWindow,
  _attotokens: _attotokens,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320486,
  callReturn: "1",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0xf5681056bab571e0ec73411896a3e8f7a7b610e43f148ea96cd06f66a2e8472a",
  input: "0x0000000000000000000000000000000000000000000000000000000000000100",
  nonce: "0x3",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

var _sender = "0x8886eaefcfaf7ea1e17c4768a554d57800699888";
augur.api.FeeWindow.redeem({
  feeWindow: feeWindow,
  _sender: _sender,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320487,
  callReturn: "1",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0xf5681056bab571e0ec73411896a3e8f7a7b610e43f148ea96cd06f66a2e8472a",
  input: "0x00000001",
  nonce: "0x3",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

augur.api.FeeWindow.withdrawInEmergency({
  feeWindow: feeWindow,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320488,
  callReturn: "1",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0xf5681056bab571e0ec73411896a3e8f7a7b610e43f148ea96cd06f66a2e8472a",
  input: "0x00000001",
  nonce: "0x3",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

Provides JavaScript bindings for the FeeWindow Solidity Contract, which allows for the buying and redeeming of Participation Tokens.

augur.api.FeeWindow.buy(p)

Purchases the number of Participation Tokens specified by _attotokens.

This transaction will fail if:

These Participation Tokens can be redeemed later once the Fee Window is no longer active using the function augur.api.FeeWindow.redeem.

Parameters:

Returns:

augur.api.FeeWindow.redeem(p)

Converts any Participation Tokens _sender has in the specified Fee Window to Reputation Tokens, and gives the user any Reporting Fees he or she is owed in Ether. The parameter _sender is the Ethereum address of the user redeeming the Participation Tokens, as a 16-byte hexadecimal string.

Parameters:

Returns:

augur.api.FeeWindow.withdrawInEmergency(p)

If a critical bug or vulnerability is found in Augur, the Augur development team can put Augur into a halted state until the issue is resolved. In such instances, most regularly-used functions in Augur’s backend will become unuseable until the system is returned to its normal state. When this happens, users can call the withdrawInEmergency function to withdraw their Participation Tokens and convert them into Reputation Tokens.

This transaction will fail if:

Parameters:

Returns:

Fill Order Tx API

// Fill Order Transaction API Examples:
var _orderId = "0xea2c7476e61f5e2625e57df17fcce74741d3c2004ac657675f686a23d06e6091";
var _amountFillerWants = "10000000000000000000"; // 10.0
var _tradeGroupId = "0x0000000000000000000000000000000000000000000000000000000000000002";

augur.api.FillOrder.publicFillOrder({
  _orderId: _orderId,
  _amountFillerWants: _amountFillerWants,
  _tradeGroupId: _tradeGroupId,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320529,
  callReturn: "0",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x3efb4102dc3b9e1bb145ca21310233646a4eba24894b04f12ee4d390281301ac",
  input: "0x49a2cba0ea2c7476e61f5e2625e57df17fcce74741d3c2004ac657675f686a23d06e60910000000000000000000000000000000000000000000000008ac7230489e800000000000000000000000000000000000000000000000000000000000000000001",
  nonce: "0xff4",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

Provides JavaScript bindings for the FillOrder Solidity Contract, which allows for the Filling of Orders on the Order Book.

augur.api.FillOrder.publicFillOrder(p)

Attempts to Fill _amountFillerWants attoshares for Order _orderId. If _amountFillerWants is enough to Fill the Order completely, the Order will be removed from the Order Book. Otherwise, it will be adjusted to only include the remaining amount after Filling the _amountFillerWants value that the Filler requests. This transaction will trigger an OrderFilled event if the Order is Filled without any errors.

This transaction will fail if:

Parameters:

Returns:

Initial Reporter Tx API

// Initial Reporter Transaction API Examples:
var initialReporter = "0x9368ff3e9ce1c0459b309fac6dd4e69229b91a42";

augur.api.InitialReporter.fork({
  initialReporter: initialReporter,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0x7778f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2bfd",
  blockNumber: 320488,
  callReturn: "1",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x6544da2190a54542e95473a6c9b18b7259480b8b48953eaa750d3e1379d8ccd6",
  input: "0x4c92c4b38832d970d090b6403905de4ec2d1ae0adf4ca4972343c27fa86f7c61ea62e250",
  nonce: "0x4",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

augur.api.InitialReporter.redeem({
  initialReporter: initialReporter,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0x8768f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2abc",
  blockNumber: 320488,
  callReturn: "1",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x6544da2190a54542e95473a6c9b18b7259480b8b48953eaa750d3e1379d8ccd6",
  input: "0x4c92c4b38832d970d090b6403905de4ec2d1ae0adf4ca4972343c27fa86f7c61ea62e250",
  nonce: "0x4",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

var _newOwner = "0x9998ff3e9ce1c0459b309fac6dd4e69229b91777";
augur.api.InitialReporter.transferOwnership({
  initialReporter: initialReporter,
  _newOwner: _newOwner,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0x8768f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2abc",
  blockNumber: 320489,
  callReturn: "1",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x6544da2190a54542e95473a6c9b18b7259480b8b48953eaa750d3e1379d8ccd6",
  input: "0x4c92c4b38832d970d090b6403905de4ec2d1ae0adf4ca4972343c27fa86f7c61ea62e250",
  nonce: "0x4",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

augur.api.InitialReporter.withdrawInEmergency({
  initialReporter: initialReporter,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0x1238f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2aaa",
  blockNumber: 320490,
  callReturn: "1",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x6544da2190a54542e95473a6c9b18b7259480b8b48953eaa750d3e1379d8ccd6",
  input: "0x4c92c4b38832d970d090b6403905de4ec2d1ae0adf4ca4972343c27fa86f7c61ea62e250",
  nonce: "0x4",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

Provides JavaScript bindings for the InitialReporter Solidity Contract, which enables functionality related to Initial Reports.

augur.api.InitialReporter.fork(p)

Causes a Child Universe to be created for the Outcome of the Initial Report and migrates the REP Staked by the Initial Reporter to the Child Universe.

This transaction will fail if:

This transaction can be called at any time after the Fork has begun (including after the Market has been Finalized). Once it has been called, augur.api.InitialReporter.redeem may be called to transfer the REP Staked on the Initial Report’s Outcome (and the No-Show Gas Bond, in Ether, if applicable) to the Initial Reporter of the Forked Market.

Parameters:

Returns:

augur.api.InitialReporter.redeem(p)

Redeems the REP that the Designated Reporter or First Public Reporter Staked on the Outcome of the Initial Report. If the First Public Reporter submitted the Initial Report, this function will also redeem the No-Show Gas Bond in Ether. This transaction will trigger a WinningsRedeemed event if the REP/Ether was redeemed without any errors.

Parameters:

Returns:

augur.api.InitialReporter.transferOwnership(p)

Changes the owner of initialReporter from the existing owner to _newOwner.

This function will fail if:

Parameters:

Returns:

augur.api.InitialReporter.withdrawInEmergency(p)

If a critical bug or vulnerability is found in Augur, the Augur development team can put Augur into a halted state until the issue is resolved. In such instances, most regularly-used functions in Augur’s backend will become unuseable until the system is returned to its normal state. When this happens, Initial Reporters can call the withdrawInEmergency function to withdraw the REP they Staked on the Initial Report Outcome, as well as the No-Show Gas Bond (in cases where the First Public Reporter submitted the Initial Report instead of the Designated Reporter).

This transaction will fail if:

Parameters:

Returns:

Mailbox Tx API

// Mailbox Transaction API Examples:
var mailbox = "0x9368ff3e9ce1c0459b309fac6dd4e69229b91a42";

augur.api.Mailbox.transferOwnership({
  mailbox: mailbox,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320488,
  callReturn: "1",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x6544da2190a54542e95473a6c9b18b7259480b8b48953eaa750d3e1379d8ccd6",
  input: "0x4c92c4b38832d970d090b6403905de4ec2d1ae0adf4ca4972343c27fa86f7c61ea62e250",
  nonce: "0x4",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

augur.api.Mailbox.withdrawEther({
  mailbox: mailbox,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320489,
  callReturn: "1",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x6544da2190a54542e95473a6c9b18b7259480b8b48953eaa750d3e1379d8ccd6",
  input: "0x4c92c4b38832d970d090b6403905de4ec2d1ae0adf4ca4972343c27fa86f7c61ea62e250",
  nonce: "0x4",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

var _repToken = "0x9368ff3e9ce1c0459b309fac6dd4e69229b91a42";
augur.api.Mailbox.withdrawTokens({
  mailbox: mailbox,
  token: _repToken,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320489,
  callReturn: "1",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x6544da2190a54542e95473a6c9b18b7259480b8b48953eaa750d3e1379d8ccd6",
  input: "0x4c92c4b38832d970d090b6403905de4ec2d1ae0adf4ca4972343c27fa86f7c61ea62e250",
  nonce: "0x4",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

Provides JavaScript bindings for the Mailbox Solidity Contract, which enables the functionality of the Market Creator Mailbox.

augur.api.Mailbox.transferOwnership(p)

Changes the current owner of Market Creator Mailbox mailbox to _newOwner.

This transaction will fail if:

Parameters:

Returns:

augur.api.Mailbox.withdrawEther(p)

Transfers all Ether in the Market Creator Mailbox to the Market Creator’s Ethereum address.

This transaction will fail if:

Parameters:

Returns:

augur.api.Mailbox.withdrawTokens(p)

Transfers all tokens of type _token in the Market Creator Mailbox to the Market Creator’s Ethereum address.

This transaction will fail if:

Parameters:

Returns:

Market Tx API

// Market Transaction API Examples:
var market = "0x9368ff3e9ce1c0459b309fac6dd4e69229b91a42";

var _payoutNumerators = [ 0, 1000 ];
var _invalid = false;
var _amount = 100;
augur.api.Market.contribute({
  market: market,
  _payoutNumerators: _payoutNumerators,
  _invalid: _invalid,
  _amount: _amount,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320490,
  callReturn: "1",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x0193add7b8dc3868944cb8b7748ab53cec5a2d9f5041f882b04b0bf0a31e1ff2",
  input: "0xf12afe02",
  nonce: "0x5",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

augur.api.Market.disavowCrowdsourcers({
  market: market,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320491,
  callReturn: "1",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x0193add7b8dc3868944cb8b7748ab53cec5a2d9f5041f882b04b0bf0a31e1ff2",
  input: "0xf12afe02",
  nonce: "0x5",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

var _payoutNumerators = [ 0, 1000 ];
var _invalid = false;
augur.api.Market.doInitialReport({
  market: market,
  _payoutNumerators: _payoutNumerators,
  _invalid: _invalid,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320492,
  callReturn: "1",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x0193add7b8dc3868944cb8b7748ab53cec5a2d9f5041f882b04b0bf0a31e1ff2",
  input: "0xf12afe02",
  nonce: "0x5",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

augur.api.Market.finalize({
  market: market,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320493,
  callReturn: "1",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x0193add7b8dc3868944cb8b7748ab53cec5a2d9f5041f882b04b0bf0a31e1ff2",
  input: "0xf12afe02",
  nonce: "0x5",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

augur.api.Market.finalizeFork({
  market: market,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320494,
  callReturn: "1",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x0193add7b8dc3868944cb8b7748ab53cec5a2d9f5041f882b04b0bf0a31e1ff2",
  input: "0xf12afe02",
  nonce: "0x5",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

augur.api.Market.migrateThroughOneFork({
  market: market,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320496,
  callReturn: "1",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x32bf0849d589b6dd639791c7ea49579ea654a648c41b3a614878d77608ef1b07",
  input: "0x069b559c",
  nonce: "0x9",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

augur.api.Market.withdrawInEmergency {
  market: market,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
};
// example onSuccess output:
{
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320499,
  callReturn: "1",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0xf5681056bab571e0ec73411896a3e8f7a7b610e43f148ea96cd06f66a2e8472a",
  input: "0x00000001",
  nonce: "0x3",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

Provides JavaScript bindings for the Market Solidity Contract, which enables functionality for Augur’s Markets.

augur.api.Market.contribute(p)

Contributes _amount REP to the Dispute Crowdsourcer represented by Payout Set _payoutNumerators and _invalid in order to help Challenge the Market market’s Tentative Outcome. If the amount of REP in the Dispute Crowdsourcer plus amount is greater than the total REP required to fill the Dispute Bond, this function will only contribute the remaining amount of REP required to fill the Dispute Bond on behalf of the caller.

This transaction will trigger a DisputeCrowdsourcerContribution event if it executes without any errors. It will also trigger a DisputeCrowdsourcerCompleted event if the Dispute Bond is successfullly filled, and it will trigger a UniverseForked event if enough REP has been Staked in the Dispute Crowdsourcer to cause the Market to Fork.

This function will fail if: - The Market is in a Fee Window that is not active. - The Outcome specified by _payoutNumerators and _invalid is already the Tentative Outcome of the Market. - _invalid is true and the Numerators in _payoutNumerators are not all the same value. (For information about what the Payout Set should look like for an Invalid Market, refer to the Invalid Outcome glossary entry.)

Parameters:

Returns:

augur.api.Market.disavowCrowdsourcers(p)

“Disavows” all Dispute Crowdsourcers of a Market, meaning the Market’s Tentative Outcome are reset back to the Outcome of the Initial Report, and all REP Staked in the Crowdsourcers are redeemable by users who contributed to them using the function augur.api.DisputeCrowdsourcer.redeem. This transaction may only be called on non-Forked Markets in the event that another Market in the same Universe Forks.

This function will fail if:

Parameters:

Returns:

augur.api.Market.doInitialReport(p)

Submits an Initial Report for Market market. This transaction will trigger an InitialReportSubmitted event if it submits the Initial Report successfully.

This transaction will fail if:

Parameters:

Returns:

augur.api.Market.finalize(p)

Finalizes the Market market, meaning it sets the winning Payout Distribution Hash for the Market, redistributes REP Staked on non-winning Outcomes to REP holders who Staked on the winning Outcome, and distributes the Validity Bond based on whether the Market resolved as Invalid. Then, once the Post-Finalization Waiting Period has elapsed, users can Settle their Shares. This transaction will trigger a MarketFinalized event if the Market Finalized without any errors.

This transaction will fail if:

Parameters:

Returns:

augur.api.Market.finalizeFork(p)

Finalizes the Forked Market market, meaning it sets the winning Payout Distribution Hash for the Market. Then, once the Post-Finalization Waiting Period has elapsed, users can Settle their Shares.

This transaction will fail if:

Parameters:

Returns:

augur.api.Market.migrateThroughOneFork(p)

Migrates the Market into a winning Child Universe from a Forked Parent Universe. When a Fork occurs, there is a Fork Period, wherein REP holders migrate their REP to the Universe they want to continue in. Once the Fork Period ends, the Child Universe with the most REP migrated to it is declared the Winning Universe. Calling migrateThroughOneFork attempts to move the Market from a Parent Universe to the Winning Universe after it’s been decided.

This transaction will fail if:

Parameters:

Returns:

augur.api.Market.transferOwnership(p)

Changes the owner of Market market from the current owner to _newOwner.

This transaction will fail if:

Parameters:

Returns:

augur.api.Market.withdrawInEmergency(p)

If a critical bug or vulnerability is found in Augur, the development team can put it the system into a halted state until the issue is resolved. In such instances, most regularly-used functions in Augur’s backend will become unuseable until the system is returned to its normal state. When this happens, users can call the withdrawInEmergency function to withdraw their Reputation Tokens from a particular Market.

This transaction will fail if:

Parameters:

Returns:

Reputation Token Tx API

// Reputation Token Transaction API Examples:
var reputationToken = "0x2a73cec0b62fcb8c3120bc80bdb2b1351c8c2d1e";
var _spender = "0xea674fdde714fd979de3edf0f56aa9716b898ec8";
var _from = "0x1a05071893b764109f0bbc5b75d78e3e38b69ab3";
var _attotokens = "100000000000000000000";

augur.api.ReputationToken.approve({
  reputationToken: reputationToken,
  _spender: _spender,
  _value: _attotokens,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320512,
  callReturn: "1",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x915f8f0b13244b0dd9b7377b252d9245ef0fc109c82931a87410d1bdad671fe6",
  input: "0x83b58638000000000000000000000000ea674fdde714fd979de3edf0f56aa9716b898ec80000000000000000000000000000000000000000000000056bc75e2d63100000",
  nonce: "0xf2",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

augur.api.ReputationToken.migrateFromLegacyReputationToken({
  reputationToken: reputationToken,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320513,
  callReturn: "1",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0xf1eb499764e9422d51a37b3567bb2513c022d63524518d520a9d4eabad0f0238",
  input: "0x3a15e7ca",
  nonce: "0xf3",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

var _destination = "0x73295d3c0ca46113ca226222c81c79adabf9f391";
augur.api.ReputationToken.migrateOut({
  reputationToken: reputationToken,
  _destination: _destination,
  _attotokens: _attotokens,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320514,
  callReturn: "1",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0xeddcfa199671312d7dd90eba2895da3104801ab05220758c62bbc6ef059f6057",
  input: "0x5ca7a72700000000000000000000000073295d3c0ca46113ca226222c81c79adabf9f3910000000000000000000000001a05071893b764109f0bbc5b75d78e3e38b69ab30000000000000000000000000000000000000000000000056bc75e2d63100000",
  nonce: "0xf4",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

augur.api.ReputationToken.transfer({
  reputationToken: reputationToken,
  _to: _spender,
  _value: _attotokens,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320515,
  callReturn: "1",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x8f92137eff5e7824423ff6e79e15188b61d9dd9244fd2c436b020de6d8e721fe",
  input: "0x86744558000000000000000000000000ea674fdde714fd979de3edf0f56aa9716b898ec80000000000000000000000000000000000000000000000056bc75e2d63100000",
  nonce: "0xf5",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

augur.api.ReputationToken.transferFrom({
  reputationToken: reputationToken,
  _from: _from,
  _to: _spender,
  _value: _attotokens,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320516,
  callReturn: "1",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x2c678df877e01d343a4e7701b92dddcecafc095fd1e4d90423838cd73eadb7d7",
  input: "0x27f08b000000000000000000000000001a05071893b764109f0bbc5b75d78e3e38b69ab3000000000000000000000000ea674fdde714fd979de3edf0f56aa9716b898ec80000000000000000000000000000000000000000000000056bc75e2d63100000",
  nonce: "0xf6",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

Provides JavaScript bindings for the ReputationToken Solidity Contract, which handles the approval, migration, and transfering of REP.

augur.api.ReputationToken.approve(p)

Allows _spender to spend up to _value REP for the msg.sender of this transaction. This transaction will trigger an Approval event, which will record the owner address (msg.sender), _spender, and _value in attoREP approved. The only way to change _value after it has been set is by first calling this transaction with _value set to 0 and then calling it again with _value set to the desired value.

This function will fail if:

Parameters:

Returns:

augur.api.ReputationToken.migrateFromLegacyReputationToken(p)

Migrates Legacy REP tokens owned by msg.sender from the Legacy REP contract to the reputationToken provided. This transaction will add whatever msg.sender’s balance was for the Legacy REP contract to the reputationToken contract.

Parameters:

Returns:

augur.api.ReputationToken.migrateOut(p)

This transaction migrates _attotokens of msg.sender’s REP from contract address reputationToken to _destination contract address in the case of a Fork.

This transaction will fail if:

Parameters:

Returns:

augur.api.ReputationToken.transfer(p)

Sends _value worth of attoREP to the Ethereum address _to. If this transaction transfers without any errors, it will trigger a Transfer event, which will record the from address (msg.sender), _to address, and _value amount transferred.

This transaction will fail if:

Parameters:

Returns:

augur.api.ReputationToken.transferFrom(p)

Sends _value worth of attoREP from the Ethereum addres _from to the Ethereum address _to. If this transaction transfers without any errors, it will trigger a Transfer event, which will record the _from address, _to address, and _value (in attoREP) amount transferred.

This transaction will fail if:

Parameters:

Returns:

Share Token Tx API

// Share Token Transaction API Examples:
var shareToken = "0xa22c79a48f51df6d0863821bd1dd2c5d6f511bc5";
var _spender = "0x01f50356c280cd886dd058210937160c73700a4b";
var _from = "0x1a05071893b764109f0bbc5b75d78e3e38b69ab3";
var _attotokens = "100000000000000000000";

augur.api.ShareToken.approve({
  shareToken: shareToken,
  _spender: _spender,
  _value: _attotokens,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320526,
  callReturn: "1",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x02730239e82d37ec032ecde79f27ae75d7cc59c277ab44c6eb5b67520ee487e9",
  input: "0x83b5863800000000000000000000000001f50356c280cd886dd058210937160c73700a4b0000000000000000000000000000000000000000000000056bc75e2d63100000",
  nonce: "0xff1",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

augur.api.ShareToken.transfer({
  shareToken: shareToken,
  _to: _spender,
  _value: _attotokens,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320527,
  callReturn: "1",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x7dfbd9d87964814e0da2d874d8d7c2d886df6b852a46d69562018620d62fd773",
  input: "0x8674455800000000000000000000000001f50356c280cd886dd058210937160c73700a4b0000000000000000000000000000000000000000000000056bc75e2d63100000",
  nonce: "0xff2",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

var _from = "0x4b01721f0244e7c5b5f63c20942850e447f5a5ee";
augur.api.ShareToken.transferFrom({
  shareToken: shareToken,
  _from: _from,
  _to: _spender,
  _value: _attotokens,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320528,
  callReturn: "1",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x619a9d4a75f43cf5d5b8e81365f9859e60aa96554915e912cdf7ffd96f0d4d96",
  input: "0x27f08b000000000000000000000000004b01721f0244e7c5b5f63c20942850e447f5a5ee00000000000000000000000001f50356c280cd886dd058210937160c73700a4b0000000000000000000000000000000000000000000000056bc75e2d63100000",
  nonce: "0xff3",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

Provides JavaScript bindings for the ShareToken Solidity Code, which handles the approval and transferring of Shares in Augur. (Shares are implemented as an ERC-20 token in Augur’s smart contracts.)

augur.api.ShareToken.approve(p)

Allows _spender to spend up to _value Shares for the msg.sender of this transaction. This transaction will trigger an Approval event, which will record the owner address (msg.sender), _spender, and _value in attoshares approved. The only way to change _value after it has been set is by first calling this transaction with _value set to 0 and then calling it again with _value set to the desired value.

This function will fail if:

Parameters:

Returns:

augur.api.ShareToken.transfer(p)

Sends _value worth of attoshares to the Ethereum address _to. If this transaction transfers without any errors, it will trigger a Transfer event, which will record the from address (msg.sender), _to address, and _value amount transferred.

This transaction will fail if:

Parameters:

Returns:

augur.api.ShareToken.transferFrom({ shareToken, _from, _to, _value, onSent, onSuccess, onFailed })

Sends _value worth of attoshares from the Ethereum addres _from to the Ethereum address _to. If this transaction transfers without any errors, it will trigger aTransfer event, which will record the _from address, _to address, and _value (in attoshares) amount transferred.

This transaction will fail if:

Parameters:

Returns:

Trade Tx API

// Trade Transaction API Examples:
var _market = "0x7e8e07364ccde43ba5159537404924e86ca53c92";
var _outcome = "1";
var _fxpAmount = "10000000000000000000"; // 10.0
var _price = "500000000000000000"; // 0.5
var _betterOrderId = "0xea2c7476e61f5e2625e57df17fcce74741d3c2004ac657675f686a23d06e6091";
var _worseOrderId = "0xed42c0fab97ee6fbde7c47dc62dc3ad09e8d3af53517245c77c659f7cd561426";
var _tradeGroupId = "0x0000000000000000000000000000000000000000000000000000000000000003";

augur.api.Trade.publicBuy({
  _market: _market,
  _outcome: _outcome,
  _fxpAmount: _fxpAmount,
  _price: _price,
  _betterOrderId: _betterOrderId,
  _worseOrderId: _worseOrderId,
  _tradeGroupId: _tradeGroupID,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320530,
  callReturn: "1",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x027e3b312f5949388830a0f5c945cbfcbf4ec06edc3b342ef8d6e85f631a50c3",
  input: "0x888b82010000000000000000000000007e8e07364ccde43ba5159537404924e86ca53c9200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000008ac7230489e8000000000000000000000000000000000000000000000000000006f05b59d3b200000000000000000000000000000000000000000000000000000000000000000001",
  nonce: "0xff5",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

augur.api.Trade.publicSell({
  _market: _market,
  _outcome: _outcome,
  _fxpAmount: _fxpAmount,
  _price: _price,
  _betterOrderId: _betterOrderId,
  _worseOrderId: _worseOrderId,
  _tradeGroupId: _tradeGroupId,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320531,
  callReturn: "1",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x1072dd3501dd0796f3b986bb45704798d198265ca5b75303488a8eb69c76bae5",
  input: "0xf049066b0000000000000000000000007e8e07364ccde43ba5159537404924e86ca53c9200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000008ac7230489e8000000000000000000000000000000000000000000000000000006f05b59d3b200000000000000000000000000000000000000000000000000000000000000000001",
  nonce: "0xff6",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

augur.api.Trade.publicTrade({
  _direction: '1',
  _market: _market,
  _outcome: _outcome,
  _fxpAmount: _fxpAmount,
  _price: _price,
  _betterOrderId: _betterOrderId,
  _worseOrderId: _worseOrderId,
  _tradeGroupId: _tradeGroupId,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320532,
  callReturn: "0xa754c0437ff499df19d163199dcb43a539cbd0a9670b976f0ac66f33a88b3ac6",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x2dc8b6f31e83e0e558863528130af2c66309f582ed02d96c7d7cfbe6a2c7179f",
  input: "0x1ee6ba1000000000000000000000000000000000000000000000000000000000000000010000000000000000000000007e8e07364ccde43ba5159537404924e86ca53c9200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000008ac7230489e8000000000000000000000000000000000000000000000000000006f05b59d3b200000000000000000000000000000000000000000000000000000000000000000001",
  nonce: "0xff7",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

augur.api.Trade.publicTakeBestOrder({
  _direction: '2',
  _market: _market,
  _outcome: _outcome,
  _fxpAmount: _fxpAmount,
  _price: _price,
  _betterOrderId: _betterOrderId,
  _worseOrderId: _worseOrderId,
  _tradeGroupId: _tradeGroupId,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320533,
  callReturn: "0",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x7ab9bde926dfb9d1bbee93c07cbcf7d11ea4b995fa8f72d88d8322336d1aefd1",
  input: "0x048db15000000000000000000000000000000000000000000000000000000000000000020000000000000000000000007e8e07364ccde43ba5159537404924e86ca53c9200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000008ac7230489e8000000000000000000000000000000000000000000000000000006f05b59d3b200000000000000000000000000000000000000000000000000000000000000000001",
  nonce: "0xff8",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

Provides JavaScript bindings for the Trade Solidity Contract, which allows for the buying and selling of Shares of a particular Outcome in a Market.

augur.api.Trade.publicBuy(p)

Buys _fxpAmount number of Shares in Outcome _outcome of Market market at price attoETH per Share. This transaction takes Orders off the Order Book that can be Filled with this request, otherwise it creates a new Order to buy _fxpAmount of Shares at _price. The parameters _betterOrderId and worseOrderId are the Orders with the next best/next worse price after _price, and they are used to optimize the process of sorting the new Order on the Order Book. Their IDs can be obtained by calling augur.trading.getBetterWorseOrders. This transaction will trigger an OrderCreated event if the Order is created without any errors.

Parameters:

Returns:

augur.api.Trade.publicSell(p)

Sells _fxpAmount number of Shares in Outcome _outcome of Market market at price attoETH per Share. This transaction takes Orders off the Order Book that can be Filled with this request, otherwise it creates a new Order to sell _fxpAmount of Shares at _price. The parameters _betterOrderId and worseOrderId are the Orders with the next best/next worse price with respect to _price, and they are used to optimize the process of sorting the new Order on the Order Book. Their IDs can be obtained by calling augur.trading.getBetterWorseOrders. This transaction will trigger an OrderCreated event if the Order is created without any errors.

Parameters:

Returns:

augur.api.Trade.publicTrade(p)

Works similarly to augur.api.Trade.publicBuy and augur.api.Trade.publicSell; however a direction must be specified. The _direction must be either 1 for buying or 2 for selling. This transaction will trigger an OrderCreated event if the Order is created without any errors.

Parameters:

Returns:

augur.api.Trade.publicTakeBestOrder({ _direction, _market, _outcome, _fxpAmount, _price, _betterOrderId, _worseOrderId, _tradeGroupId, onSent, onSuccess, onFailed })

Works similarly to augur.api.Trade.publicTrade, except it does not create an Order if the request can’t be Filled. Instead, it will take the best Order available on the Order Book.

Parameters:

Returns:

TradingEscapeHatch Tx API

// TradingEscapeHatch Transaction API Examples:
var _market = "0x465407364ccde43ba5159537404924e86ca53aaa";

augur.api.TradingEscapeHatch.claimSharesInUpdate({
  _market: _market,
  onSent: function (result) { console.log(result); },
  onSuccess: function (result) { console.log(result); },
  onFailed: function (result) { console.log(result); }
});
// example onSuccess output:
{
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320540,
  callReturn: "0",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x7ab9bde926dfb9d1bbee93c07cbcf7d11ea4b995fa8f72d88d8322336d1aefd1",
  input: "0x3659bde926dfb9d1bbee93c07cbcf7d11ea4b995fa8f72d88d8322336d1ae7ac",
  nonce: "0xff8",
  r: "0x3db124c7a0ae32094e0afdcd020d51fb930cdc3877066433b910e9257c3232eb"
  s: "0x543251c0fb374e535c61c88b913816f791edba101517921e473384706ddd0256"
  timestamp: 1501003200,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

Provides JavaScript bindings for the TradingEscapeHatch Solidity Contract, which allows funds to be withdrawn from Augur in the event that Augur needs to be halted by the development team.

augur.api.TradingEscapeHatch.claimSharesInUpdate({ _market, onSent, onSuccess, onFailed })

If Augur needs to be halted by the development team (for example, if a vulnerability is discovered), calling this function on Market _market will cash out the caller’s Shares to Ether for that Market and return them to the caller’s Ethereum address.

This transaction will fail if:

Parameters:

Returns:

Universe Tx API

// Universe Transaction API Examples:
var universe = "0x777407364ccde43ba5159537404924e86ca53444";

var _extraInfo = { 
  "resolutionSource": "http://www.spacex.com", 
  "tags": [ "SpaceX", "spaceflight" ], 
  "longDescription": "SpaceX hit a big milestone on Friday with NASA confirming on Friday that the Elon Musk-led space cargo business will launch astronauts to the International Space Station by 2017." 
};
augur.api.Universe.createBinaryMarket({
  universe: universe,
  _endTime: 1546329600,
  _feePerEthInWei: 1193046,
  _denominationToken: "0x74e88699f5d33f516500c3d9a2430f5e6ffb0689",
  _designatedReporterAddress: "0x01114f4bda09ed6c6715cf0baf606b5bce1dc96a",
  _topic: "space",
  _description: "Will SpaceX successfully complete a manned flight to the International Space Station by the end of 2018?",
  _extraInfo: JSON.stringify(_extraInfo),
  onSent: function (result) { console.log("onSent result:", result); },
  onSuccess: function (result) { 
    console.log("onSuccess result:", result);
    // Call `augur.createMarket.getMarketFromCreateMarketReceipt` to retrieve new market's address
  },
  onFailed: function (result) { console.log("onFailed result:", result); },
  tx: { 
    to: "0x6eabb9367012c0a84473e1e6d7a7ce39a54d77bb",
    value: 10000000006000000, 
    gas: augur.constants.CREATE_BINARY_MARKET_GAS
  }
});
// example onSuccess output:
onSuccess result: {
  blockHash: "0x8125127e415c1a242046f8ebbb036ebdefaa013ec697d8691da43727cd311155",
  blockNumber:1362465,
  callReturn: null,
  from: "0x40485264986740c8fb3d11e814bd94cf86012d29",
  gas: "0x5b8d80",
  gasFees: "0.02179245429087362",
  gasPrice: "0x1ce4eb7ee",
  hash: "0xc0583954449b26e2036212929620674bb1e7bafb904c4fae551297dd036ee769",
  input: "0x593...000",
  nonce: "0x1e",
  r: "0x9b013bbb8fda1635b419ff001fd57f651f648a1b4041c08d6506a13ff9d9ca21"
  s: "0x5b6358e1c1d71d233a659478b175dd3c51577889e17965546897275cb723ed39"
  timestamp: 1512491243,
  to: "0x6eabb9367012c0a84473e1e6d7a7ce39a54d77bb",
  transactionIndex: "0x1",
  v: "0x2c",
  value: "0x2386f2701c8d80"
}

var _extraInfo = { 
  "resolutionSource": "http://www.espn.com", 
  "tags": ["college football", "football"], 
  "outcomeNames": ["Georgia", "Florida"], 
  "longDescription": "" 
};
augur.api.Universe.createCategoricalMarket({
  universe: universe,
  _endTime: 1540875600,
  _feePerEthInWei: 1193046,
  _denominationToken: "0x74e88699f5d33f516500c3d9a2430f5e6ffb0689",
  _designatedReporterAddress: "0x01114f4bda09ed6c6715cf0baf606b5bce1dc96a",
  _outcomes: ["outcome1","outcome2"],
  _topic: "sports",
  _description: "Who will win the University of Georgia vs. University of Florida football game in 2018?",
  _extraInfo: JSON.stringify(_extraInfo),
  onSent: function (result) { console.log("onSent result:", result); },
  onSuccess: function (result) { 
    console.log("onSuccess result:", result);
    // Call `augur.createMarket.getMarketFromCreateMarketReceipt` to retrieve new market's address
  },
  onFailed: function (result) { console.log("onFailed result:", result); },
  tx: { 
    to: "0x6eabb9367012c0a84473e1e6d7a7ce39a54d77bb",
    value: 10000000006000000,
    gas: augur.constants.CREATE_CATEGORICAL_MARKET_GAS
  }
});
// example onSuccess output:
onSuccess result: {
  blockHash: "0x8125127e415c1a242046f8ebbb036ebdefaa013ec697d8691da43727cd311155",
  blockNumber:1362465,
  callReturn: null,
  from: "0x40485264986740c8fb3d11e814bd94cf86012d29",
  gas: "0x632ea0",
  gasFees: "0.021696129637146186",
  gasPrice: "0x1ce4eb7ee",
  hash: "0xb97f69a404805e81396a8fcc383b95edcb4a6fe6d17e0a33c994f05734a1cac6",
  input: "0x593...000",
  nonce: "0x1e",
  r: "0x9b013bbb8fda1635b419ff001fd57f651f648a1b4041c08d6506a13ff9d9ca21"
  s: "0x5b6358e1c1d71d233a659478b175dd3c51577889e17965546897275cb723ed39"
  timestamp: 1512491243,
  to: "0x6eabb9367012c0a84473e1e6d7a7ce39a54d77bb",
  v: "0x2c",
  value: "0x2386f2701c8d80"
}

var _parentPayoutNumerators = [ 0, 1000 ];
var _parentInvalid = false;
augur.api.Universe.createChildUniverse({
  universe: universe,
  _parentPayoutNumerators: _parentPayoutNumerators,
  _parentInvalid: _parentInvalid,
  onSent: function (result) { console.log("onSent result:", result); },
  onSuccess: function (result) { console.log("onSuccess result:", result); },
  onFailed: function (result) { console.log("onFailed result:", result); }
});
// example onSuccess output:
onSuccess result: {
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320559,
  callReturn: "0",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x7ab9bde926dfb9d1bbee93c07cbcf7d11ea4b995fa8f72d88d8322336d1aefd1",
  input: "0x3659bde926dfb9d1bbee93c07cbcf7d11ea4b995fa8f72d88d8322336d1ae7ac",
  nonce: "0xff8",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

var _extraInfo = { 
  "resolutionSource": "http://forecast.weather.gov", 
  "tags": ["San Francisco", "weather"], 
  "longDescription": "" 
};
augur.api.Universe.createScalarMarket({
  universe: universe,
  _endTime: 1530507600,
  _feePerEthInWei: 1193046,
  _denominationToken: "0x74e88699f5d33f516500c3d9a2430f5e6ffb0689",
  _designatedReporterAddress: "0x01114f4bda09ed6c6715cf0baf606b5bce1dc96a",
  _minPrice: -10,
  _maxPrice: 120,
  _numTicks: 10,
  _topic: "temperature",
  _description: "High temperature (in degrees Fahrenheit) in San Francisco, California, on July 1, 2018",
  _extraInfo: JSON.stringify(_extraInfo),
  onSent: function (result) { console.log("onSent result:", result); },
  onSuccess: function (result) { 
    console.log("onSuccess result:", result);
    // Call `augur.createMarket.getMarketFromCreateMarketReceipt` to retrieve new market's address
  },
  onFailed: function (result) { console.log("onFailed result:", result); },
  tx: { 
    to: "0x6eabb9367012c0a84473e1e6d7a7ce39a54d77bb",
    value: 10000000006000000,
    gas: augur.constants.CREATE_SCALAR_MARKET_GAS
  }
});
// example onSuccess output:
onSuccess result: {
  blockHash: "0x8125127e415c1a242046f8ebbb036ebdefaa013ec697d8691da43727cd311155",
  blockNumber:1362465,
  callReturn: null,
  from: "0x40485264986740c8fb3d11e814bd94cf86012d29",
  gas: "0x5b8d80",
  gasFees: "0.021695431576204446",
  gasPrice: "0x1ce4eb7ee",
  hash: "0xb97f69a404805e81396a8fcc383b95edcb4a6fe6d17e0a33c994f05734a1cac6",
  input: "0x593...000",
  nonce: "0x1e",
  r: "0x9b013bbb8fda1635b419ff001fd57f651f648a1b4041c08d6506a13ff9d9ca21"
  s: "0x5b6358e1c1d71d233a659478b175dd3c51577889e17965546897275cb723ed39"
  timestamp: 1512491243,
  to: "0x6eabb9367012c0a84473e1e6d7a7ce39a54d77bb",
  v: "0x2c",
  value: "0x2386f2701c8d80"
}

augur.api.Universe.getOrCacheDesignatedReportNoShowBond({
  universe: universe,
  onSent: function (result) { console.log("onSent result:", result); },
  onSuccess: function (result) { console.log("onSuccess result:", result); },
  onFailed: function (result) { console.log("onFailed result:", result); }
});
// example onSuccess output:
onSuccess result: {
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320554,
  callReturn: "0",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0x2fd618",
  gasFees: "0.00102297557556486",
  gasPrice: "0x5b793ccec",
  hash: "0x7ab9bde926dfb9d1bbee93c07cbcf7d11ea4b995fa8f72d88d8322336d1aefd1",
  input: "0x3659bde926dfb9d1bbee93c07cbcf7d11ea4b995fa8f72d88d8322336d1ae7ac",
  nonce: "0xff8",
  r: "0x3db124c7a0ae32094e0afdcd020d51fb930cdc3877066433b910e9257c3232eb"
  s: "0x543251c0fb374e535c61c88b913816f791edba101517921e473384706ddd0256"
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

augur.api.Universe.getOrCacheDesignatedReportStake({
  universe: universe,
  onSent: function (result) { console.log("onSent result:", result); },
  onSuccess: function (result) { console.log("onSuccess result:", result); },
  onFailed: function (result) { console.log("onFailed result:", result); }
});
// example onSuccess output:
onSuccess result: {
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320555,
  callReturn: "0",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x7ab9bde926dfb9d1bbee93c07cbcf7d11ea4b995fa8f72d88d8322336d1aefd1",
  input: "0x3659bde926dfb9d1bbee93c07cbcf7d11ea4b995fa8f72d88d8322336d1ae7ac",
  nonce: "0xff8",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

augur.api.Universe.getOrCacheMarketCreationCost({
  universe: universe,
  onSent: function (result) { console.log("onSent result:", result); },
  onSuccess: function (result) { console.log("onSuccess result:", result); },
  onFailed: function (result) { console.log("onFailed result:", result); }
});
// example onSuccess output:
onSuccess result: {
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320556,
  callReturn: "0",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x7ab9bde926dfb9d1bbee93c07cbcf7d11ea4b995fa8f72d88d8322336d1aefd1",
  input: "0x3659bde926dfb9d1bbee93c07cbcf7d11ea4b995fa8f72d88d8322336d1ae7ac",
  nonce: "0xff8",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

augur.api.Universe.getOrCacheReportingFeeDivisor({
  universe: universe,
  onSent: function (result) { console.log("onSent result:", result); },
  onSuccess: function (result) { console.log("onSuccess result:", result); },
  onFailed: function (result) { console.log("onFailed result:", result); }
});
// example onSuccess output:
onSuccess result: {
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320557,
  callReturn: "0",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x7ab9bde926dfb9d1bbee93c07cbcf7d11ea4b995fa8f72d88d8322336d1aefd1",
  input: "0x3659bde926dfb9d1bbee93c07cbcf7d11ea4b995fa8f72d88d8322336d1ae7ac",
  nonce: "0xff8",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

augur.api.Universe.getOrCacheTargetReporterGasCosts({
  universe: universe,
  onSent: function (result) { console.log("onSent result:", result); },
  onSuccess: function (result) { console.log("onSuccess result:", result); },
  onFailed: function (result) { console.log("onFailed result:", result); }
});
// example onSuccess output:
onSuccess result: {
  blockHash: "0xdc5e31404be698a6866fbe7d7cf435a2c6fab7deb3acf41d6c9bb981a2630fed",
  blockNumber: 1330897,
  callReturn: "6000000",
  from: "0x40485264986740c8fb3d11e814bd94cf86012d29",
  gas: "0x2fd618",
  gasFees: "0.00081266",
  gasPrice: "0x4a817c800",
  hash: "0x1af308e9ea415f321f099b36bae21753bd5227812451694e75b3604aea87bf92",
  input: "0x39d26051",
  nonce: "0x0",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1512018567,
  to: "0xfc6bba7d664e8cc242857f069e9fb1e7c25ecb44",
  transactionIndex: "0x1",
  v: "0x2c",
  value: "0x0"
}

augur.api.Universe.getOrCacheValidityBond({
  universe: universe,
  onSent: function (result) { console.log("onSent result:", result); },
  onSuccess: function (result) { console.log("onSuccess result:", result); },
  onFailed: function (result) { console.log("onFailed result:", result); }
});
// example onSuccess output:
onSuccess result: {
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320558,
  callReturn: "0",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x7ab9bde926dfb9d1bbee93c07cbcf7d11ea4b995fa8f72d88d8322336d1aefd1",
  input: "0x3659bde926dfb9d1bbee93c07cbcf7d11ea4b995fa8f72d88d8322336d1ae7ac",
  nonce: "0xff8",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

augur.api.Universe.getOrCreateCurrentFeeWindow({
  universe: universe,
  onSent: function (result) { console.log("onSent result:", result); },
  onSuccess: function (result) { console.log("onSuccess result:", result); },
  onFailed: function (result) { console.log("onFailed result:", result); }
});
// example onSuccess output:
onSuccess result: {
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320559,
  callReturn: "0",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x7ab9bde926dfb9d1bbee93c07cbcf7d11ea4b995fa8f72d88d8322336d1aefd1",
  input: "0x3659bde926dfb9d1bbee93c07cbcf7d11ea4b995fa8f72d88d8322336d1ae7ac",
  nonce: "0xff8",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

var _timestamp = 1401003133;
augur.api.Universe.getOrCreateFeeWindowByTimestamp({
  universe: universe,
  _timestamp: _timestamp,
  onSent: function (result) { console.log("onSent result:", result); },
  onSuccess: function (result) { console.log("onSuccess result:", result); },
  onFailed: function (result) { console.log("onFailed result:", result); }
});
// example onSuccess output:
onSuccess result: {
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320560,
  callReturn: "0",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x7ab9bde926dfb9d1bbee93c07cbcf7d11ea4b995fa8f72d88d8322336d1aefd1",
  input: "0x3659bde926dfb9d1bbee93c07cbcf7d11ea4b995fa8f72d88d8322336d1ae7ac",
  nonce: "0xff8",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

augur.api.Universe.getOrCreateFeeWindowForForkEndTime({
  universe: universe,
  onSent: function (result) { console.log("onSent result:", result); },
  onSuccess: function (result) { console.log("onSuccess result:", result); },
  onFailed: function (result) { console.log("onFailed result:", result); }
});
// example onSuccess output:
onSuccess result: {
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320561,
  callReturn: "0",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x7ab9bde926dfb9d1bbee93c07cbcf7d11ea4b995fa8f72d88d8322336d1aefd1",
  input: "0x3659bde926dfb9d1bbee93c07cbcf7d11ea4b995fa8f72d88d8322336d1ae7ac",
  nonce: "0xff8",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

augur.api.Universe.getOrCreateNextFeeWindow({
  universe: universe,
  onSent: function (result) { console.log("onSent result:", result); },
  onSuccess: function (result) { console.log("onSuccess result:", result); },
  onFailed: function (result) { console.log("onFailed result:", result); }
});
// example onSuccess output:
onSuccess result: {
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320562,
  callReturn: "0",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x7ab9bde926dfb9d1bbee93c07cbcf7d11ea4b995fa8f72d88d8322336d1aefd1",
  input: "0x3659bde926dfb9d1bbee93c07cbcf7d11ea4b995fa8f72d88d8322336d1ae7ac",
  nonce: "0xff8",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

augur.api.Universe.getOrCreatePreviousFeeWindow({
  universe: universe,
  onSent: function (result) { console.log("onSent result:", result); },
  onSuccess: function (result) { console.log("onSuccess result:", result); },
  onFailed: function (result) { console.log("onFailed result:", result); }
});
// example onSuccess output:
onSuccess result: {
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320563,
  callReturn: "0",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x7ab9bde926dfb9d1bbee93c07cbcf7d11ea4b995fa8f72d88d8322336d1aefd1",
  input: "0x3659bde926dfb9d1bbee93c07cbcf7d11ea4b995fa8f72d88d8322336d1ae7ac",
  nonce: "0xff8",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

var _reportingParticipants = [ ];
var _feeWindows = [ ];
augur.api.Universe.redeemStake({
  universe: universe,
  _reportingParticipants: _reportingParticipants,
  _feeWindows: _feeWindows,
  onSent: function (result) { console.log("onSent result:", result); },
  onSuccess: function (result) { console.log("onSuccess result:", result); },
  onFailed: function (result) { console.log("onFailed result:", result); }
});
// example onSuccess output:
onSuccess result: {
  blockHash: "0x38c8f12c226b8829ae493da94a730d6c149bf9a0578aac151f43028032ea2efb",
  blockNumber: 320564,
  callReturn: "0",
  from: "0xa47eb7af47b8722c3100b49c256a94c742bb26b6",
  gas: "0xb10d2",
  gasFees: "0.005827878",
  gasPrice: "0x430e23400",
  hash: "0x7ab9bde926dfb9d1bbee93c07cbcf7d11ea4b995fa8f72d88d8322336d1aefd1",
  input: "0x3659bde926dfb9d1bbee93c07cbcf7d11ea4b995fa8f72d88d8322336d1ae7ac",
  nonce: "0xff8",
  r: "0x706eb8aee04faf21fd6da949f946df5fa118da35a619560af9b81fc05054715c",
  s: "0x60d3125aa3b1daabd37618fb80232037cdaef9c87a8d262826880f0e57fdb0d3",
  timestamp: 1501003133,
  to: "0xa7f3659c53820346176f7e0e350780df304db179",
  v: "0x2c",
  value: "0x0"
}

Provides JavaScript bindings for the Universe Solidity Contract, which allows for the creation of Markets and provides functions for obtaining information about a given Universe.

augur.api.Universe.createBinaryMarket(p)

Creates a new Binary Market. This transaction will trigger a MarketCreated event if the Market is created successfully. After the transaction has completed successfully, the Market address can be obtained by calling augur.createMarket.getMarketFromCreateMarketReceipt.

Parameters:

Returns:

augur.api.Universe.createCategoricalMarket(p)

Creates a new Categorical Market. This transaction will trigger a MarketCreated event if the Market is created successfully. After the transaction has completed successfully, the Market address can be obtained by calling augur.createMarket.getMarketFromCreateMarketReceipt.

Parameters:

Returns:

augur.api.Universe.createChildUniverse(p)

Creates a new Child Universe (if it does not already exist) with the given Payout Set _parentPayoutNumerators and _parentInvalid. If the Child Universe has already been created, this transaction will return the Ethereum address of that child Universe. This transaction will trigger a UniverseCreated event if the Child Universe has not been created yet.

This transaction will fail if:

Parameters:

Returns:

augur.api.Universe.createScalarMarket(p)

Creates a new Scalar Market. This transaction will trigger a MarketCreated event if the Market is created successfully. After the transaction has completed successfully, the Market address can be obtained by calling augur.createMarket.getMarketFromCreateMarketReceipt.

Parameters:

Returns:

augur.api.Universe.getOrCacheDesignatedReportNoShowBond(p)

Gets the Designated Report No-Show REP Bond for Markets in the specified Universe. If the value of the Designated Report No-Show REP Bond for the current Fee Window has not already been cached in the Universe contract, this function will cache it.

Parameters:

Returns:

augur.api.Universe.getOrCacheDesignatedReportStake(p)

Gets the amount of Staked REP the Designated Reporter must put up when submitting a Designated Report in the Universe. If this value for the current Fee Window has not already been cached in the Universe contract, this function will cache it.

Parameters:

Returns:

augur.api.Universe.getOrCacheMarketCreationCost(p)

Gets the estimated amount of attoETH required to create a Market in the specified Universe. The amount returned by this function is equivalent to the sum returned by the transactions augur.api.Universe.getOrCacheValidityBond and augur.api.Universe.getOrCacheTargetReporterGasCosts. If the values of the Validity Bond and the Designated Report No-Show Gas Bond for the current Fee Window have not already been cached in the Universe contract, this function will cache them.

Parameters:

Returns:

augur.api.Universe.getOrCacheReportingFeeDivisor(p)

Gets the number by which the total payout amount for a Market is divided in order to calculate the Reporting Fee. If this value for the current Fee Window has not already been cached in the Universe contract, this function will cache it.

Parameters:

Returns:

augur.api.Universe.getOrCacheTargetReporterGasCosts(p)

Gets the Designated Report No-Show Gas Bond that is paid to the First Public Reporter in the event of a Designated Report no-show, or refunded to the Market Creator Mailbox if the Designated Reporter does report. The amount returned by this function will typically be well above the actual cost to create a Market, just to ensure the Market creation will succeed. If the Designated Report No-Show Gas Bond for the current Fee Window has not already been cached in the Universe contract, this function will cache it.

Parameters:

Returns:

augur.api.Universe.getOrCacheValidityBond({p)

Gets the amount the Market Creator must pay for the Validity Bond when creating a Market. If the Validity Bond for the current Fee Window has not already been cached in the Universe contract, this function will cache it. (This amount will be refunded to the Market Creator if the Final Outcome of the Market is not invalid.)

Parameters:

Returns:

augur.api.Universe.getOrCreateCurrentFeeWindow(p)

Gets the Ethereum contract address, as a hexadecimal string, of the Fee Window that is currently active in the specified Universe. If the contract address for the Fee Window does not exist yet, this function will create it.

Parameters:

Returns:

augur.api.Universe.getOrCreateFeeWindowByTimestamp(p)

Gets the Ethereum contract address, as a hexadecimal string, of the active Fee Window at the Unix timestamp _timestamp in the specified Universe. If the Ethereum contract address for the Fee Window does not already exist, this function will create it. This transaction will trigger a FeeWindowCreated event if the Fee window is created without any errors.

Parameters:

Returns:

augur.api.Universe.getOrCreateFeeWindowForForkEndTime(p)

Gets the Ethereum contract address, as a hexadecimal string, of the Fee Window starting at the end of the current Fork in the Universe. If the contract address for the Fee Window does not already exist, this function will create it.

Parameters:

Returns:

augur.api.Universe.getOrCreateNextFeeWindow(p)

Gets the Ethereum contract address, as a hexadecimal string, of the Fee Window that will be active after the current Fee Window ends in the specified Universe. If the contract address for the Fee Window does not exist yet, this function will create it.

Parameters:

Returns:

augur.api.Universe.getOrCreatePreviousFeeWindow(p)

Gets the Ethereum contract address, as a hexadecimal string, of the Fee Window that was active just before the current Fee Window in the specified Universe. If the contract address for the Fee Window does not exist yet, this function will create it.

Parameters:

Returns:

augur.api.Universe.redeemStake(p)

Calls the redeem function for all Ethereum contract addresses in the arrays _reportingParticipants and _feeWindows using the caller’s Ethereum address as the redeemer. _reportingParticipants can contain Ethereum contract addresses for DisputeCrowdsourcers, InitialReporters, or both, as hexadecimal strings. _feeWindows can only contain the Ethereum contract addresses of Fee Windows. This function is intended as easy way to redeem Staked REP and/or Ether in multiple Dispute Crowdsourcers, Initial Reports, and Fee Windows at once.

Parameters:

Returns:

Events API

There are a variety of “events” that are emitted by the Augur contracts. Each event is triggered by a user doing something on Augur, such as submitting an Initial Report, Finalizing a Market, Filling an Open Order, etc. For a full list, please refer to the Event Types section.

The augur.js Events API includes event listeners, which provide notifications of events that are currently happening. The functions augur.events.startAugurNodeEventListeners, augur.events.startBlockchainEventListeners, and augur.events.startBlockListeners can be used to listen for incoming events.

The function augur.events.getAllAugurLogs can be used to get an array of all Augur-related events that have been logged in the past.

Events Functions

augur.events.getAllAugurLogs({
  fromBlock: 1490000
}, function(error, allAugurLogs) {
  console.log(allAugurLogs); 
});
// example output:
[
  {
    "key": "0x4175677572000000000000000000000000000000000000000000000000000000",
    "addition": "0x852684b374fe03ab77d06931f1b2831028fd58f5",
    "commitHash": "0x28562806a46f89eaf53726c288f5294fa9c34827",
    "bytecodeHash": "0x1e649bc7bb83f3f7bba3440afadec07fe666377f4c56f34557a050dedc4d76d0",
    "address": "0x852684b374fe03ab77d06931f1b2831028fd58f5",
    "removed": false,
    "transactionHash": "0x6d18853ed20b8bc7b344a89b9fb1eafa0d46fcf80ad5bb3965a856446c24bfe2",
    "transactionIndex": 0,
    "logIndex": 0,
    "blockNumber": 1541700,
    "contractName": "Augur",
    "eventName": "RegistryAddition"
  },
  ...
  {
    "universe": "0x1f732847fbbcc46ffe859f28e916d993b2b08831",
    "token": "0x13fa2334966b3cb6263ed56148323014c2ece753",
    "from": "0x8fa56abe36d8dc76cf85fecb6a3026733e0a12ac",
    "to": "0x40485264986740c8fb3d11e814bd94cf86012d29",
    "value": "0.001",
    "address": "0x852684b374fe03ab77d06931f1b2831028fd58f5",
    "removed": false,
    "transactionHash": "0x39618f9552bad2ee24ac48fa1b634ffbe1c33a157793cd458ae2cbe68c988cde",
    "transactionIndex": 2,
    "logIndex": 1,
    "blockNumber": 1599717,
    "contractName": "Augur",
    "eventName": "TokensTransferred"
  }
]

augur.events.startAugurNodeEventListeners({
  TokensTransferred: function(error, result){
    console.log("A new TokensTransferred event has occurred: ", result); 
  }
}, function() {
  console.log("Started Augur Node event listeners!");
});
// example output:
"Started Augur Node event listeners!"
// example output after a TokensTransferred event occurs:
"A new TokensTransferred event has occurred:"
{
  "transactionHash": "0xbcb517796168347d92ef9448c8aec6f3112dfd5a41ebd9de0c097927cb01ca6b",
  "logIndex": 1,
  "sender": "0x8fa56abe36d8dc76cf85fecb6a3026733e0a12ac",
  "recipient": "0x40485264986740c8fb3d11e814bd94cf86012d29",
  "token": "0x13fa2334966b3cb6263ed56148323014c2ece753",
  "value": "0.001",
  "blockNumber": 1600771
}

augur.events.startBlockchainEventListeners(
  {
    Augur: {
      TokensTransferred: function() { console.log("A new TokensTransferred event has occurred."); }
    }
  }, 
  1490000, 
  function() {
    console.log("Setup is complete!");
  }
); 
// example output: 
"Starting blockstream at block  1490000"
"Setup is complete!"
// example output after a TokensTransferred event occurs: coming soon

augur.events.startBlockListeners({
  onAdded: function(block) {
    console.log("New block added!", block);
  }, 
  onRemoved: function(block) {
    console.log("Block removed!", block);
  }
});
// example output:
"true"
// example output after a block is added to the Ethereum blockchain:
"New block added!"
{
  "difficulty": "0x2",
  "extraData": "0xd783010703846765746887676f312e392e32856c696e75780000000000000000e76b9e0b0711c73221a771804a8c61f01d1ebf0cf6c8bafb17f93e671d38944422c9d3503d5e9ea9763907af5dd1064256b5bdb320f9c5247708a486dfd4292b01",
  "gasLimit": "0x6a9bc4",
  "gasUsed": "0x337bf",
  "hash": "0xaae5645ad53b51f85c55971ffcbfad7c5e44a940794fac1fab6fd93560c5055b",
  "logsBloom": "0x00000000040000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000020000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000011000000000000000000000",
  "miner": "0x0000000000000000000000000000000000000000",
  "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "nonce": "0x0000000000000000",
  "number": "0x1877a7",
  "parentHash": "0xcb656990d8b7993183bed724f1af4b74d8a5e9ab1e6f7abdb3e5209504272cd2",
  "receiptsRoot": "0x4a0b60d86057241ca030d4ebe75df43ca7857ad30a542c21db8876fa7f6c836b",
  "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
  "size": "0x5b4",
  "stateRoot": "0xd13fadf3b2edc48c2597900aa0bda6a97d17f4e907161eb061e34821b6067af0",
  "timestamp": "0x5a5e3023",
  "totalDifficulty": "0x2d6a4a",
  "transactions": [
    "0xce2fa17a608bfad0f1520e307b16f4bffbe1d8b6ec399fc5af7f8b6ab3327e1d",
    "0xcd54f9e1335e723448690876794664f21a270984f0f34153e891577df181c3d9",
    "0x776fbb3f73dee8f40361b06f642406909551d67e146d3e80ffe5a6fdf6f087a9",
    "0xc2efc2f39bf738cfbbf00f7d6ee89ecb6edaac2d0e0c1ae6a495786daf68b168",
    "0x422095f55a36c1f752328a82873a5724fde7c29b49b545a27762037303cac71f",
    "0x439b923062e2d23aa672a09ff221afdb81b6d0622fc29981ee742702a3157524"
  ],
  "transactionsRoot": "0x1b1b70c302dc90d27075af34bfb4bd42bb505822570b5f8131cfcc8cf0368396",
  "uncles": []
}

augur.events.stopAugurNodeEventListeners(
  function() {
    console.log("Stopped Augur Node event listeners!");
  }
);
// example output:
"Unsubscribed from 1e08901c-0797-49f2-b13f-e688e5695905"
"Stopped Augur Node event listeners!"

augur.events.stopBlockchainEventListeners();
// example output: 
"true"

augur.events.stopBlockListeners();
// example output:
"true"

augur.events.getAllAugurLogs(p, callback)

Returns all Augur event logs on the Ethereum blockchain within a certain block range, sorted by blockNumber and logIndex.

Parameters:

Returns:

augur.events.startAugurNodeEventListeners(eventCallbacks, onSetupComplete)

Begins listening for events emitted by an Augur Node.

Parameters:

augur.events.startBlockchainEventListeners(eventCallbacks, startingBlockNumber, onSetupComplete)

Begins listening for events emitted by the Ethereum blockchain.

Parameters:

augur.events.startBlockListeners()

Start listening for blocks.

Parameters:

Returns:

augur.events.stopAugurNodeEventListeners(callback)

Removes all active listeners for events emitted by augur-node.

Parameters:

augur.events.stopBlockchainEventListeners()

Removes all active listeners for events emitted by the Ethereum blockchain.

Returns:

augur.events.stopBlockListeners()

Stop listening for blocks and block removals.

Returns:

Event Types

The following table shows the different types of events that Augur’s smart contracts log to the Ethereum blockchain. In this table, the Contract field refers to the Solidity contract in which the event is defined (source code / contract addresses), and and the Data (indexed) field describes which event fields are indexed on the Ethereum blockchain.

Label Contract Event Description Data (indexed) Data (non-indexed)
Approval ERC20 spender has been approved to spend value amount of ERC20 tokens on behalf of owner. owner, spender value
Burn VariableSupplyToken value amount of target’s tokens have been burned (i.e., completely destroyed) . target value
DisputeCrowdsourcerCompleted Augur The Ethereum contract address disputeCrowdsourcer for market in universe filled the Dispute Bond required to Challenge market’s Tentative Outcome. universe, market disputeCrowdsourcer
DisputeCrowdsourcerContribution Augur The Ethereum address reporter Staked amountStaked REP on the Outcome for disputeCrowdsourcer in market of universe. universe, reporter, market disputeCrowdsourcer, amountStaked
DisputeCrowdsourcerCreated Augur The Ethereum contract address disputeCrowdsourcer with Payout Set payoutNumerators and Dispute Bond size size was created in market of universe. universe, market disputeCrowdsourcer, payoutNumerators, size
FeeWindowCreated Augur The Ethereum contract address feeWindow has created a new Fee Window (with ID id and running from startTime to endTime) in universe. universe feeWindow, startTime, endTime, id
MarketCreated Augur marketCreator has created a marketType market with outcomes and topic in universe for a price of marketCreationFee and a price range of minPrice to maxPrice. Additional information about market can be found in description and extraInfo. topic, universe, marketCreator description, extraInfo, market, outcomes, marketCreationFee, minPrice, maxPrice, marketType
InitialReportSubmitted Augur reporter has submitted an Initial Report for the market in universe with amountStaked REP staked on the Outcome payoutNumerators. If reporter is the Designated Reporter (as opposed to the First Public Reporter), isDesignatedReporter is set to true. universe, reporter, market amountStaked, isDesignatedReporter, payoutNumerators
MarketFinalized Augur The Outcome of market in universe is now considered final. universe, market
Mint VariableSupplyToken value amount of brand new tokens were created for target. target value
OrderCanceled Augur sender’s Order (with ID orderId and type orderType) for the Share Token at address shareToken was canceled in universe, and sender was refunded either tokenRefund in ETH or sharesRefund Share Tokens. universe, shareToken, sender orderId, orderType, tokenRefund, sharesRefund
OrderCreated Augur creator placed an orderType Order with orderId in universe for amount of shareToken at price in the Trade Group tradeGroupId. creator put up either moneyEscrowed or sharesEscrowed. creator, universe, shareToken orderType, amount, price, moneyEscrowed, sharesEscrowed, tradeGroupId, orderId
OrderFilled Augur Order orderId in universe for Share Token at address shareToken was filled by filler in Trade Group tradeGroupId. The Order Creator escrowed numCreatorShares or numCreatorTokens in ETH, and filler put up numFillerShares or numFillerTokens in ETH. marketCreatorFees and reporterFees (denominated in attoETH) were spent to pay the Market Creator and Reporters. universe, shareToken filler, orderId, numCreatorShares, numCreatorTokens, numFillerShares, numFillerTokens, marketCreatorFees, reporterFees, tradeGroupId
RegistryAddition Augur The Ethereum contract address addition was added to Augur’s registry, which is an array of all of the contracts Augur uses. The contract has a 32-byte key (for looking up the contract in Augur’s registry), a 20-byte commitHash, and a 32-byte bytecodeHash   key, addition, commitHash, bytecodeHash
TokensBurned Augur Burned (i.e., completely destroyed) amount of target’s attotokens (at address token) in universe. universe, token, target amount
TokensMinted Augur Created amount brand new attotokens (at address token) in universe for target. universe, token, target amount
TokensTransferred Augur value amount of the token at address token in universe has been transfered between account from and to. universe, token, from to, value
TradingProceedsClaimed Augur sender has collected trading profits from the Share Token at address shareToken in Finalized Market market in universe. sender had numShares Share Tokens, numPayoutTokens paid out, and a balance of finalTokenBalance. universe, shareToken, sender market, numShares, numPayoutTokens, finalTokenBalance
Transfer ERC20Basic Transferred value attotokens between accounts from and to. from, to value
UniverseCreated Augur childUniverse has been created from parentUniverse. parentUniverse, childUniverse
UniverseForked Augur A Market in universe has had its Tentative Outcome Challenged with a Dispute Bond greater than the Fork Threshold, which has caused universe to Fork. universe
WhitelistAddition Augur The Ethereum contract address addition was added to Augur’s whitelisted contracts. (Many of the functions in Augur’s Solidity smart contracts are only callable by contracts that have been whitelisted.)   addition
WinningsRedeemed Augur The Ethereum contract address reportingParticipant has allowed reporter to redeem amountRedeemed REP in market of universe for the Outcome payoutNumerators. reporter also received reportingFeesReceived in ETH. universe, reporter, market reportingParticipant, amountRedeemed, reportingFeesReceived, payoutNumerators

Tests

The Augur repository, and the middleware augur.js repository both contain tests. Tests are run using Mocha. Mocha does not need to be installed globally to run the test suites, but if you would like to run specific tests explicitly then it is helpful to globally install Mocha.

To globally install Mocha using npm you would run the following command:

$ npm install -g mocha

To globally install Mocha using yarn, you would run the following command:

$ yarn global add mocha

Once you have Mocha installed, you can run a specific test case like so:

$ mocha ./test/unit/filters/add-filter.js

Augur and augur.js both contain their own sets of unit tests and augur.js has a an integration test suite as well. The following sections will provide more details about the differences between the two.

Running Tests In Augur

Augur has a suite of unit tests that can be run using npm or yarn. In order to run tests, makes sure you have installed the dependencies for Augur first by using the following command:

$ npm install

or if you are using yarn:

$ yarn

Once you have installed the dependencies for Augur, you can run the following command using npm to run the unit tests:

$ npm test

of if you prefer to use yarn, the command becomes:

$ yarn test

The Augur repository is also following a set of standard coding rules. In order to check if your code is following the standards, you can run a linting command. To lint the Augur repository using npm, you would run the following command:

$ npm run lint

and to issue the same command with yarn, you would enter this:

$ yarn lint

Running Tests In augur.js

augur.js includes both Unit tests and integration tests that can be run with npm or yarn. In order to run tests, makes sure you have installed the dependencies for augur.js first by using the following command:

$ npm install

or if you are using yarn:

$ yarn

Once you have installed the dependencies for augur.js, you can run the following command using npm to run the unit tests:

$ npm run test

To run integration tests with npm, use the following command:

$ npm run integration-test

If you would prefer to use yarn the command to run unit tests becomes:

$ yarn test

to run integration tests, the command is:

$ yarn integration-test

augur.js also follows a standard for it’s code and also has a linting command. The command using npm is:

$ npm run lint

And if you prefer yarn then the command is:

$ yarn lint

UI Conventions

Modules

  // Modules Conventions
  // Import Conventions
  // Order: 3rd party modules > services > components/selectors/reducers/actions
  // > constants > utils
  import React, { Component } from 'react';
  import { augur } from 'services/augurjs';
  import Input from 'modules/common/components/input';
  import { BUY, SELL } from 'modules/trade/constants/types';
  import trimString from 'utils/trim-string';

  // Export conventions
  // single constant export
  export default const BUY = 'buy';
  // or for a single function
  export default (args) => {
    // do something...
  };

Modules import paths for assets, modules, utils, and services are aliased, so avoid relative paths. Always traverse from the aliases. Import requirements in the following order:

  1. 3rd party modules
  2. services
  3. components/selectors/reducers/actions
  4. constants
  5. utils

Modules with a single export should have that denoted as default. If the export is a function, it should be anonymous.

Components

All components should be semantically tagged, highly reusable, and DRY. Components should have comments for functionality that may be non-obvious, depend on other methods, requires a complex mutation/filer, etc.

To help ensure this, the following conventions have been employed:

Layout Conventions:

<!-- JSX Layout Conventions -->
<!-- Example Component tree (after rendering)-->
<!-- only one main tag in the whole app, currently in app.jsx -->
<main id="app">
<!-- each view has it's own section component -->
  <section id="create-market-view" >
  <!-- each view has reusable components which should be articles
  unless they are specifically a button, list, link, etc.-->
    <article>
      <!-- more reusable components may be inside -->
    </article>
    <!-- ....more reusable components -->
  </section>
</main>

There is only one main tag, which is currently employed in the app.jsx component, to contain all view content. All top-level components (i.e. - views) should be contained within a section tag. Though valid, section should only be used for view level components. All section tags should have an accompanying id attribute (excluding unique semantic tags (main, header, footer, etc.)). All reusable components should be contained within an article tag unless this use would be semantically incorrect; in which case, use whatever tag is appropriate. All components should be standard HTML5 elements with their default behaviors intact. (Note: Due to some implementation constraints, there may be a reason to deviate from this, but it should be dialoged over prior to implementation.)

// React Conventions:
// required propTypes should come first.
static propTypes = {
  importantProp: PropTypes.object.isRequired,
  optionalProp: PropTypes.string,
}

// top level component (ie Views) example:
const marketsView = p => (
  <section id="markets-view">
    <MarketsList
      loginAccount={p.loginAccount}
      markets={p.markets}
      pagination={p.pagination}
      scalarShareDenomination={p.scalarShareDenomination}
    />
  </section>
);

marketsView.propTypes = {
  loginAccount: PropTypes.object,
  scalarShareDenomination: PropTypes.object,
  markets: PropTypes.array,
  pagination: PropTypes.object,
};

export default marketsView;

// re-usable component example:
const MarketsList = (p) => {
  const nullMessage = 'No Markets Available';

  return (
    <article className="markets-list">
      {p.markets.length ? p.markets.map((market) => {
        const selectedShareDenomination = getValue(p, `scalarShareDenomination.markets.${market.id}`);
        const shareDenominations = getValue(p, 'scalarShareDenomination.denominations');

        return (
          <MarketPreview
            key={market.id}
            loginAccount={p.loginAccount}
            {...market}
            selectedShareDenomination={selectedShareDenomination}
            shareDenominations={shareDenominations}
          />
        );
      }) : <NullStateMessage message={nullMessage} /> }
      {!!p.pagination && !!p.pagination.numUnpaginated &&
        <Paginator {...p.pagination} />
      }
    </article>
  );
};

MarketsList.propTypes = {
  loginAccount: PropTypes.object,
  scalarShareDenomination: PropTypes.object,
  markets: PropTypes.array,
  pagination: PropTypes.object
};

export default MarketsList;

React Conventions

Props that are being passed to a component should be explicit from both ends and Prop validations should have required props first, optional props after.

Null component states (ex: ‘no markets’, 'no tags’, etc.) should always be shown as the false value for a conditional display. Conditional display should occur as far down the component tree as possible.

Detailed Component Conventions

Not all conventions are detailed above, but rather just the main points. For a full review of the breadth of the conventions employed, reference:

Styles

// Less Variable exposed for JS example:
@animation-speed-very-fast: 200ms;

// For accessibility w/in JS
body {
  --animation-speed-very-fast: unit(@animation-speed-very-fast);
}
// access less variable using JS
updateAnimationSpeedValue() {
    this.setState({
      animationSpeed: parseInt(window.getComputedStyle(document.body).getPropertyValue('--animation-speed-very-fast'), 10)
    });
  }

All styles should be contextual such that styling rules are only directly applied to the immediately relevant component(s), with the ultimate goal always being consistency and maintainability. This is seen reflected in the overall structure of the stylesheets – generally a 1-to-1 between a component and a stylesheet.

The full breadth of Less’s functionality is permissible. If you need a Less variable to be accessible during runtime, create a rule set for body and with identically named custom properties which have their values as the respective less variables. You can then get these values by calling getComputedStyle and getPropertyValue on document.body.

Following are some of the conventions that have been employed:

Mixin Conventions

  /* Mixin Conventions */
  // BORDER Constants
  // Defaults
  @border-all: 'all sides';
  @border-default-chroma: @border-normal;
  @border-default-width: 1px;
  // Sides
  @border-top: border-top;
  @border-right: border-right;
  @border-bottom: border-bottom;
  @border-left: border-left;
  // Chroma
  @border-normal: @color-border;
  @border-muted: @color-border-muted;
  @border-light: @color-border-light;
  @border-faded: fadeout(@color-border, @amount-extra-light);
  // Style
  @border-solid: solid;
  @border-dotted: dotted;
  @border-dashed: dashed;
  @border-double: double;
  // Width
  @border-width-2: 2px;
  @border-width-3: 3px;
  // define mixin
  .border(@side: false; @property: @border-all; @chroma: @border-default-chroma; @width: @border-default-width; @style: @border-solid;) {
    & when (@side) {
      & when (@property = @border-all) {
        border: @width @style @chroma;
      }

      @{property}: @width @style @chroma;
    }

    & when not (@side) {
      border: none;
    }
  }

  /* Component Style Conventions: */

  .example-widget-viewer {
    // mixins come first and in alphabetical order
    .border(true);

    align-items: center;
    background-color: @color-white;
    display: flex;
    flex: 1;
    min-width: 22em;
  }

Use mixins where provided. If an identical style is to be applied to multiple elements, that declaration block should probably be abstracted to a mixin. Comments should be employed for mixins to help inform the utilization. This can be seen in the way (not exhaustive) typography and borders are employed. Some notable mixins include: - animations, - borders, - colors, and - typography.

Component Style Conventions

Every component should have the minimum amount of styling required (helps maintain contextualization). This allows for stylesheets of parent components that employ a component to apply any additional 'chrome’ required.

Things to remember about Component Less styling include:

Detailed Style Conventions

Above are the main points, but additional structural and styling conventions of the stylesheets themselves are enforced through linting. For a full review of all conventions, reference:

Glossary

This section of the documentation is dedicated to terms found and used throughout the rest of documentation. Below you will find sections about terms used in Augur. The goal is to explain everything that might be confusing in an easy-to-understand way.

Ask Order

An Ask Order is an Order indicating the desire of the Order Creator to sell Shares of one or more Outcomes. This is the opposite of a Bid Order.

Atto- (Prefix)

Atto- is a unit prefix in the metric system denoting a factor of 10^−18, or 0.000000000000000001. This prefix is used for a number of terms in Augur, including attoETH, attoREP, attoshares, attotoken, etc.

Bid Order

A Bid Order is an Order indicating the desire of the Order Creator to buy Shares of one or more Outcomes. This is the opposite of an Ask Order.

Binary Market

A Binary Market is a Market with only two Outcomes (as well as Invalid, which is always a possible Outcome). Binary Markets are for yes-or-no questions; if more potential Outcomes are needed, a Categorical or Scalar Market should be used.

Cash

Cash is an ERC-20 token that is used within Augur’s Solidity smart contracts and acts as a wrapper for ETH to facilitate some of Augur’s functionality. Users do not interact directly with Cash tokens.

Categorical Market

A Categorical Market is a Market with more than 2 potential Outcomes, but no more than 8. As with all Markets, Invalid is also a potential Outcome, but it does not count toward the 8-Outcome maximum. Categorical Markets are best for multiple choice questions, such as “Which team will win Tournament X?” or “What color tie will the U.S. President wear at the next presidential press conference?”. If a Market is based around a simple yes-or-no question, it is better to use a Binary Market. For a Market about what a particular stock price will be on a given date, a Scalar Market should be used, as 8 potential outcomes would not be sufficient.

Challenge

Challenge is used to describe the act of a REP holder Staking REP on a Market Outcome other than the Tentative Outcome for that Market. This REP is sent to a Crowdsourcer and goes toward filling a Dispute Bond for that Outcome in order to Dispute or “challenge” the Tentative Outcome of a Market before it is Finalized. If the Dispute Bond is successfully filled, and that Outcome becomes the Final Outcome for the Market, the users who Staked REP on that Outcome can get back 1.5x the amount of REP they originally Staked, once the Market is Finalized. If the Dispute Bond is successfully filled, but that Outcome does not become the Final Outcome for the Market, the users who Staked REP on that Outcome will forfeit all of the REP they Staked. If the Dispute Bond is not successfully filled, the users who Staked on that Outcome can redeem their REP once the Fee Window has elapsed.

Child Universe

A Child Universe is a Universe created after a Market Forks. Child Universes have a Parent Universe, which is the Universe where the Forked Market resides. Locked Universes always have Child Universes because the Forking process causes the Universe containing the Forked Market to become Locked and creates the Child Universes.

Complete Set

A Complete Set is a collection of Shares in every Outcome. Complete Sets are created when the Creator and Filler of an Order both use currency to pay for the trade, as opposed to one or both parties using Shares to complete the Trade. When both parties use shares to complete a trade, then a Complete Set will be formed and Settled (destroyed). The cost in attoETH of a Complete Set for a particular Market is determined by the Number of Ticks for that Market. When Complete Sets are Settled, Settlement Fees are extracted from the value of the Complete Set and are paid proportionally by both parties. Therefore, users who get a larger payout from Settlement also pay a larger portion of the fees. The Settlement Fees extracted from Share Settlement go toward paying for the Reporting system, in the form of a Reporting Fee, and paying the Market Creator their set Creator Fee.

Creator Fee

A Creator Fee is a percentage fee, in ETH, that is collected by the Market Creator whenever Shares are Settled. It is set by the Market Creator when he or she creates a new Market. The Creator Fee must be between 0% and 50%, and it cannot be changed once it has been set. The Creator Fee and the Reporting Fee are both extracted at the same time whenever Shares are Settled. Shares can be Settled when a user sells a Complete Set or when the Market has been Finalized and a user wants to close an open Position. The Creator Fee is designed to incentivize users to make popular Markets as they stand to earn money if enough people trade on the Market. They can then recoup their Market creation cost and ideally turn a profit on posting interesting Markets. The Settlement Fees are discussed in more details in the Trading section of the documentation.

Crowdsourcer

Each Outcome of a Market has its own Crowdsourcer, which is a Solidity smart contract that keeps track of how much REP has been Staked on a particular Outcome during a given Fee Window. If users Stake enough REP on that Outcome to fill the Dispute Bond and Challenge the Tentative Outcome, that Outcome will become the new Tentative Outcome (and the Market will go through another Dispute Round), or the Market will Fork (if a Dispute Bond greater than the Fork Threshold is filled). If the Dispute Bond is successfully filled, and that Outcome becomes the Final Outcome for the Market, the users who Staked REP on that Outcome can get back 1.5x the amount of REP they originally Staked, once the Market is Finalized. If the Dispute Bond is successfully filled, but that Outcome does not become the Final Outcome for the Market, the users who Staked REP on that Outcome will forfeit all of the REP they Staked. If the Dispute Bond is not successfully filled, the users who Staked on that Outcome can redeem their REP once the Fee Window has elapsed.

Decentralized Oracle

The heart of Augur is its Decentralized Oracle, which allows users and smart contracts to propose questions to Augur and discover accurate information about the real world (based on how REP holders have voted on Market Outcomes) without having to trust a single person, AI, or organization. Augur’s Oracle allows information to be migrated from the real world to a blockchain without relying on a centralized, trusted third party.

Designated Report

A Designated Report occurs when a