Skip to content

mexc3: add amount precision to markets#13288

Merged
kroitor merged 1 commit intoccxt:masterfrom
DoctorSlimm:mexc3-amount-precision-issue
May 17, 2022
Merged

mexc3: add amount precision to markets#13288
kroitor merged 1 commit intoccxt:masterfrom
DoctorSlimm:mexc3-amount-precision-issue

Conversation

@DoctorSlimm
Copy link
Copy Markdown
Contributor

fix ccxt#13273

@kroitor kroitor self-assigned this May 17, 2022
'optionType': undefined,
'precision': {
'amount': undefined,
'amount': this.safeInteger (market, 'baseAssetPrecision'),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you elaborate a bit on how this line fixes the amount in createSpotOrder ?

Copy link
Copy Markdown
Contributor Author

@DoctorSlimm DoctorSlimm May 17, 2022

Choose a reason for hiding this comment

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

@kroitor because without it, when amountToPrecision () is called in createSpotOrder (), an undefined value is passed in

amountToPrecision (symbol, amount) {
        const market = this.market (symbol)
        return decimalToPrecision (amount, TRUNCATE, market.precision.amount, this.precisionMode, this.paddingMode)
    }

https://github.com/ccxt/ccxt/blob/master/js/base/Exchange.js#L1710

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Right, thanks!

@kroitor kroitor added the bug label May 17, 2022
@kroitor kroitor merged commit f4ae95f into ccxt:master May 17, 2022
@DoctorSlimm DoctorSlimm deleted the mexc3-amount-precision-issue branch May 27, 2022 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to make SPOT order on mexc?

2 participants