elective-stereophonic
elective-stereophonic
priceNQT incorrect in api calls? singapore
Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest Stable Nxt Client: Nxt 1.12.2

Author Topic: priceNQT incorrect in api calls?  (Read 1282 times)

anteater

  • Newbie
  • *
  • Karma: +0/-0
  • Offline Offline
  • Posts: 10
    • View Profile
priceNQT incorrect in api calls?
« on: February 04, 2016, 05:49:51 pm »

Why is the priceNQT for a trade returned in the api (getTrades and getTransaction) as the NXT value rather than the NQT value, see example below.

The price per asset was 95 NXT so the NQT value should be 9500000000.



transaction id: 6859760652789573619
Logged

MrV777

  • Hero Member
  • *****
  • Karma: +115/-4
  • Offline Offline
  • Posts: 988
    • View Profile
Re: priceNQT incorrect in api calls?
« Reply #1 on: February 04, 2016, 05:53:09 pm »

Why is the priceNQT for a trade returned in the api (getTrades and getTransaction) as the NXT value rather than the NQT value, see example below.

The price per asset was 95 NXT so the NQT value should be 9500000000.

transaction id: 6859760652789573619

I think this has to do with the decimals and the fact that that particular one is set to 8
Logged
NXT: NXT-BK2J-ZMY4-93UY-8EM9V
NXT nodes: 209.222.98.250, 216.155.128.10

anteater

  • Newbie
  • *
  • Karma: +0/-0
  • Offline Offline
  • Posts: 10
    • View Profile
Re: priceNQT incorrect in api calls?
« Reply #2 on: February 04, 2016, 06:00:31 pm »

I am using NRS Version: 1.7.4 by the way.
Logged

anteater

  • Newbie
  • *
  • Karma: +0/-0
  • Offline Offline
  • Posts: 10
    • View Profile
Re: priceNQT incorrect in api calls?
« Reply #3 on: February 04, 2016, 06:03:09 pm »

I was under the impression that on assets the decimals were used to calculate the quantity not the price e.g. quantityQNT is 2000000000 / 100000000 = 20 units

20 units * 95 NXT = 1900 NXT
Logged

coretechs

  • Sr. Member
  • ****
  • Karma: +161/-1
  • Offline Offline
  • Posts: 436
    • View Profile
Re: priceNQT incorrect in api calls?
« Reply #4 on: February 04, 2016, 06:29:22 pm »

The asset has 8 decimal places so the smallest allowable quantity is 0.00000001, which is represented by 1 QNT since floating-point numbers aren't used in the blockchain.  1 QNT (0.00000001 asset) costs 95 NQT (0.00000095 NXT)
Logged
https://ardorportal.org - Ardor blockchain explorer | https://nxtportal.org - Nxt blockchain explorer | http://bitcoindoc.com - The Rise and Rise of Bitcoin
ARDOR-T43P-R2K9-8W79-9W2AL | NXT-WY9K-ZMTT-QQTT-3NBL7
 

elective-stereophonic
elective-stereophonic
assembly
assembly