Skip to content

trashpirate/betting-dapp-backend

Repository files navigation

Welcome to LICK Betting DApp - Backend 👋

Version Static Badge Static Badge Static Badge Documentation Maintenance License: MIT Twitter: N0_crypto

This is the first iteration of a DApp that allows users to place bets on future price movement using an ERC20 token. A betting round is initiated by an administrator in the backend who determines the round end date and the expiration of the betting period. At the beginning of each round the price of a specific token (defined in the backend) is locked and then compared to the price at the end of the round. Users can place bets while the betting period is open which typically ends 1 hour or more before the betting round.

The user can connect their wallets which directs them to the correct blockchain. By entering their bet amount and using the buttons "Bet UP" or "Bet Down", tokens are sent to two different wallets that hold the tokens for each bet decision. The wallets are owned and managed by the administrators. At the end of each round, the administrator calculates the payouts based on the bet amounts entered during the betting period and transfers the tokens back to the users. In future versions, this will be automated in the backend or possibly even replaced by a smart contract.

This repo represents the backend of the LICK Betting DApp and is NestJS API. The API handles the fetching of the token price using the CoinmarketCap API, starting, ending, and managing the betting rounds. It includes a websocket to push the token price to the frontend in a specified interval. With Swagger, the administrator can interact with the NestJS API to manage and view the betting rounds. In the future, this backend will either include a database to provide a more robust way to handle the betting rounds or a smart contract that handles the betting.

For this application to work you need also to install and run the frontend (NextJS/React): https://github.com/trashpirate/betting-dapp-frontend

Installation

$ npm install

Running the app

# development
$ npm run start:dev

# production mode
$ npm run start

Author

👤 Nadina Oates

🤝 Contributing

Contributions, issues and feature requests are welcome!

Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2023 Nadina Oates.

This project is MIT licensed.


This README was generated with ❤️ by readme-md-generator

About

Backend for PetLFG Betting Dapp

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published