Market Orders
Market orders are defined within a transaction and can be uniquely identified by block and event index.
| name | type | description |
|---|---|---|
| market id | bytes32 | The market ID on which the offer is consumed. |
| taker | address | The consumer address. |
| got | uint256 | The amount of outbound token that the taker received from the market order. |
| gave | uint256 | The amount of inbound token used for the market order. |
| fee | uint256 | The amount of inbound token used to pay the governance fee. |
| bounty | uint256 | The amount of native provisions sent by the expired offers to the taker. |
| fillVolume | uint256 | The original amount asked if fillWants is true, or sent if fillWants is false. |
| fillWants | bool | Whether the fillVolume is the amount asked or the amount sent. |
While indexing, the primary key for a market order should be a composite of the block number and the event index. The following additional metadata should be saved for convenience while querying:
| name | type | description |
|---|---|---|
| block | uint256 | The block number of the transaction. |
| index | uint256 | The index of the event in the transaction. |
| timestamp | uint256 | The timestamp of the transaction. |
| transaction hash | bytes32 | The hash of the transaction. |
The following event is emitted by the market order:
/// @notice Emitted when a market order is executed.
event MarketOrder(
bytes32 indexed market,
address indexed taker,
uint256 got,
uint256 gave,
uint256 fee,
uint256 bounty,
uint256 fillVolume,
bool fillWants
);