DeFi Pooling overview

Decentralized finance (DeFi) holds the promise of democratizing financial services so that anyone with a smartphone can take part. However, to truly live up to its potential and accommodate smaller investors, fees must drop.

DeFi Pooling

While it is difficult to reduce the fees involved in processing a smart contract on an Ethereum blockchain, sharing those fees with others is a relatively trivial process. Fee sharing is well established within onchain liquidity pools. However, joining, leaving, and re-balancing a liquidity pool is still expensive, often prohibitively so.

Layer 2 (L2) transaction pooling enables sharing transaction costs across a larger group. By batching transaction requests, the pool of users can be significantly larger. This solution is known as DeFi Pooling. DeFi Pooling offers a new way to split the L1 bill and makes position re-balancing available on L2.

Terminology for DeFi Pooling on StarkEx

admin

An entity that registers new rides and activates the operation required for the different phases of the DeFi Pooling flow.

ride

A specific onchain strategy. A ride consists of the following parameters:

  • an onchain 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.

investment token

The type of token that a user invests in a DeFi strategy, that is, the token used to pay into the liquidity pool.

ride ticket

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.

strategy token

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 onchain strategy smart contract.

passengers

Offchain users that have joined a ride, that is, they have signed the required transactions to participate in the ride.

DeFi Pooling overviewA

System components

The StarkEx DeFi Pooling system consists of the following components:

offchain and onchain 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 offchain state

  • registers the new state onchain 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 onchain Pool Manager smart contract.

Pool manager

A smart contract, onchain component.

It executes the onchain 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 onchain 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.