Standalone
Quadratic Public Goods
Part II
Quadratic Funding
Beyond decision-making in governance, quadratic relationships can also help democratize crowdfunding.
Consider a crowdfunding system that wishes to support a set of projects. In this system, there are two parties:
Participants: Individuals who contribute funds to their preferred projects.
Sponsor: An organization, or coalition of organizations, that wishes to deploy capital to support the set of projects, but wish to delegate the decision-making process to the participants.
Typically, in sponsor-backed crowdfunding systems, participants signal their preferences through individual contributions. Then, based on the distribution of these contributions, sponsors allocate a matching amount to each project. There are good reasons for sponsors to delegate decision-making. For example, sponsors may simply want to support a general ecosystem, but do not know the best way to distribute capital. By delegating decision-making to a decentralized market process, sponsors might be able to better maximize public utility.
Linear Funding
In a naive crowdfunding system, matching funds can be distributed with the same ratio as participant contribution. Consider the following example.
Participant | Preferred Project | Contribution |
1 | Project #1 | $1600 |
2 | Project #2 | $400 |
3 | Project #3 | $400 |
In this scenario, Project #1 raises $1600 from participants, while Project #2 raises $800. Say the sponsor wishes to allocate an additional $3000, it will grant $2000 to Project #1 and $1000 to Project #2.
However, under economic theory, this system is not optimal. The proof of why is quite mathematical, but the intuition is simple: the distribution of participant contribution merely signals the maximization of each individual's utility. It does not necessarily consider the collective utility of the group. This is a problem inherent to funding public goods.
Quadratic Funding
Quadratic funding is a mechanism that aims to help sponsors better allocate their funds to public goods. The mechanism is based on a quadratic formula that mathematically maximizes collective benefit. We say mathematical because the claim is based of an economic model. The mechanism, albeit simplified, is as follows.
The next part will use a little mathematical notation. If you dislike mathematical notation, you can also refer to the example further below.
A sponsor allocates some amount of funds #lang:latex#F, to be distributed among a set of projects.
Participants contribute funds to their preferred projects. Let be the contribution of participant to project .
Let be the sum of square roots of contributions to project . Specifically, . We will refer to as the matching power of project .
Let the sum of matching powers be the total matching power.
The sponsor then distributes its funds to each project according to the following formula: .
Let us use our earlier example of Project #1 and Project #2 to illustrate this mechanism.
The sponsor allocates $3000 to distribute to the two projects.
Participant 1 contribute $1600 to Project #1. Participants 2 and 3 contributes $400 to Project #2 each.
The matching power of Project #1 is given by .
The matching power of Project #2 isSince the two projects have equal matching power, the sponsor will distribute $1500 to each project.
Finally, Project 1 raises $3100 in total while Project 2 raises $2300. As we can see, similar to quadratic voting, quadratic funding systems tend to back projects that have broader support from the masses.
Village Funding
Our village now wants a quadratic funding system to support their grassroot projects. The system can be broken into three phases.
Setup Phase.
The village fund is deployed with some ETH. This fund wants to support some given projects (each represented by anaddress
).Contribution Phase.
Villagers can then donate to their preferred projects. Each villager can donate multiple times, but only once per project.Distribution Phase.
After the funding period ends, donations will be closed and funds can be finalized (using quadratic funding). Once finalized, projects will then be able to claim their funds.
All contributions must be made before the funding period ends (7 days).
VillageFunding.sol
In the contracts/
folder, you will find a contract called VillageFunding
. The contract is responsible for the quadratic funding system and supports the following ABI.
Function | Description |
| Initializes a new |
| A function that villagers call to donate ETH to a certain project. The function should be called before the contribution phase ends (7 days). Villagers can only donate to each project once. |
| Finalize funds raised by each project. This is only callable after the contribution phase ends (7 days). |
| Projects call this function to withdraw their raised funds. If funds have not been finalized or |
View Function | Description |
| Returns the addresses of the projects raising funds. |
| The final amount of funds eligible to a given project. Returns 0 if funds are not finalized yet or if funds already claimed. |
The detailed interface can be found in interfaces/IVillageFunding.sol
.
Notes
The contribution phase will last 7 days.
Square root calculation should be rounded down to the nearest integer.
Your Task
Implement all the functions listed above in contracts/VillageFunding.sol
.
Run tests in Questplay
Submit work in Questplay
Now a decision has been made, it’s time to figure out a way to fund the repairs…