- JavaScript 76.8%
- Pug 14.9%
- SCSS 6.1%
- Shell 1.3%
- Dockerfile 0.5%
- Other 0.4%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .meteor | ||
| client | ||
| graphics | ||
| i18n | ||
| imports | ||
| private | ||
| public | ||
| server | ||
| tests | ||
| .dockerignore | ||
| .gitignore | ||
| AppVersion.version | ||
| build-docker.sh | ||
| CHANGELOG.md | ||
| collections.js | ||
| Dockerfile | ||
| entrypoint.sh | ||
| LICENCE | ||
| package-lock.json | ||
| package.json | ||
| project-tap.i18n | ||
| README.md | ||
| scss-config.json | ||
| settings.json | ||
Predi predictionmarket
This is Predi, a reactive web app for running prediction markets.
Predi is an application that runs partly on the serverside and partly in the browser. Everything is reactive, so that any changes are reflected in all connected clients without the user having to update.
It is using Robert Hanson's lmsr market maker to compute prices for contracts.
Predi can simultaniously host several markets. Each market is its own economy,
and can contain several Contract sets. A contract set is a topic on which a
prediction is made.
A contract set is either a vote share contract set or a probabillity
contract set. A vote share contract set can have many contracts whose prices
will sum up to 100%. When a user buys shares in one contract, its price will
increase and the other contracts in the set will decrease. Selling will have the
opposite effect. It is also possible for users to short sell contracts. This
will freeze a settable (by the administrator) amount of money per share from
that user untill he buys back the shares or the market is settled. Freezing 100
credits per shorted share means no risk for the bank at the cost of reducing the
market liquidity and creating a upward pressure on the prices. This is to avoid
the bank ending up owing money after settling the market.
A probabillity contract set only have one contract whose price is somewhere
between 0 and 100. They are of the form "How likely is it that x will happen".
Technically a probabillity contract set is the same as a vote share set with two
contracts, but one of the contracts are always hidden from view.
Markets and users have tags. Any user that have a tag matching a market is given access to that market. When a match is first created (adding a tag to a user or a market), all affected users are given starting funds. The amont of funds given is configurable per market.
Predi is built using the Meteor framework.
Development
Install Meteor, clone Predi and run meteor in the root folder of the cloned
app. Then open http://localhost:3000 in a browser. A development database will
be created, and when you first open the app in a browser you will be asked to
create an administrator account, and whether you want some test market data to
be generated. Changes to the code will be immediatly reflected in the brower as
long as meteor is running.
Deployment
The recomended way to deploy Predi is using Docker. You can build a Docker
container using the build-docker.sh script at the root of the project. The
resulting container will need a MonogDB container running along side it.
You should also map out /home/meteor/images to a folder on the docker host to
persist uploaded images.