Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: base setup for pip package #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
138 changes: 138 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/
127 changes: 84 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,62 @@
# Quadratic Funding
### Quadratic Funding

This is an open source implementation of quadratic funding or liberal radicalism, a design for philanthropic and publicly-funded seeding which allows for optimal provisioning of funds to an ecosystem of public goods.

This concept was adapted from [a paper](https://poseidon01.ssrn.com/delivery.php?ID=660029082067073116118109064122080113007059056088020045126118025097091089104095118005013117053102018063007119114004031115071017112038078013065115004125088127124090068088040053112098119108124088124100127091000084029019003094031089072104067086002002114101&EXT=pdf) written by Vitalik Buterin, Zoë Hitzig and Glen Weyl of liberal radicalism fame.

### Usage

# How it Works

#### Possible Parameters


| Parameter | Allowed Values | Mandatory | Default | Status |
|-----------------------------------------------------------------------------------|----------------------------|-----------|------------|--------|
| [positive_contributions](#positive_contributions) | `[<Contributions>]` | ✓ | | x |
| [type](#type) | `pairwise` \| `individual` | | `pairwise` | x |
| [threshold](#threshold) | `<Decimal>` | | `25.0` | x |
| [normalize_on_saturation](#normalize_on_saturation) | `True` \| `False` | | `False` | x |
| [cap_at](#cap_at) | `<Decimal>` | | `None` | x |
| [previous_round_contributions](#previous_round_contributions) | `[<Contributions>]` | | `None` | x |
| [previous_round_contributions_weightage](#previous_round_contributions_weightage) | `<Decimal>` | | `0.33` | x |
| [negative_contributions](#negative_contributions) | `[<Contributions>]` | | `None` | x |

###### positive_contributions

// Description + Format

###### type

// Description + Format

###### threshold

// Description + Format

###### normalize_on_saturation

// Description + Format

###### cap_at

// Description + Format

###### previous_round_contributions

// Description + Format

###### previous_round_contributions_weightage

// Description + Format

###### negative_contributions

// Description + Format




### How it Works

The idea of a quadratic voting system was the starting point for Gitcoin's funding open source experiment.

Expand All @@ -25,7 +76,7 @@ Using LR/CLR in open source ideally helps to prevent the "tragedy of the commons

LR puts an emphasis on the number of donations, rather than the size of the donation itself. This is the intended feature of the LR mechanism. Projects that can get more people to donate to them represent public goods that serve a larger public, so the tragedy of the commons problem is more severe, and hence, contributions to them should be multiplied more to compensate.

# Problems Observed (Rounds 1 & 2)
### Problems Observed (Rounds 1 & 2)

Sybil resistance: We know that grants which receive many small contributions result in a larger "top-off" value from the benefactor, incentivizing an attack vector to create multiple dummy accounts to try to confuse the system.

Expand All @@ -35,7 +86,7 @@ Reliance on philanthropists: In practice, CLR still suffers from reliance on a b

Prior knowledge: One of the drawbacks of this entire experiment is the fact that once the mechanism is known, people will know how to game it.

# Pairwise Mechanism (DRAFT)
### Pairwise Mechanism (DRAFT)

BENEFITS OF PAIRWISE
number of donations matters more
Expand All @@ -52,59 +103,49 @@ collusion with pairs is much easier to find (you can use something like time, da

HOW DID PAIRWISE ALLEVIATE ROUND 1 & 2 PROBLEMS?

# Problems Observed (Round 3-5)
### Problems Observed (Round 3-5)

Identity:

Saturation of the round:

Discoverability of new grants:

# Further Development

# Additional Reading

Foundations:

[Standard Bounties Contract](https://github.com/Bounties-Network/StandardBounties)

[EIP-1337](https://github.com/ethereum/EIPs/pull/1337)

[Gitcoin Grants](https://github.com/gitcoinco/grants1337)

Research Papers:

[Liberalism Radicalism: A Flexible Design For Philanthropic Matching Funds](https://poseidon01.ssrn.com/delivery.php?ID=660029082067073116118109064122080113007059056088020045126118025097091089104095118005013117053102018063007119114004031115071017112038078013065115004125088127124090068088040053112098119108124088124100127091000084029019003094031089072104067086002002114101&EXT=pdf)

[Pairwise Coordination - A New Quadratic Funding Design](https://ethresear.ch/t/pairwise-coordination-subsidies-a-new-quadratic-funding-design/5553/9)

[Minimal Anti-Collusion Infrastructure](https://ethresear.ch/t/minimal-anti-collusion-infrastructure/5413/2)

Blog Posts:

[Gitcoin Grants: Q1 Match + 2020 Roadmap](https://gitcoin.co/blog/gitcoin-grants-2020/)

[Gitcoin Grants](https://gitcoin.co/blog/gitcoin-grants/)
### Further Development

[Experiments with Liberal Radicalism](https://gitcoin.co/blog/experiments-with-liberal-radicalism/)
[Gitcoin Grants: CLR Matching](https://gitcoin.co/blog/gitcoin-grants-clr-matching/)
### Additional Reading

[Radical Results: Gitcoin's $25K Match](https://gitcoin.co/blog/radical-results-gitcoins-25k-match/)
**Foundations**

[Gitcoin Grants: $50K Open Source Fund](https://gitcoin.co/blog/gitcoin-grants-50k-open-source-fund/)
- [Standard Bounties Contract](https://github.com/Bounties-Network/StandardBounties)
- [EIP-1337](https://github.com/ethereum/EIPs/pull/1337)
- [Gitcoin Grants](https://github.com/gitcoinco/grants1337)

[Gitcoin’s Q3 Match: $100K+ to OSS projects](https://gitcoin.co/blog/gitcoins-q3-match-100k-to-oss-projects/)
**Research Papers**

[Gitcoin's Q3 Match The Radical Results](https://gitcoin.co/blog/gitcoins-q3-match/)
- [Liberalism Radicalism: A Flexible Design For Philanthropic Matching Funds](https://poseidon01.ssrn.com/delivery.php?ID=660029082067073116118109064122080113007059056088020045126118025097091089104095118005013117053102018063007119114004031115071017112038078013065115004125088127124090068088040053112098119108124088124100127091000084029019003094031089072104067086002002114101&EXT=pdf)
- [Pairwise Coordination - A New Quadratic Funding Design](https://ethresear.ch/t/pairwise-coordination-subsidies-a-new-quadratic-funding-design/5553/9)
- [Minimal Anti-Collusion Infrastructure](https://ethresear.ch/t/minimal-anti-collusion-infrastructure/5413/2)

[Gitcoin Grants Round 4 Results](https://gitcoin.co/blog/gitcoin-grants-round-4/)
[
Gitcoin Grants Round 5: Funding Our Future](https://gitcoin.co/blog/gitcoin-grants-round-5-funding-our-future/)
**Blog Posts**

[Gitcoin Grants Round 6](https://gitcoin.co/blog/gitcoin-grants-round-6/)
- [Gitcoin Grants: Q1 Match + 2020 Roadmap](https://gitcoin.co/blog/gitcoin-grants-2020/)
- [Gitcoin Grants](https://gitcoin.co/blog/gitcoin-grants/)
- [Experiments with Liberal Radicalism](https://gitcoin.co/blog/experiments-with-liberal-radicalism/)
- [Gitcoin Grants: CLR Matching](https://gitcoin.co/blog/gitcoin-grants-clr-matching/)
- [Radical Results: Gitcoin's $25K Match](https://gitcoin.co/blog/radical-results-gitcoins-25k-match/)
- [Gitcoin Grants: $50K Open Source Fund](https://gitcoin.co/blog/gitcoin-grants-50k-open-source-fund/)
- [Gitcoin’s Q3 Match: $100K+ to OSS projects](https://gitcoin.co/blog/gitcoins-q3-match-100k-to-oss-projects/)
- [Gitcoin's Q3 Match The Radical Results](https://gitcoin.co/blog/gitcoins-q3-match/)
- [Gitcoin Grants Round 4 Results](https://gitcoin.co/blog/gitcoin-grants-round-4/)
- [Gitcoin Grants Round 5: Funding Our Future](https://gitcoin.co/blog/gitcoin-grants-round-5-funding-our-future/)
- [Gitcoin Grants Round 6](https://gitcoin.co/blog/gitcoin-grants-round-6/)
- [Vitalik's Blog - Review of Gitcoin Quadratic Funding Round 3](https://vitalik.ca/general/2019/10/24/gitcoin.html)
- [Vitalik's Blog - Review of Gitcoin Quadratic Funding Round 4](https://vitalik.ca/general/2020/01/28/round4.html)
- [Vitalik's Blog - Gitcoin Grants Round 5 Retrospective](https://vitalik.ca/general/2020/04/30/round5.html)

[Vitalik's Blog - Review of Gitcoin Quadratic Funding Round 3](https://vitalik.ca/general/2019/10/24/gitcoin.html)

[Vitalik's Blog - Review of Gitcoin Quadratic Funding Round 4](https://vitalik.ca/general/2020/01/28/round4.html)
### Licenses

[Vitalik's Blog - Gitcoin Grants Round 5 Retrospective](https://vitalik.ca/general/2020/04/30/round5.html)
- [Code - GNU AFFERO GENERAL PUBLIC LICENSE](../LICENSE)
- [Creative assets -- Attribution-NonCommercial-NoDerivatives 4.0 International](../app/assets/LICENSE.txt)
1 change: 0 additions & 1 deletion quadratic-funding/__init.py__

This file was deleted.

2 changes: 2 additions & 0 deletions quadratic_funding/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def calculate():
return (u'derp package works')
Empty file.
8 changes: 8 additions & 0 deletions quadratic_funding/tests/test_calculate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from unittest import TestCase

import quadratic_funding

class TestCalculate(TestCase):
def test_is_string(self):
s = quadratic_funding.calculate()
self.assertTrue(isinstance(s, str))
8 changes: 5 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,21 @@
long_description = fh.read()

setuptools.setup(
name='quadratic-funding',
name='quadratic_funding',
version='0.0.1',
author='Frank Chen, Aditya Anand Michael Chelliah, Kevin Owocki',
author_email='team@gitcoin.co',
description='This is the open source quadratic funding implementation found on gitcoin.co/grants.',
long_description='This is an open source implementation of quadratic funding, a design for philanthropic and publicly-funded seeding, which allows for optimal provisioning of funds to an ecosystem of public goods. You can find the live product implementation at gitcoin.co/grants',
long_description_content_type='text/markdown',
url='insert github link',
url='https://github.com/gitcoinco/quadratic-funding',
packages=setuptools.find_packages(),
classifiers=[
'Programming Language :: Python :: 3',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
],
python_requires='>=3.6'
python_requires='>=3.6',
test_suite='nose.collector',
tests_require=['nose']
)