Market making funds¶
Here, we provide a step-by-step guide to create a market making fund and connect it to a bot running locally or on the cloud.
And if reading docs is not your thing checkout the demo video here: https://youtu.be/qLGCvsSx__U
- Python v3.8
- pip v20
- Create fund and set the delegate address for sending instructions
- Invest USDC in fund and have some SOL in delegate address
- Clone basic market making bot repo
- Set the bot on cloud and add in delegate address private keys
- Check the positions through manager dashboard and claim performance fee i.e $MNGO tokens
- Visit Investin dashboard and click on start fund
Select market making from type of fund selection and Add minimum deposit, performance fee % i.e.
(Share of $mngo accrued which goes to the manager as performance reward)and manager would earn the usual performance fees if the fund performance goes above the minimum return percentage.
Select the perp market, currently we have BTC-PERP & SOL-PERP
- After the fund is created, create a new wallet and set it as the delegate address using the manager dashboard (you can also use manager address with which fund was created)
- Fund the newly created address with $sol
Basic market making bot¶
- Clone repo: https://github.com/Investin-pro/mango-explorer/tree/investin_mm
- git checkout sol-perp
- Click open config button on dashboard page, copy it and paste in the cloned repo to the file: mainnet-investin.json
In the cloned repo terminal run the following commands and paste the private keys of delegate address or manager address. The private key should look something like this
touch id.json cat > id.json enter "your private key" press ctrl+D
Setup the marketmaking bot in a python virtualenv:
pip install virtualenv virtualenv venv virtualenv -p /usr/bin/python3 venv source venv/bin/activate pip install -r requirements.txt make sure to check python location by using (which python) and put that in place of /usr/bin/python3 sudo ln -s /usr/bin/python3 /usr/bin/pyston3
To run the marketmaking bot
./bin/marketmaker --name "Investin MM" --market SOL-PERP --oracle-provider pyth --existing-order-tolerance 0.0001 --pulse-interval 10 --order-type POST_ONLY --chain ratios --ratios-spread 0.006 --chain fixedpositionsize --fixedpositionsize-value 0.2 --cluster-name mainnet --cluster-url https://solana-api.projectserum.com --group-name mainnet.1 --id-file id.json --investin mainnet-investin.json
If the fund was created for btc-perp make sure to change the --market BTC-PERP and for sol-perp to SOL-PERP
If everything goes well you will see something like this on terminal
To estimate the APY for mango rewards earned by market making fund over a time period we use the following formula:
- T = time period
The performance fee is collected on all the mango rewards accrued by market making and is set by manager on fund creation. The same percentage is also used to collect performance fee if the USDC evaluation of fund goes above the minimum return percentage.
Have any doubts or stuck at any step please join our discord for assistance