Market Maker Modules

class markets.marketmaker.MarketMaker[source]

Specifies the actions each market maker should implement.

can_quote()[source]

Gets whether the market maker provides price quotes.

end_challenge(datum)[source]

Finalises a challenge given the current datum.

Treats the amounts in AccountBalance and MarketBalance as the number of shares owned for each Outcome. Rewards all players holding shares for winning outcomes (i.e. Results) with 1 credit, or substracts money in the case they have negative.

Iterates through all events in this market, gets the Result of the event, and rewards all players with a non-neutral position in the outcome with 1 credit for each share they possess. Finally, resets the market state.

order_placed(ord)[source]

Handles placing of an order by the user.

price_quote(ord)[source]

Gets a price quote for the given order.

reset_event(ev)[source]

Resets the market and account balances (amount of shares held) for each of this event’s outcomes.

Calls self.update_prices with the given event

reset_market(mkt)[source]

Resets the balances of all participants of the given market. Does so by calling self.reset_event for each event in the market.

To be used by implementing classes.

update_prices(ev)[source]

Updates the current price for each of the events’ outcomes, as well as the current ask and offer prices for it.

This method is called at the start of markets to initialise the market prices. It should be also used by implementing classes after handling both the order_placed and end_challenge events to update the price offers.