Coder Social home page Coder Social logo

predictionmarketcentralized's Introduction

This is going to be a proof of concept for my prediction market technology that I hope to implement in a decentralized setting in the future.

The core priniciple is that contracts are tokens who represent a value if a condition is met and no value if it is not. It is easiest to determine this number to be 1. The easiest example is to think of a token having a value one if a coin is heads and zero if it is tails.

Contracts sets can be formed where the set of contracts are mutually exclusive and cover the complete set of outcomes. In the example this would amount to a set of contracts where one represents heads and one represents tails.

These contracts can be traded in a system that uses liquidity pools driven by an automated market maker. I chose to use the constant product market maker where x*y=k.

Each market offers a swap between a reserve currency and whatever contract that market supports. This means that you could swap a reserve currency and receive either a head or tails contract token or swap a head or tails contract token and receive the reserve currency.

In order to be able to redeem all contracts, there must be enough reserve in the overall market. We must have a backing fund that is used for redeeming validated contracts. This means that once the event has taken place and the outcome has been determined, we need to guarantee that there will be enough reserve currency to redeem the valid contracts.

Because of the nature of the contract sets the market also supports buying or selling complete contracts sets for a value of one. The funds are added or subtracted from the backing fund to allow for this. This means that a user could buy or sell both a heads and tails token and it would always be worth one unit of reserve currency.

When a swap is made in one of the markets composing a set, this leaves the overall set unbalanced because the value of all the contracts in the set is not equal to one. Therefore, there is a number of contracts that can bought or sold and a set and sold or bought from individual markets, respectively.

Impermanent loss leads to the loss of value from a market using the liquidity pool structure if left unchecked. The market must itself perform the second level market making that occurs when a swap is made in an individual market and use some of these profits to make sure that the set is sufficiently backed and return the rest to the participant.

Liquidity can be provided to allow the market pools to grow which allows for lower price slippage. To do this a participant provides an equal ratio of the contract and the reserve.

Because of impermanent loss, the liquidity provider opens themselves up to almost complete losses which is unexpected for many. Single sided liquidity provided allows for market participants to provide only the contracts that they have accumulated and the correct amount of reserve is taken from backing and added as liquidity.

predictionmarketcentralized's People

Contributors

kyscott18 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.