Giter Site home page Giter Site logo

degens-mm's Introduction

Degens Market Maker

Setup

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_ME should 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.
    • reflectorUrl and reflectorApiKey: 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

Strategies

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 (ie betfair).
  • sport: The sport (ie Soccer).
  • league: The league (ie NFL).
  • marketType: The type of the market (1x2, spread, or total)

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 of 1.01 will apply a 1% markup, and 0.99 will apply a 1% discount.
  • oddsLimit: A limit on the odds that the bot will post. 1.5 or 3 mean the same thing: don't post odds less than 1.5 or 3 (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 to 0 to stop it from re-posting at all.

Custom modifiers

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;
},

Market type limits

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.

degens-mm's People

Contributors

fczs avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.