Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Copy/Paste Error on maker.py L92 #9

Open
zzeleznick opened this issue Dec 9, 2017 · 0 comments
Open

[Bug] Copy/Paste Error on maker.py L92 #9

zzeleznick opened this issue Dec 9, 2017 · 0 comments

Comments

@zzeleznick
Copy link

I was reading through the source code for the maker bot, and it seems as though there was a line copied without replacing the variable name. See L92.

    # Create sell orders
    for sellordernr in range(1,sellOrdersToPlace+1):
        price = midmarket + sellordernr * midmarket * marginfactor
        amount = sellVolumeToPlace / sellOrdersToPlace
        ...

    # Create buy orders
    for sellordernr in range(1,sellOrdersToPlace+1):
        price = midmarket - sellordernr * midmarket * marginfactor
        amount = float(buyVolumeToPlace) / float(price) / float(buyOrdersToPlace)
        ...

Suggested fix:

L92-93
-    for sellordernr in range(1,sellOrdersToPlace+1):
-        price = midmarket - sellordernr * midmarket * marginfactor
+    for buyordernr in range(1,buyOrdersToPlace+1):
+        price = midmarket - buyordernr * midmarket * marginfactor

Compare to maker.js

  for (let i = 0; i < sellOrdersToPlace; i += 1) {
    const price = midMarket + ((i + 1) * midMarket * 0.05);
    const amount = service.toEth(sellVolumeToPlace / sellOrdersToPlace, token.decimals);
   ...
  for (let i = 0; i < buyOrdersToPlace; i += 1) {
    const price = midMarket - ((i + 1) * midMarket * 0.05);
    const amount = service.toEth(buyVolumeToPlace / price / buyOrdersToPlace, token.decimals);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant