HOUSE MATRIX

Inspiration

The mere idea of having provable random numbers and public records on blockchain has inspired us to create a casino that is not suspicious. Although other casinos allow users to use cryptocurrencies, they are not based in smart contracts which means the algorithm is opaque to players.

Our casino has the potential to disrupt the industry since its the first one to allow users to either be part of the house or bet against it.

We also want to introduce a social betting strategy where players can bet against each other and not against the house.

We are also planning to donate a big part of the generated revenue to charity projects dedicated to help people with gambling addictions.

What it does

Our casino is fully decentralized and integrated with the blockchain allowing everyone to become a part of the House. The revenue is split in the following manner: 70% goes to the liquidity providers and 30% goes to maintenance, governance and HMX stakers. This is accomplished by our two token model: HMX (our governance token) and HLP (our liquidity token). The HMX is not fully implemented by now.

At this moment, we have implemented only one game: American Roulette.

When a Staker wants to reclaim the funds, the reclaimed amount is subtracted from balance and placed into the Vault for 20 days. Every fraction of time a part of the amount is freed and can be redeemed.

How we built it

In our project we are using cutting edge technology like Ethereum Improvement Proposal:2535. Which is called Diamond: Multi-Facet Proxy. We have created a modular smart contract system that can be extended and updated after deployment without changing the main deployment address. The function names for the modules are self explanatory.

Functional facets

Facet : PlayersFacet
  1. checkPlayerBalance()
  2. depositToCashier()
  3. withdrawPlayerBalance()
  4. withdrawPlayerBalanceAmount(uint256)
Facet : StakerFacet
  1. checkStakerBalance()
  2. getHLPTokenAddress()
  3. reclaimHLP(uint256)
  4. setHLPTokenAddress(address)
  5. stakeETH()
Facet : AdminFacet
  1. checkPlatformBalance()
  2. isContractOwner()
  3. withdrawAllPlatformFunds()
Facet : RouletteFacet

Controls the game and VRF responses.

  1. getReqID()
  2. getRnd()
  3. placeBet((uint256,uint8,uint8)[],uint256)
  4. rawFulfillRandomWords(uint256,uint256[])
  5. testFulfillRandomWords(uint256,uint256[])
  6. testGetAmounts()
Facet : VaultFacet

Used to control reclaiming and redeeming staked funds.

  1. getVaultState()
  2. redeemFromVault()

Tech stack

Our js frontend framework of choice is React paired with Tailwindcss. However, to build out the roulette, we used Phaser 3 which is a javascript framework to build online games. For the backend, we used Solidity to write the smart contracts and the Hardhat framework for compiling, testing and deploying. As mentioned earlier, we have also implemented the Diamond library to enhance scalability and enable updates

Challenges we ran into

Our first challenge was choosing a correct blockchain testnet as we run into issues while trying to make the VRF service work. Also on testnet, Automation is not working, so it was a challenge to find a right combination of parameters to make VRF callback work. Last but not least, building and coordinating the team was a big challenge since our project is far from trivial. But everyone had his particular role and the tasks were perfectly distributed.

Accomplishments that we're proud of

Learning the Diamond model, which is a concept that is not quick&easy to grasp and put into use in a fast paced development environment. The aesthetic and feel of the roulette, although is not perfect, is something we are really proud of.

What we learned

The Diamond Storage library. Using the ChainLink VRF service. Using the ChainLink datafeeds. The Phaser 3 framework.

What's next for HOUSE MATRIX

We plan to add more games such as poker, blackjack and slots.

We plan to implement a sportsbook which will be powered by Chainlink data feeds to provide all of the required data to operate. We plan to implement social betting using ChainLink data feeds.

We plan to introduce a multi asset liquidity index consisting of BTC, ETH, USDC, USDT, FRAX Liquidity providers can provide any of the index assets to earn 70% of protocol revenue. Users can place bets in any of the five index supported assets.

We plan to add staking functionality to our governance token (HMX). HMX stakers will earn 30% of protocol revenue.

We plan to integrate Chainlink Automation to rebalance the house liquidity pool. We plan to integrate Any API via Chainlink for necessary data requirements.

Further down the road, House Matrix has plans to give control of the protocol to the community as we will become a DAO.

Built With

+ 7 more
Share this project:

Updates