Bitcoin Forum
May 08, 2024, 05:41:16 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Warning: One or more bitcointalk.org users have reported that they strongly believe that the creator of this topic is a scammer. (Login to see the detailed trust ratings.) While the bitcointalk.org administration does not verify such claims, you should proceed with extreme caution.
Pages: [1]
  Print  
Author Topic: YoBit API Glitch?  (Read 782 times)
lclclc223 (OP)
Full Member
***
Offline Offline

Activity: 174
Merit: 100


View Profile
August 05, 2017, 04:36:25 AM
 #1

When I run the following python code:
Code:
import time,hmac,hashlib,requests,json
from urllib.parse import urlencode
url = "https://yobit.net/tapi"
key = MY API KEY
secret = MY API SECRET
values = {}
values["method"] = "Trade"
values["nonce"] = str(int(time.time()*100-15*10**10))
values["pair"] = "nlc2_btc"
values["type"] = 'buy'
values["rate"] = 0.00001420
values["amount"] = 3000
body = urlencode(values)
signature = hmac.new(secret.encode("utf-8"), body.encode("utf-8"), hashlib.sha512).hexdigest()
headers = {
                    'Content-Type': 'application/x-www-form-urlencoded',
                    'Key':key,
                    'Sign': signature
                }
req = requests.post(url,data=values,headers=headers)
print(req.text)

Instead of executing a trade for 3000 NLC2 at 1420 sats, it prints '{"success":0,"error":"Total transaction amount is less than minimal total: 0.00010000"}'

Clearly 3000*0.00001420 > 0.00010000, so something is wrong here...

If somebody could help me fix that, that would be great.
1715190076
Hero Member
*
Offline Offline

Posts: 1715190076

View Profile Personal Message (Offline)

Ignore
1715190076
Reply with quote  #2

1715190076
Report to moderator
Be very wary of relying on JavaScript for security on crypto sites. The site can change the JavaScript at any time unless you take unusual precautions, and browsers are not generally known for their airtight security.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715190076
Hero Member
*
Offline Offline

Posts: 1715190076

View Profile Personal Message (Offline)

Ignore
1715190076
Reply with quote  #2

1715190076
Report to moderator
1715190076
Hero Member
*
Offline Offline

Posts: 1715190076

View Profile Personal Message (Offline)

Ignore
1715190076
Reply with quote  #2

1715190076
Report to moderator
1715190076
Hero Member
*
Offline Offline

Posts: 1715190076

View Profile Personal Message (Offline)

Ignore
1715190076
Reply with quote  #2

1715190076
Report to moderator
pasdechance
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
August 19, 2017, 02:03:19 PM
 #2

Hey! I'm having the exact same issue. Did you find out how to fix this ? Your help would be very much appreciated. (And i'm quite into nlc2 as well hehe  Cheesy)
lclclc223 (OP)
Full Member
***
Offline Offline

Activity: 174
Merit: 100


View Profile
August 20, 2017, 04:50:00 AM
 #3

I've tried contacting support but they haven't responded yet. At this point, I've given up on day trading nlc2; just waiting for it to spike.
Herbert2020
Legendary
*
Offline Offline

Activity: 1946
Merit: 1137


View Profile
August 20, 2017, 06:15:00 AM
 #4

have you tried your code with some other pair? like buying something else like LTC for example. if you haven't then give it a try and if that was successful then it is that particular pair's problem not your code.

if that didn't work either, then it is your code.
i checked my own code (it is not python) and i am appending the "method" and "nonce" at the end of my request! maybe that is your issue. Yobit API is known to give weird error messages like that and confuse you.

Weak hands have been complaining about missing out ever since bitcoin was $1 and never buy the dip.
Whales are those who keep buying the dip.
pasdechance
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
August 20, 2017, 11:08:46 AM
 #5

Thanks for your replies Smiley I've been trying with some other pairs but I have the same issue.

Here's what my request looks like which should be like yours :

Code:
{'pair': 'nlc2_btc', 'type': 'buy', 'rate': 3e-05, 'amount': 666, 'method': 'Trade', 'nonce': '1503225324'}

and i get the error :

Code:
{'success': 0, 'error': 'Total transaction amount is less than minimal total: 0.00010000'}

However this succeeds (I checked on yobit's site) :

Code:
trade("nlc2_btc","buy",0.01,0.01)

which results in me buying 0.01 NLC at the lowest selling price, let's say 4.000 satoshis, meaning the total amount in BTC of my order is 40 sats  Huh Huh ! I finally figured out how the fake pumping bots are able to buy such small amounts  Grin !

I've tried contacting the support as well, but they won't answer me.

Are you able to set price below 0.0001 in your requests ? I wonder what's wrong  Undecided
pasdechance
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
August 21, 2017, 04:06:33 PM
Last edit: August 21, 2017, 04:24:54 PM by pasdechance
 #6

I figured it out !

Someone in the troll box was nice enough to help me  Cheesy

The price must be in quotes (not mentionned in their API FAQ obviously) and no more problems  Cool

BitcoinsGreat
Sr. Member
****
Offline Offline

Activity: 980
Merit: 280


View Profile
August 22, 2017, 02:33:30 PM
 #7

I figured it out !

Someone in the troll box was nice enough to help me  Cheesy

The price must be in quotes (not mentionned in their API FAQ obviously) and no more problems  Cool



Are you thinking about the fees when you're looking at this? The end result has to be after all the network fees and internal trade fees were taking a consideration. Even if API has a glitch, it is surely to be a temporary one.
sgtStrom
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
December 03, 2017, 01:36:46 PM
 #8

Hello everyone.
I'm creating a little bot for yobit using Python these days and I faced the same problem ({'error': 'Total transaction amount is less than minimal total: 0.00010000', 'success': 0}).
Today I finally found out what was wrong. It's not quotes. Python represents very small float numbers as an exponent (e.g. 0.00000577 as 5.77e-6). That's why yobit server returns that error - it doesn't know what this 'e' means. If I get it right, it doesn't really matter what type of variables the price and the amount should be - float or string. But these numbers should not be exponent, like 5.77e-6, they should have 'normal' form, like 0.00000577. I hope this will help you Smiley

Sorry for bad English, it's not my native language.
elmicionero
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
March 04, 2019, 09:42:18 PM
 #9

QUE YOBIT Invalid Ticker
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!