How the Popberry Market Simulator Works
This simulator demonstrates various scenarios in a P2P market for
Popberries. Here's how it functions:
-
Order Generation: Every second, a new random order
(buy or sell) is generated with a quantity between 40 and 2000
Popberries, and a price between $3 and $10.
-
Sell Orders: When a sell order is generated, it's
added to the market and displayed in red in the transaction history.
-
Buy Orders: When a buy order is generated, the
system attempts to fulfill it immediately using available sell
orders.
-
Matching Process: The system tries to match buy
orders with sell orders, starting from the lowest priced sell order.
-
Full Match: If a buy order can be fully satisfied
at or below its specified price, the entire quantity is purchased,
and this is recorded in green in the transaction history.
-
Partial Match: If only part of the buy order can be
fulfilled (due to insufficient quantity at the desired price), a
partial purchase is made and recorded as such.
-
No Match: If no sell orders meet the buy order's
price, no transaction occurs, but the attempt is still recorded.
-
Average Price: For successful purchases, an average
price is calculated if multiple sell orders were used to fulfill the
buy order.
-
Market Update: After each transaction, the market
display is updated to show the current sell orders.
This simulation demonstrates key concepts of a P2P market including
price matching, partial fulfillment of orders, and the dynamic nature
of supply and demand.