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

Optimize the min volume settings. #898

Merged
merged 3 commits into from
Apr 12, 2021
Merged

Optimize the min volume settings. #898

merged 3 commits into from
Apr 12, 2021

Conversation

artemii235
Copy link
Member

@artemii235 artemii235 commented Apr 9, 2021

There are few important changes:

  1. All UTXO coins (except BTC) now have 10 x dust min trading vol. BTC still has 0.00777.
  2. ETH/ERC20/QRC20 have a min trading vol equal to 1 / 10 ^ (decimals / 3). So if a token has 6 decimals its min trading vol will be 1 / 10 ^ 2 = 0.01.
  3. Added min_trading_vol RPC for GUIs.
  4. buy/sell/setprice take min volume of rel coin into account. If KMD is sold for DOGE like here set min_volume to dust in orders #849 (comment), the rel_min_volume will be 10 and base_min_volume will be adjusted accordingly.

I have the only question: is 0.000001 min vol for ETH fine? Should we increase it possibly to something bigger? Maybe put back 0.00777 for it?

#873 #849

Copy link
Member

@cipig cipig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works fine, thanks

all orders in DOGE/BTC-BEP20 have "base_min_volume": "10" DOGE, bids and asks, and "rel_min_volume": "0.00001xxx" BTC-BEP20, which is the same as 10 DOGE

BUSD-BEP20/BTC-BEP20 have "rel_min_volume": "0.000001" and "base_min_volume": "0.05xxx
\"method\":\"buy\",\"base\":\"BTC-BEP20\",\"rel\":\"BUSD-BEP20\",\"volume\":0.001,\"price\":61000}" works too

@Milerius
Copy link

Milerius commented Apr 12, 2021

I tried it too this weekend, and there is one specific case that i do not understand, so i've tried to sell 7 ABY for 0.1158402 after selecting an order in the orderbook, i call min_trading_vol rpc call and i got:

[05:15:13] [info] [rpc.min.volume.cpp:22] [434588]: coin ABY have min_trading_vol: 0.0001
[05:15:13] [info] [rpc.min.volume.cpp:22] [434588]: coin KMD have min_trading_vol: 0.0001

When forwarding this min_volume to sell i got the following error from mm2:

[{"error":"rpc:253] lp_ordermatch:2729] lp_ordermatch:2839] Min volume 0.0001 is too low, required: 0.0008632581780763500063017846999573550460030283096886918358221066607274504015013786233103879309600639502"}]

Min volume 0.0001 is too low but this is the min_volume returned by mm2 in min_trading_vol

If i do not specify min_volume in sell, the order is correctly placed.

thanks you

@artemii235
Copy link
Member Author

artemii235 commented Apr 12, 2021

@Milerius Please share the full body of the request that you send to MM2.

@Milerius
Copy link

Milerius commented Apr 12, 2021

@Milerius Please share the full body of the request that you send to MM2.

Batch request:

[
    {
        "coin": "ABY",
        "method": "min_trading_vol",
        "userpass": ""
    },
    {
        "coin": "KMD",
        "method": "min_trading_vol",
        "userpass": ""
    }
]

answer:

[
     {
        "result": {
            "coin": "ABY",
            "min_trading_vol": "0.0001"
         }
    },
    {
        "result": {
            "coin": "KMD",
            "min_trading_vol": "0.0001"
        }
    }
]

sell request:

 {
        "base": "ABY",
        "method": "sell",
        "min_volume": "0.0001",
        "price": "0.1158402",
        "rel": "KMD",
        "rel_nota": true,
        "userpass": "",
        "volume": "7"
    }

sell answer:

"error":"rpc:253] lp_ordermatch:2729] lp_ordermatch:2839] Min volume 0.0001 is too low, required: 0.0008632581780763500063017846999573550460030283096886918358221066607274504015013786233103879309600639502"}

Capture d’écran 2021-04-12 à 07 53 13

Note that we use the min_trading_vol answer as the slider for min_taker_vol to max_taker_vol - before we was using 0.00777 for min_taker_vol if it's was not specified by the user.

@artemii235
Copy link
Member Author

{
        "base": "ABY",
        "method": "sell",
        "min_volume": "0.0001",
        "price": "0.1158402",
        "rel": "KMD",
        "rel_nota": true,
        "userpass": "",
        "volume": "7"
    }

0.0001 * 0.1158402 = 0.00001158402 and 0.00001158402 < 0.0001. The min volume of rel coin must be also above threshold.

Copy link

@sergeyboyko0791 sergeyboyko0791 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@artemii235 artemii235 merged commit dd24de2 into mm2.1 Apr 12, 2021
@artemii235 artemii235 deleted the mm2.1-min-volume branch April 12, 2021 09:30
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

Successfully merging this pull request may close these issues.

4 participants