Commons Swarm Outcomes (1/3): A plug-and-play bonding curve

Commons Swarm work is coming to an end so it’s time to show off the outcomes of our last months of work. This is the first of a series of posts explaining the products that we have produced for 1hive’s future network of DAOs (aka Gardens):

I think the community is going to enjoy each one of these articles, so let’s start with the first one: The Augmented Bonding Curve.

Bonding curves previously in 1hive

1hive took Aragon Black Fundraising suite and transformed it into the Marketplace apps and a template previously known as Gardens (today we would be calling it Commons). The main differences between Aragon Black Fundraising and 1hive Marketplace suites were as follows:

  • The DAO template was simplified, so we did not have a board / beneficiary mulisig anymore, but a common pool governed with Conviction Voting.
  • We also removed the Tap app, a mechanism similar to the DAICO proposed by Vitalik. The common pool was funded instead using the bonding curve entry and exit tributes, as it was proposed by the Commons Stack model.
  • The batched bancor market maker was simplified to not require to wait for some blocks to be mined in order to perform a buy or a sell in the Bonding Curve. The new bancor market maker used the minReturn approach to prevent front running instead of the batched bonding curve method.

The 1hive Marketplace apps were composed of:

  • The Presale app, a fundraising app that can be used to bootstrap a DAO. It has the goal to reach a certain amount of funding in a specific period of time, and distribute the initial DAO tokens.
  • The Bancor Formula app, an external contract that encodes the mathematical functions to calculate the amount of tokens that can be bought or sold for a specific amount of collateral tokens.
  • The Bancor Market Maker app, an app connected to the Bancor Formula that mints/burns tokens based on the amount of funds that users deposits/withdraws from the reserve. It is also the piece of software that applies the entry and exit tributes.
  • The Marketplace Controller, an app that has permissions over the Presale and the Bancor Market Maker and is used as a Mediator to interact with them.

The template was tested by 1hive during a short period of time, but we pivoted to a simpler token policy DAO that used the Issuance app when 1hive was lauched to xDai. New 1hive Gardens will follow this simplified design by default as well.

This is not the case of the Token Engineering Commons Garden, which is following the Commons Stack original design of using an Augmented Bonding Curve along with Conviction Voting to govern the funds of the DAO. For making it possible we reused the work that 1hive did previously on the marketplace app.

Bonding curves with Commons Swarm

The marketplace apps still had to be used as a pack, since both Presale and Bancor Market Maker had Marketplace Controller as a dependency. This fact made the use of the individual apps difficult, so our work focused on decoupling those apps into:

  • The Hatch app (previously Presale): Now we can do a DAO fundraising without the need of installing a Bonding Curve. More on this on the second part of this series of articles.
  • The Augmented Bonding Curve app: A single app that has all the features of the previous marketplace bonding curve, but without the need of installing multiple apps. Thanks to that, now it is much much easier to install a Bonding Curve on a pre-existing DAO as it can be seen in the last section of this article.

We also adapted the Aragon Convert frontend, previously used by Aragon to convert ANT into ANJ and viceversa, to use the new non-batched bonding curve. You can find it under the name of TEC convert. It has the following features:

  • We generalized the frontend so now it can be used with any pair of tokens.
  • It now applies the entry and exit tributes to the predicted amount of returned tokens.
  • It fetches the reserve ratio, virtual balance and virtual supply from the smart contract, so you don’t have to.

With very little changes (some configurations and few images) this front-end can be used for any Garden that wants to use a bonding curve. An example of how it works can be seen at rinkeby.convert.tecommons.org.

How to install a Bonding Curve on an existing DAO

We can install the a Bonding Curve using the following steps:

  1. Install a vault that we will use as the reserve.
  2. Install an augmented-bonding-curve.open app with the following initialization parameters:
  3. Create the following Augmented Bonding Curve permissions:
    • MAKE_BUY_ORDER_ROLE granted to ANY_ENTITY
    • MAKE_SELL_ORDER_ROLE granted to ANY_ENTITY
    • MANAGE_COLLATERAL_TOKEN_ROLE granted to Voting
  4. Grant the following permissions to Augmented Bonding Curve:
    • Token Manager’s MINT_ROLE
    • Token Manager’s BURN_ROLE
    • New vault’s TRANSFER_ROLE
  5. Execute addCollateralToken with the following parameters to open trading:
    • Collateral token address
    • Virtual supply (can be set to 0)
    • Virtual balance (can be set to 0)
    • Reserve ratio (in PPM)

You can use the EVM-crispr terminal to encode all of those commands within the following script (look forward the third part of this series for more details):

connect <dao-addr> token-manager voting
install agent:reserve
install augmented-bonding-curve.open:abc token-manager <formula-addr> agent:reserve agent:0 <entry-tribute>e18 <exit-tribute>e18
grant ANY_ENTITY augmented-bonding-curve.open:abc MAKE_BUY_ORDER_ROLE voting
grant ANY_ENTITY augmented-bonding-curve.open:abc MAKE_SELL_ORDER_ROLE voting
grant voting augmented-bonding-curve.open:abc MANAGE_COLLATERAL_TOKEN_ROLE voting
grant augmented-bonding-curve.open:abc token-manager MINT_ROLE voting
grant augmented-bonding-curve.open:abc token-manager BURN_ROLE voting
grant augmented-bonding-curve.open:abc agent:reserve TRANSFER_ROLE voting
exec augmented-bonding-curve.open:abc addCollateralToken <collateral-addr> 1 0 <reserve-ratio>e6

Edit November 15th, 2021: This article has been updated for the newest version of the augmented bonding curve.

6 Likes

Thank you for taking the time to write this up. Really useful recap. Particularly appreciate the historical context :heart:

4 Likes

sem you’re the man I learn so much from these posts.

On behalf of future Gardens thanks for making all this work available and giving the documentation to implement.

3 Likes