question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[bitstamp] spot trade price is undefined

See original GitHub issue
{
    id: '68086689',
    info: {
      fee: '0.25000',
      order_id: 1660243896,
      datetime: '2018-06-10 18:59:51.000000',
      usd: 0,
      btc: 0,
      eth: '0.21208000',
      eth_eur: 453.05, <-- this?
      type: '2',
      id: 68086689,
      eur: '-96.08'
    },
    timestamp: 1528657191000,
    datetime: '2018-06-10T18:59:51.000Z',
    symbol: 'ETH/EUR',
    order: '1660243896',
    type: undefined,
    side: 'buy',
    takerOrMaker: undefined,
    price: undefined,
    amount: 0.21208,
    cost: 96.08,
    fee: { cost: 0.25, currency: 'EUR' },
    fees: [ [Object] ],
    _source: 'rest api'
  }

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
npomfretcommented, Jan 8, 2022

sorry for slow reply - just upgraded to "version": "1.66.52", and get the same problem.

I think this is the issue: https://github.com/ccxt/ccxt/blob/master/js/bitstamp.js#L663

The price field is not the market id, in my example it’s in a field called eth_eur, I think the market ids don’t have the underscore.

It has actually used the price field to correctly pick the market here: https://github.com/ccxt/ccxt/blob/master/js/bitstamp.js#L650

I think at this point we can assign the price as well.

fetch Request: bitstamp POST https://www.bitstamp.net/api/v2/user_transactions/ RequestHeaders: { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36', 'X-Auth': 'BITSTAMP 9MhEfI2pfbPcUuaWkOzdNI2MFz4VFVUs', 'X-Auth-Nonce': '8b41fb46-107c-43ce-8d93-486fe466b44e', 'X-Auth-Timestamp': '1641667224408', 'X-Auth-Version': 'v2', 'Content-Type': 'application/x-www-form-urlencoded', 'X-Auth-Signature': '2f32c3433ebfc9fa537e5ad025c236ffd123df450d0874c622567ccdb0ec1b9d' }

ResponseBody: [{"fee": "0.00000000", "btc_usd": "0.00", "datetime": "2021-12-08 10:17:08.877639", "usd": 0.0, "btc": 0.0, "sgb": "0.00000005", "type": "0", "id": 212608071, "eur": 0.0}, {"fee": "0.00000000", "btc_usd": "0.00", "datetime": "2019-03-04 20:28:59.000000", "usd": 0.0, "btc": "-0.39511777", "type": "1", "id": 83531383, "eur": 0.0}, {"fee": "0.00000000", "btc_usd": "0.00", "id": 83531019, "usd": 0.0, "btc": 0.0, "datetime": "2019-03-04 20:14:35.000000", "type": "1", "xrp": "-2099.84999900", "eur": 0.0}, {"fee": "0.00000000", "btc_usd": "0.00", "datetime": "2019-03-04 20:08:51.000000", "usd": 0.0, "btc": 0.0, "eth": "-2.00000000", "type": "1", "id": 83530844, "eur": 0.0}, {"fee": "0.00006400", "bch": "-0.76380550", "order_id": 2959161577, "datetime": "2019-03-04 20:01:15.000000", "usd": 0.0, "btc": "0.02525182", "bch_btc": 0.03306054, "type": "2", "id": 83530714, "eur": 0.0}, {"fee": "0.00000300", "bch": "0.01131550", "order_id": 1826070832, "datetime": "2018-08-13 16:34:15.000000", "usd": 0.0, "btc": "-0.00100000", "bch_btc": 0.08837442, "type": "2", "id": 72149445, "eur": 0.0}, {"fee": "0.90", "btc_usd": "0.00", "datetime": "2018-07-27 08:56:46.000000", "usd": 0.0, "btc": 0.0, "type": "1", "id": 70988957, "eur": "-1993.69"}, {"usd": "-245.27", "btc_usd": 8273.10000000, "order_id": 1904325293, "datetime": "2018-07-26 08:44:55.000000", "fee": "0.62000", "btc": "0.02964668", "type": "2", "id": 70929774, "eur": 0.0}, {"fee": "0.00018400", "order_id": 1739084557, "eth_btc": 0.07342958, "datetime": "2018-06-25 04:57:22.000000", "usd": 0.0, "btc": "-0.07342958", "eth": "1.00000000", "type": "2", "id": 69032893, "eur": 0.0}, {"fee": "0.79000", "order_id": 1735957430, "datetime": "2018-06-24 15:51:35.000000", "usd": 0.0, "btc": 0.0, "eth": "0.86000000", "eth_eur": 363.80000000, "type": "2", "id": 68993378, "eur": "-312.87"}, {"fee": "0.13000", "order_id": 1735957430, "datetime": "2018-06-24 15:51:35.000000", "usd": 0.0, "btc": 0.0, "eth": "0.14000000", "eth_eur": 363.79000000, "type": "2", "id": 68993377, "eur": "-50.93"}, {"usd": "-1761.24", "btc_usd": 5870.79000000, "order_id": 1734421912, "datetime": "2018-06-24 08:46:06.000000", "fee": "4.41000", "btc": "0.30000000", "type": "2", "id": 68969164, "eur": 0.0}, {"fee": "1.25000", "order_id": 1733870503, "datetime": "2018-06-24 06:36:19.000000", "usd": 0.0, "btc": "0.10000000", "btc_eur": 4993.74000000, "type": "2", "id": 68961144, "eur": "-499.37"}, {"usd": "97.29", "order_id": 1718110096, "datetime": "2018-06-21 09:31:04.000000", "ltc": "-1.00000000", "ltc_usd": 97.29000000, "fee": "0.25000", "btc": 0.0, "type": "2", "id": 68763369, "eur": 0.0}, {"fee": "0.00000000", "btc_usd": "0.00", "datetime": "2018-06-21 07:27:07.000000", "usd": 0.0, "btc": 0.0, "eth": "-16.53281574", "type": "1", "id": 68759185, "eur": 0.0}, {"fee": "0.00000000", "btc_usd": "0.00", "datetime": "2018-06-19 14:23:23.000000", "usd": 0.0, "btc": 0.0, "eth": "-0.10000000", "type": "1", "id": 68690901, "eur": 0.0}, {"usd": "-93.25", "order_id": 1694727197, "datetime": "2018-06-16 15:42:53.000000", "ltc": "1.00000000", "ltc_usd": 93.25000000, "fee": "0.24000", "btc": 0.0, "type": "2", "id": 68563028, "eur": 0.0}, {"usd": "-553.96", "bch": "0.65249000", "order_id": 1693922728, "datetime": "2018-06-16 11:40:33.000000", "fee": "1.39000", "bch_usd": 849.00000000, "btc": 0.0, "type": "2", "id": 68555800, "eur": 0.0}, {"fee": "0.00008500", "order_id": 1672498519, "id": 68283423, "usd": 0.0, "xrp_btc": 0.00008475, "btc": "-0.03390000", "datetime": "2018-06-12 22:36:14.000000", "type": "2", "xrp": "400.00000000", "eur": 0.0}, {"fee": "0.00008500", "order_id": 1672462921, "id": 68283021, "usd": 0.0, "xrp_btc": 0.00008494, "btc": "-0.03397600", "datetime": "2018-06-12 22:29:03.000000", "type": "2", "xrp": "400.00000000", "eur": 0.0}, {"fee": "0.00001300", "order_id": 1663545532, "id": 68153861, "usd": 0.0, "xrp_btc": 0.00008535, "btc": "-0.00512100", "datetime": "2018-06-11 07:48:33.000000", "type": "2", "xrp": "60.00000000", "eur": 0.0}, {"fee": "0.00007300", "order_id": 1663545532, "id": 68153855, "usd": 0.0, "xrp_btc": 0.00008535, "btc": "-0.02901900", "datetime": "2018-06-11 07:48:29.000000", "type": "2", "xrp": "340.00000000", "eur": 0.0}, {"fee": "0.01000", "order_id": 1660243896, "datetime": "2018-06-10 19:07:19.000000", "usd": 0.0, "btc": 0.0, "eth": "0.00002000", "eth_eur": 453.07000000, "type": "2", "id": 68087959, "eur": "-0.01"}, {"fee": "0.33000", "order_id": 1660243896, "datetime": "2018-06-10 18:59:53.000000", "usd": 0.0, "btc": 0.0, "eth": "0.28790000", "eth_eur": 453.07000000, "type": "2", "id": 68086700, "eur": "-130.44"}, {"fee": "0.25000", "order_id": 1660243896, "datetime": "2018-06-10 18:59:51.000000", "usd": 0.0, "btc": 0.0, "eth": "0.21208000", "eth_eur": 453.05000000, "type": "2", "id": 68086689, "eur": "-96.08"}]

