Allo
Flow of Funds

Flow of Funds

While there is nuance in how pools get allocated by Strategies, there are generally four steps in the life cycle of a pool. Each step is invoked on Allo.sol, which calls the relevent method on the strategy.

Diagram of how funds flow through Allo

Creating a pool

The Allo core contract has two methods for creating a pool:

  1. The createPool (opens in a new tab) method
  2. The createPoolWithCustomStrategy (opens in a new tab) method

This first method for creating a pool creates a new pool by cloning an already deployed one. This makes it simple to make use of existing on-chain strategies. If you're using a custom or newly developed strategy, then you would deploy it to chain, and use the second method (createPoolWithCustomStrategy).

Some things to note:

  • Pools must be created by a Profile from the Registry
  • Pools can be created with an initial balance of 0 and funded later
  • By default, anyone can fund a pool

Funding a Pool

A pool can be funded when it is created and/or it can be funded afterwards. You can do either or you can do both. If funding the pool after creating it, then use

Pools can be funded with either native Ether or an ERC20 token. Note though that a pool can only distribute one token, which is determined when the pool is created. Trying to call fundPool with a token other than the one used when the pool was created will cause the method to revert with an error. **Pools should always be funded using the fundPool method and you should never transfer funds directly to Allo.sol

Once a pool has been funded, there is no way to withdraw funds from the pool bypassing the terms defined by the strategy. Strategies will have a withdraw (opens in a new tab) method, though conditions for its use will vary.

Some things to note:

  • The address that creates the pool doesn't have to be the one that funds it
  • Pools can only distribute one token (including native Ether)
  • Never directly transfer funds to Allo.sol

Allocating Funds

While strategies define the terms of allocation, the act of allocating is done through Allo.sol. This provides a consistent interface for use.

Some things to note:

  • Allocate can probably only be called by pool managers
  • Strategies can be simple or complex. You can read more about them here.

Distributing Funds

Again, strategies define the terms of distribution, but the method is invoked through Allo.sol. This provides a consistent interface for use.

Some things to note:

  • Distribute can probably only be called by pool managers
  • Allocation strategies are responsible for managing how a pool is distributed, not Allo.sol