DeFi Pooling overview

Terminology for DeFi Pooling on StarkEx

  • The Admin is an entity that registers new Rides and activates the operation required for the different phases of the DeFi Pooling flow.

  • An Investment token is a token type that a user invests in a DeFi strategy, i.e., the "payment".

  • A Ride ticket is a temporary intermediate token that the user buys with their Investment tokens in order to join a DeFi Pooling Ride. These tokens mediate between the Investment tokens and the Strategy tokens to coordinate multiple users to invest together in the same strategy.

  • A Strategy token is a token type that the user receives once invested in a DeFi strategy. This token represents the ownership of funds in the strategy. These funds are redeemable at any point in time using the on-chain strategy smart contract.

  • Passengers are off-chain users that have joined a Ride, i.e., signed the required transactions to participate in the Ride.

  • A Ride defines a specific on-chain strategy. A Ride consists of the following parameters:

    • an on-chain Pool Manager contract

    • an Investment token

    • a Strategy token

    • a Ride ticket token

    • The price and slippage for exchanging Strategy tokens for Investment tokens. The users can decide whether to join a Ride based on these parameters.

DeFi Pooling overviewA

System components

The StarkEx DeFi Pooling system consists of the following components:

off-chain and on-chain components

These include the StarkEx services, the StarkEx smart contract, and a STARK verifier smart contract. StarkEx does the following:

  • batches multiple DeFi Pooling operations from different users

  • updates the off-chain state

  • registers the new state on-chain along with a proof attesting to the validity of the new state

DeFi Pooling Operator

This component receives requests from users to join a specific Ride.

It manages the users' signed transactions and also matches and settles trades between users and the on-chain Pool Manager smart contract.

Pool Manager

A smart contract, on-chain component.

It executes the on-chain strategy for the pool of funds collected from the Ride passengers. This contract coordinates between the DeFi contract in order to execute the strategy, and the StarkEx contract, in order to exchange funds with the Ride passengers.

Flow phases

A DeFi Pooling flow proceeds in four phases:

  1. Register a new Ride

    A new Ride is configured to execute a specific strategy at a specific price.

  2. User onboarding

    Multiple users join a Ride by buying Ride tickets.

  3. Ride execution

    The on-chain Pool Manager smart contract withdraws the passengers' funds and trades them for Strategy tokens. The trade succeeds only if the trading price is lower or equal to the price defined at step 1.

  4. User offboarding

    Passengers trade their Ride ticket for Strategy tokens.

The following sections describe these four phases in detail, explain how to preserve self-custody of funds in this flow, and present how a user can exit a strategy they joined.