1reaction
frosty00commented, Jan 4, 2022
 {
    id: '215949779',
    info: {
      fee: '0.12351',
      order_id: 1443751124246528,
      datetime: '2022-01-04 16:21:16.475000',
      usd: 0,
      btc: 0,
      eth: '0.00724502',
      eth_eur: 3409.54,
      type: '2',
      id: 215949779,
      eur: '-24.70'
    },
    timestamp: 1641313276475,
    datetime: '2022-01-04T16:21:16.475Z',
    symbol: 'ETH/EUR',
    order: '1443751124246528',
    type: undefined,
    side: 'buy',
    takerOrMaker: undefined,
    price: 3409.54,
    amount: 0.00724502,
    cost: 24.7,
    fee: { cost: 0.12351, currency: 'EUR' },
    fees: [ { currency: 'EUR', cost: 0.12351 } ]
  }

@npomfret it’s working for me, what version of ccxt are you using, can you provide a request + response?

Read more comments on GitHub >

github_iconTop Results From Across the Web

FAQ - Bitstamp
Find answers to common questions about registration, accounts and trading at Bitstamp. All the info you need to trade crypto with confidence.
Read more >
Bitstamp trade volume and market listings | CoinMarketCap
# Currency Pair Price +2% Depth ‑2% Depth Volume Volume % 1 Bitcoin BTC/USD $16,673.00 $2,564,237.46 $3,660,953.27 $44,065,948 34.36% 2 XRP XRP/USD $0.3585 $1,073,333.49 $911,167.81...
Read more >
Bitstamp - Twitter
We've listed $DOGE (Dogecoin) for our customers. Much wow! Buy and sell with no trading fees up to $1,000 over the past 30...
Read more >
Get bitcoin historical data [closed] - Stack Overflow
In case, you would like to collect bitstamp trade data form their ... The data seems to show the Coinbase spot price (in...
Read more >
Bitstamp - Facebook
3 - Sushi #DAO voted to redirect DEX's trading fees ... New tiers in our public rate card pricing on $50 million ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found