Coder Social home page Coder Social logo

stevennevins / house-protocol Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 5.0 1.72 MB

A permission-less peer-to-pool open source betting protocol

JavaScript 84.75% Solidity 12.48% Shell 0.05% HTML 1.13% CSS 1.58%
testnet-eth buidler frontend eth solidity chainlink chainlink-vrf link

house-protocol's Introduction

Quickstart - Overview

Demo: Netlify App

House Protocol is a peer-to-pool protocol built on Ethereum and Chainlink. House protocol has 3 types of participants: Players, Dealers (HDealer), and Bankroll Liquidity Providers (HPools & HTokens). Players place bets in ERC20 tokens through an HDealer which commits the bet, routes the commitment to the appropriate HPool, and resolves the result of the reveal. The HDealer that routes the bet shares the House edge 50:50 with the HPool. Liquidity Providers contribute collateral ERC20 tokens to an HPool and are issued HTokens for their collateral, which represent their share of the Bankroll for the ERC20 token contributed. Interest accumulates in real-time as bets are routed/resolved by HDealers and placed against the collateral in HPools.

Tl;dr:

  1. Imagine a casino accepting any ERC20 as a bet

  2. Anyone can swap in or out of an HPool to earn a share of house edge from their collateral

  3. All dealers share the same bankrolls and mutually benefit from their growth

  4. Anyone who can capture a niche of player experience can deploy an HDealer from the HDealerFactory and earn revenue without having to take on the risk of raising and securing a bankroll

Quickstart - Frontend

git clone https://github.com/dmintercept/house-protocol.git 

cd house-protocol 

You might want to use tmux to manage the active terminal windows

yarn install

you might get node-gyp errors, ignore them and run:

yarn start
  1. Play

    • Get link from faucet
    • Get Kovan Eth from a faucet
    • Get wBTC on Kovan from Compound faucet
    • Approve the HDealer as a spender of Link
    • Approve the HPool as spender of the ERC20 token
    • Place a bet greater than 10000 wei (this is for precision)
    • Edge is deducted from winning bets and given to HPool and HDealer (Can be 0)
  2. Deal

    • Deploy your own HDealer
    • Fork frontend and modify to capture your player niche
    • Earn 50% of the edge on bets that flow through your HDealer
  3. Earn

    • Approve HPool as spender of collateral
    • Swap in an out of the pool
    • Earn your share of 50% of the edge that flow through the HPool

Quickstart - Deploy your own

First you will need a buidler account to deploy from

yarn run generate

Once you have your deployer account you will need to get some Kovan Eth : https://faucet.kovan.network/

Once you have Kovan eth in your deployer account you are ready to deploy the contracts

Navigate to the scripts directory in the builder package:

house-protocol/buidler/scripts

Edit the deploy script to deploy either part or all of the protocol.

If you want your own copy of the protocol to play around with you will need to add a line in the deploy script for each of the following:

  • HDealerFactory.sol
  • HPoolFactory.sol
  • HDealer.sol
  • HPool.sol

The deploy script will compile, deploy, and publish the contract info into the react application

in a third terminal window:

yarn deploy

house-protocol's People

Stargazers

 avatar  avatar  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.