Mean Finance allows users to exchange ERC20 tokens for others ERC20 tokens. In order to do so, users will need to create a Mean Finance position with the following properties:
From: ERC20 token to sell
To: ERC20 token to buy
Rate: amount of token "from" to swap for their "to" equivalent at the time of the swap
Amount of swaps: how many swaps to execute
Swap interval: daily, weekly, etc (check the section below for more information)
Let's go over an example to try to make things clearer. Let's say John has some DAI and he wants to buy WETH. He doesn't know how to time the market, so he wants to create a Mean Finance position. If he wanted to buy 5 DAI worth of WETH daily, for a year, his position would look like this:
Rate: 5 DAI
Amount of swaps: 365
Swap interval: daily
Now, when creating the position, John will need to deposit all necessary funds from the start. In his case, it would be 5 * 365 = 1825 DAI in total. On the other side, he won't need to deposit anything else or pay any gas fees when the swaps are executed every day. To learn more about fees, check the fees section.
As we just mentioned, users can create a position at any time. There are some other actions that they can perform on their positions:
Modify a position
Only the following properties can be modified:
Amount of swaps
Now, it's important to notice that when a position is modified, it could happen that more balance is required. For example, going back to John's position, if the amount of swaps was incremented by 10, then 50 more DAI would need to be deposited. By doing this, users can add more funds to their position when they want to.
Now, the opposite is also true. When the position is modified, if the amount of swaps is decremented by 20, then the John would get 100 DAI back.
When a swap is executed on a position, the remaining balance decreases and their swapped balance increases. Users can choose to withdraw their swapped balance at any point.
Terminate a position
Users can also choose to terminate their position at any point. When this happens, the position is destroyed, and all remaining and swapped balance is returned to the user.
Mean Finance positions are actually NFTs (ERC721). This means that positions can be transferred, as well as bought/sold. Now, the ERC721 standard also supports giving control over one's tokens to other addresses.
In the case of Mean Finance positions, the owner and all approved addresses can execute any of the actions listed above, so please be cautious when approving other addresses.
As we said before, users don't have to pay for their swaps to be executed. This is because they won't be executing them at all. Mean Finance tries to incentivize the involvement of a new actor, the market maker or "swapper". Mean Finance provides different incentives to swappers, so that they execute all swaps in all positions.
Since swaps are executed by these swappers, they can decide when to execute them. Let's try to explain this with John's position.
John had selected "daily" as his swap interval. This means that from 00 AM to 11.59 PM, his position can only be executed once. Once it is executed, it can't be executed again until 00 AM of the following day. The same thing happens with other intervals, such as weekly. Once a weekly position is executed, it can't be executed again until 00 AM the next Monday.
As we said before, there are different incentives in place that should encourage swappers to execute all swaps. Now, these incentives can be affected by different factors:
The general sentiment of the crypto market
The popularity/demand of the tokens involved in the swap
The volume of the tokens involved in the swap
So it could happen that certain positions are not swapped for extended periods of time. We call these "stale" positions. If this were to happen to your position, remember that fees are only charged on swaps (more on how fees work), so your balance remains unaffected.