Init submodules:
git submodule update --init
Install npm packages:
npm i
Create the DB:
sqlite3 mainnet.db < schema.sqlite3
Edit the etc/mainnet.js config file:
- Everywhere it says
REPLACE_MEshould be replaced with your own values:privateKey: Your private key as a hexadecimal number. This should map to an address that already has its token approved for trading on the degens contract.versionName: Your market maker bot's name, your company's name, or some other identifier for this connection to the order book.reflectorUrlandreflectorApiKey: If you would like to use our odds reflector, ask us for these values.
- Configure the order policies and the strategy search list (see below).
Run the bot:
node mm.js ./etc/mainnet.js ./mainnet.db
When figuring out what order to post, the bot will search through the list of strategies and pick the first one that matches various conditions:
oddsSource: The name of the odds source (iebetfair).sport: The sport (ieSoccer).league: The league (ieNFL).marketType: The type of the market (1x2,spread, ortotal)
The above can also be specified as arrays, to match multiple: league: ['NFL', 'NCAAF']
Or as functions, for example (v) => v === 'NFL' || v === 'NCAAF'
The matched strategy should also have various other parameters specified:
baseAmount: The size of orders to make, in token units (by default, DAI)markupMult: A multiplier to apply to the markup from the received odds. A markup of1.01will apply a 1% markup, and0.99will apply a 1% discount.oddsLimit: A limit on the odds that the bot will post.1.5or3mean the same thing: don't post odds less than1.5or3(decimal)maxPriceBand: Normally when the bot's order is totally filled, it will re-post an order at a higher price and smaller amount. This will limit how many times it does that. Set it to0to stop it from re-posting at all.
You can run custom code to modify your strategy by passing a function to the custom field.
For example, here is how to stop making orders an hour before kickoff:
custom: (strat, info) => {
if (info.timeToKickoff <= 60*60) strat.baseAmount = 0;
},
Often there are many different point spreads and totals available. If you prefer to not have markets up on all of them (maybe because the possible exposure per match would be too high), you can use marketTypeLimits to limit the number of markets to make per event.