To enable the Ride, the Admin calls the Pool Manager smart contract to mint and sell ride tickets.
When a user joins a DeFi Pooling Ride, they sign three different limit orders in advance. The DeFi Pooling Operator stores these:
Limit Order 1
Buy X Ride tickets for X Investment tokens.
As per (1) in the diagram, this will allow Bob to invest X Investment tokens.
Limit Order 2
In the case that the Ride is canceled, the user buys back X Investment tokens by returning X Ride tickets.
Limit Order 3
In the case that the Ride arrives at the destination, the user buys Y Strategy tokens for X Ride tickets. The ratio between Y and X is set according to the price and slippage parameters that were configured in the Ride registration.
As per (2) in the diagram, this completes Bob's signed limit orders.
The Operator Onboards the Users
The Admin activates the onboarding phase of the DeFi Pooling Operator. In this phase, it matches the user's first limit order (to buy Ride tickets) to the on-chain limit order that is selling tickets. This order was submitted in advance by the Pool Manager smart contract in the registration phase.
As per (3) in the diagram, the relevant orders are matched.
Multiple other users join the Ride, where each may buy a different amount of uniformly-priced tickets.