User offboarding
Once the ride arrives at its destination, users can exchange their ride tickets for strategy tokens.
The admin informs the DeFi Pooling Operator when offboarding begins. In this phase, the Operator matches each user limit order against the Pool Manager limit order (Step 1 in diagram). There are two different scenarios here:
-
If the onchain trade succeeded, the user exchanges ride tickets for strategy tokens using the execution limit order (Step 2 in diagram).
-
If the onchain trade failed, the user exchanges the ride tickets for the original investment tokens using the cancellation limit order.
Once the settlements between the users and the Pool Manager are submitted to StarkEx, and the last state including them is approved onchain, offboarding is complete.
The final step is for the admin to call the ride Cleanup function in the Pool Manager smart contract. This function withdraws the ride ticket tokens and "burns" them (Step 3 in diagram).