Giter VIP home page Giter VIP logo

Comments (8)

germangar avatar germangar commented on June 17, 2024 1

I'm afraid this is a bug in BINGX. The information it's sending through the API states the maximum leverage for STX is 5x.

{'active': True,
 'base': 'STX',
 'baseId': 'STX',
 'contract': True,
 'contractSize': 1.0,
 'created': None,
 'expiry': None,
 'expiryDatetime': None,
 'feeSide': 'quote',
 'future': False,
 'id': 'STX-USDT',
 'index': None,
 'info': {'apiStateClose': 'true',
          'apiStateOpen': 'true',
          'asset': 'STX',
          'contractId': '100196',
          'currency': 'USDT',
          'ensureTrigger': True,
          'feeRate': '0.0005',
          'makerFeeRate': '0.0002',
          'maxLongLeverage': '5',                               <---------------------------
          'maxShortLeverage': '5',                               <---------------------------
          'pricePrecision': '4',
          'quantityPrecision': '0',
          'size': '1',
          'status': '1',
          'symbol': 'STX-USDT',
          'takerFeeRate': '0.0005',
          'tradeMinLimit': '0',
          'tradeMinQuantity': '3',
          'tradeMinUSDT': '2',
          'triggerFeeRate': '0.00045000'},
 'inverse': False,
 'limits': {'amount': {'max': None, 'min': 3.0},
            'cost': {'max': None, 'min': 2.0},
            'leverage': {'max': 5, 'min': None},
            'price': {'max': None, 'min': None}},
 'linear': True,
 'local': {'leverage': 0, 'marginMode': '------', 'positionMode': ''},
 'lowercaseId': None,
 'maker': 0.0002,
 'margin': False,
 'option': False,
 'optionType': None,
 'percentage': True,
 'precision': {'amount': 0,
               'base': None,
               'cost': None,
               'price': 4,
               'quote': None},
 'quote': 'USDT',
 'quoteId': 'USDT',
 'settle': 'USDT',
 'settleId': 'USDT',
 'spot': False,
 'strike': None,
 'subType': 'linear',
 'swap': True,
 'symbol': 'STX/USDT:USDT',
 'taker': 0.0005,
 'type': 'swap'}

In other coins (that I have tried) the leverage limits match the ones in the website


{'active': True,
 'base': 'BTC',
 'baseId': 'BTC',
 'contract': True,
 'contractSize': 1.0,
 'created': None,
 'expiry': None,
 'expiryDatetime': None,
 'feeSide': 'quote',
 'future': False,
 'id': 'BTC-USDT',
 'index': None,
 'info': {'apiStateClose': 'true',
          'apiStateOpen': 'true',
          'asset': 'BTC',
          'contractId': '100',
          'currency': 'USDT',
          'ensureTrigger': True,
          'feeRate': '0.0005',
          'makerFeeRate': '0.0002',
          'maxLongLeverage': '125',                               <---------------------------
          'maxShortLeverage': '125',                               <---------------------------
          'pricePrecision': '1',
          'quantityPrecision': '4',
          'size': '0.0001',
          'status': '1',
          'symbol': 'BTC-USDT',
          'takerFeeRate': '0.0005',
          'tradeMinLimit': '0',
          'tradeMinQuantity': '0.0001',
          'tradeMinUSDT': '2',
          'triggerFeeRate': '0.00020000'},
 'inverse': False,
 'limits': {'amount': {'max': None, 'min': 0.0001},
            'cost': {'max': None, 'min': 2.0},
            'leverage': {'max': 125, 'min': None},
            'price': {'max': None, 'min': None}},
 'linear': True,
 'local': {'leverage': 0, 'marginMode': '------', 'positionMode': ''},
 'lowercaseId': None,
 'maker': 0.0002,
 'margin': False,
 'option': False,
 'optionType': None,
 'percentage': True,
 'precision': {'amount': 4,
               'base': None,
               'cost': None,
               'price': 1,
               'quote': None},
 'quote': 'USDT',
 'quoteId': 'USDT',
 'settle': 'USDT',
 'settleId': 'USDT',
 'spot': False,
 'strike': None,
 'subType': 'linear',
 'swap': True,
 'symbol': 'BTC/USDT:USDT',
 'taker': 0.0005,
 'type': 'swap'}

I'm afraid there's nothing I can do about it.
I'll report it to the ccxt developers. They can't fix it either, but maybe they can report it to the Bingx developers.

from whook.

germangar avatar germangar commented on June 17, 2024 1

Hmm... looks like STX is not the only coin with smaller leverages through the API than those in the website. XRP has max leverage 10x and Solana max leverage 5x. ETH and BTC however both have 125x. Maybe this is made on purpose. I'll try to ask around.

from whook.

germangar avatar germangar commented on June 17, 2024

Hey,

Isolated mode should be the better one for higher leverages. So that shouldn't be the problem. Can you tell me the trading pair you were using? In fact, if you could copy/paste the console output for the alert and the error message it would be great. I want to try placing the same order myself to reproduce the error. It's fine if you make it with the minimum amount. I'll do that myself too.

I'd love to add the AWS-Linux tutorial to the readme. That'd be great.

I will probably move those settings to a configuration file when I have a few more settings to add. They are global settings and I only have a couple, so it feels a little odd to move them there yet.

from whook.

iZnogoude avatar iZnogoude commented on June 17, 2024

Hello Germangar,

When I had the leverage limit issue, I was trading
STXUSDT.P
leverage : 6
Position : short, cross
Broker : BingX
Whook server : Ubuntu AWS, last release of your whook script
Log :

  • WARNING: Leverage out of bounds. Readjusting to 5x

For the moment I didn't had the time to reproduce this error. I will do this soon.

My friend is gdumgdum, mayby his fork is up to date.

I will try to find some time to translate the AWS linux totorial.

from whook.

germangar avatar germangar commented on June 17, 2024

That's definitely wrong. STX has up to 50x leverage in isolated. I'll hunt the bug down.

from whook.

germangar avatar germangar commented on June 17, 2024

After having the CCXT people asking Bingx developers we figured out the leverage limits defined by Bingx are placeholders, so I added a hack to bypass them by setting them to a minimum of 100x.
This means in coins like STX whook won't be checking if the leverage is set to the correct limit (50x) and it can be rejected by the server, but you CAN set it now and as long as you pay attention the first time you'll have no problem.

It's up in the repository.

from whook.

iZnogoude avatar iZnogoude commented on June 17, 2024

@germangar
thanks a lot, I will test this soon

from whook.

germangar avatar germangar commented on June 17, 2024

I added a better fix for this. The script will now request the leverage limit from the server at placing the first order. After that it will keep using that one until the script is closed.

from whook.

Related Issues (14)

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.