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
SQLite is file-based. Set DATABASE_PATH in /server/.env and the database file is created automatically.
make start-dev
bunx playwright install
Unit testing
bun run test:unit
E2E testing
bun run test:e2e
Unit testing
bun 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 |
DATABASE_PATH |
SQLite database file path | User-defined |
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. SQLite is used for persistence, so no external database service is required. 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
./serverfor Root Directory
-
bun install --frozen-lockfile; bun run buildfor Build Command -
bun run migration:runfor Pre-Deploy Command (Available in advanced settings) -
bun run start:prodfor 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
./interfacefor Root Directorybun install --frozen-lockfile; bun run buildfor Build Commandbuildfor 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 setting up an additional database service.
- Make sure you have
.envfile is configured properly. - Run
docker compose upinserverdirectory.
- 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",