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:
Buy X ride tickets for X investment tokens.
As per (1) in the diagram, this will allow Bob to invest X investment tokens.
In the case that the ride is canceled, the user buys back X investment tokens by returning X ride tickets.
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 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.