WARNING: This is highly alpha code. Do not use it or you will lose all your money. We'd like to thank Little creatures for being the first company to test Mr. Market and for helping with QA.
Mr Market is a CeFi crypto bot and the reference exchange oracle for Hu Fi. Mr Market has three main functions
- An automated crypto bot that supports a variety of strategies for arbitrage across CeFi exchanges.
- What is Hu-Fi
- A front end where users can contribute funds to increase the ability to do Hu Fi market making.
Install dependencies
make install
If you don't have Postgres installed, run it simply with docker.
make start-server-db
make start-dev
npx playwright install
Unit testing
yarn test:unit
E2E testing
yarn test:e2e
Unit testing
yarn test
First, ensure you have the following environment variables ready. These are crucial for the configuration of the server and interface.
Variable | Description | Source |
---|---|---|
ADMIN_PASSWORD |
Admin page password | User-defined |
JWT_SECRET |
JWT secret key (32 bit) | User-defined |
COINGECKO_API_KEY |
Coingecko API key | Coingecko |
POSTGRES_HOST |
DB Host Name | Postgres Database |
POSTGRES_USER |
DB User Name | Postgres Database |
POSTGRES_PASSWORD |
DB Password | Postgres Database |
POSTGRES_DATABASE |
DB Name | Postgres Database |
POSTGRES_PORT |
DB Port (Usually 5432) | Postgres Database |
POSTGRES_SSL |
DB SSL Connnection (Usually true) | Postgres Database |
MIXIN_APP_ID |
Mixin App ID | Mixin Developer Dashboard |
MIXIN_SESSION_ID |
Mixin Session ID | Mixin Developer Dashboard |
MIXIN_SERVER_PUBLIC_KEY |
Mixin Server Public key | Mixin Developer Dashboard |
MIXIN_SESSION_PRIVATE_KEY |
Mixin Session Private key | Mixin Developer Dashboard |
MIXIN_SPEND_PRIVATE_KEY |
Mixin Spend Private key | Mixin Developer Dashboard |
MIXIN_OAUTH_SECRET |
Mixin Oauth Secret | Mixin Developer Dashboard |
BINANCE_API_KEY |
Binance Account API Key | Binance Account Settings |
BINANCE_SECRET |
Binance Account API Secret | Binance Account Settings |
Refer to ./server/.env.example
to enable more exchanges for strategies.
Variable | Description | Source |
---|---|---|
PUBLIC_BOT_ID |
Mixin App ID | Mixin Developer Dashboard |
PUBLIC_HUFI_SOCKET_URL |
Server deployment URL | Server Hosting Platform |
PUBLIC_HUFI_BACKEND_URL |
Server deployment URL | Server Hosting Platform |
Variables starting with MIXIN
are obtained from the Mixin bot keystore, accessible on the Mixin developer dashboard by creating a new bot.
This guide will walk you through the process of deploying a server, and an interface on Render for our application. We highly recommend using Postgres DB instance from Render since this guide is basically using Render as hosting service, but it's totally up to you if you pick another Postgres DB server. By the end of these steps, you will have a fully functional server and interface setup.
-
Deploy Server on Render
-
Login to the Render, and create a new web service. Connect the github repo, and adjust the environment variables.
-
Use
./server
for Root Directoryyarn install; yarn build;
for Build Commandyarn migration:run
for Pre-Deploy Command (Available in advanced settings)yarn start:prod
for Start Command
-
-
Deploy Interface on Render
-
Login to the Render, and create a new static site. Connect the github repo, and adjust the environment variables.
-
Use
./interface
for Root Directoryyarn --frozen-lockfile install; yarn build
for Build Commandbuild
for Publish Directory
-
Setup Redirect & Rewrite Rules as follows.
Source Destination Action /(.*) /app.html Redirect
-
-
Deploy Server
If you have docker installed on your server, it's much easier to run the Mr.Market server without much setting up additional DB instance.
- Make sure you have
.env
file is configured properly. - Run
docker compose up
inserver
directory.
- Make sure you have
-
Deploy Interface
We do not docker deployment for Mr.Market interface.
If you encounter issues during the deployment, check the following:
- Ensure all environment variables are correctly set.
- Verify that your Render account is active and in good standing.
- Consult the Render documentation for detailed troubleshooting steps.
This project is licensed under the GNU Affero General Public License - see the LICENSE.md file for details
"Data provided by CoinGecko",