<p>So I ran a test where I placed an order that I knew would be unique and then promptly canceled it, the whole time logging all depth objects to my terminal </p>

<p>The result was </p>

<pre><code>{ price: '66',
  type: 2,
  type_str: 'bid',
  volume: '6.66',
  price_int: '6600000',
  volume_int: '666000000',
  item: 'BTC',
  currency: 'USD',
  now: '1370548662105838',
  total_volume_int: '37301280846' }
</code></pre>

<p>and </p>

<pre><code>{ price: '66',
  type: 2,
  type_str: 'bid',
  volume: '-6.66',
  price_int: '6600000',
  volume_int: '-666000000',
  item: 'BTC',
  currency: 'USD',
  now: '1370548667379328',
  total_volume_int: '36635280846' }
</code></pre>

<p>Which leads me to conclude that negative volumes are in fact the result of a canceled trade</p>

CC BY-SA 3.0
2013-06-06T20:08:29.610Z
2013-06-06T22:20:55.943Z
2013-06-06T22:20:55.943Z
Loourr
<p>I am using MtGox's <a href="https://en.bitcoin.it/wiki/MtGox/API/Streaming" rel="nofollow">websocket api</a> to construct an order book. The trouble I'm having is that every once in a while, the depth event will return an JSON object with negative volume and negatie volume_int</p>

<pre><code>{
  "channel":"24e67e0d-1cad-4cc0-9e7a-f8523ef460fe",
  "depth":{
    "currency":"USD",
    "item":"BTC",
    "now":"1323644358437819",
    "price":"14.43",
    "price_int":"1443000",
    "total_volume_int":"849766000",
    "type":1,
    "type_str":"ask",
    "volume":"-2.71",
    "volume_int":"-271000000"
  },
  "op":"private",
  "origin":"broadcast",
  "private":"depth"
} 
</code></pre>

<p>What does this mean? I'm wondering if it could perhaps be to indicate an order has been canceled</p>

<mtgox><api><market-depth>
Negative volumes returned from MtGox websocket api request
Loourr
# Negative volumes returned from MtGox websocket api request

(Asked by: username_0 on 2013-06-06)

I am using MtGox's [websocket api](https://en.bitcoin.it/wiki/MtGox/API/Streaming) to construct an order book. The trouble I'm having is that every once in a while, the depth event will return an JSON object with negative volume and negatie volume\_int

```
{
  "channel":"24e67e0d-1cad-4cc0-9e7a-f8523ef460fe",
  "depth":{
    "currency":"USD",
    "item":"BTC",
    "now":"1323644358437819",
    "price":"14.43",
    "price_int":"1443000",
    "total_volume_int":"849766000",
    "type":1,
    "type_str":"ask",
    "volume":"-2.71",
    "volume_int":"-271000000"
  },
  "op":"private",
  "origin":"broadcast",
  "private":"depth"
} 

```

What does this mean? I'm wondering if it could perhaps be to indicate an order has been canceled

**Tags:** mtgox, api, market-depth


---

## 1 answers

### Answer by username_0 on 2013-06-06. Score: 2

So I ran a test where I placed an order that I knew would be unique and then promptly canceled it, the whole time logging all depth objects to my terminal

The result was

```
{ price: '66',
  type: 2,
  type_str: 'bid',
  volume: '6.66',
  price_int: '6600000',
  volume_int: '666000000',
  item: 'BTC',
  currency: 'USD',
  now: '1370548662105838',
  total_volume_int: '37301280846' }

```

and

```
{ price: '66',
  type: 2,
  type_str: 'bid',
  volume: '-6.66',
  price_int: '6600000',
  volume_int: '-666000000',
  item: 'BTC',
  currency: 'USD',
  now: '1370548667379328',
  total_volume_int: '36635280846' }

```

Which leads me to conclude that negative volumes are in fact the result of a canceled trade


---

