Bitcoin Forum
May 09, 2024, 11:51:18 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 2 3 [4] 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 »  All
  Print  
Author Topic: [BETA] MTGox websocket API, testers wanted  (Read 77610 times)
zelyony
Newbie
*
Offline Offline

Activity: 23
Merit: 0



View Profile
May 23, 2011, 05:02:07 PM
Last edit: May 23, 2011, 09:48:45 PM by zelyony
 #61

I prefer my suggestion of a request packet which the client can send at any time to request the complete depth state, and then relative +volume -volume stream continues from there.
good variant (1)
but people dont want to calculate depth state. they often will request the one. more traffic, slow server, bad trading.

variant (1.5)
every depth message contains all state. without unnessary attrs - one number is price, next in pair is volume with right sort order: "depth":{"asks":[X.XXXX, V.VVV,...],"bids":[...]}

another variant (2):
- new channel for depth-20(or some N) values asks & bids every one minute (only for checking purpose or as starting point)
- clear description of algorithm how calculate depth state over trade & depth channels

one more variant (2.5):
- depth values is absolute forever
- new attr "pos" with values { +N, N, -N } where
     +N - new row inserted at N pos, rows [N..end] shifted down
       N - updates values ar row N
      -N - row N deleted. other rows shifted to close gap (to up)
- "trade" values ​​must match the changes in "depth" values (a priori)
- but still need starting point - current depth state - use variant (2) or something
pros: simple calcs, asks & bids always sorted by server(that must be), traffic +1attr, CPU calcs almost same(as now)

"make your choice!" Smiley

We need as many digits as people can specify, which as far as I know is an unlimited amount.
now: values with volume less 0.001 remains in my depth state after process depth & trades from corresponding channels. but next ticker does not account for their. so, I delete them from calculated depth state.
1715298678
Hero Member
*
Offline Offline

Posts: 1715298678

View Profile Personal Message (Offline)

Ignore
1715298678
Reply with quote  #2

1715298678
Report to moderator
1715298678
Hero Member
*
Offline Offline

Posts: 1715298678

View Profile Personal Message (Offline)

Ignore
1715298678
Reply with quote  #2

1715298678
Report to moderator
Transactions must be included in a block to be properly completed. When you send a transaction, it is broadcast to miners. Miners can then optionally include it in their next blocks. Miners will be more inclined to include your transaction if it has a higher transaction fee.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
leepfrog
Sr. Member
****
Offline Offline

Activity: 252
Merit: 250


View Profile
May 25, 2011, 05:52:36 PM
 #62

This might be a stupid question but I dont fully understand the meaning of the ticker.php api.
It returns something like that:

{"ticker":{"high":7.51,"low":7,"vol":33895,"buy":7.257,"sell":7.3499,"last":7.2591}}

What exactly is high and low? the rest seems pretty clear but I am not sure about those two
Clark
Hero Member
*****
Offline Offline

Activity: 548
Merit: 502


So much code.


View Profile WWW
May 25, 2011, 06:03:12 PM
 #63

The ticker high and low are probably those respective prices for the current trading session, which I'm guessing is a full day. You should watch the ticker values for when the volume resets to zero, as that would be the beginning of the trading session.

leepfrog
Sr. Member
****
Offline Offline

Activity: 252
Merit: 250


View Profile
May 25, 2011, 06:12:55 PM
 #64

Makes sense - I'll watch it. Thanks!
Clark
Hero Member
*****
Offline Offline

Activity: 548
Merit: 502


So much code.


View Profile WWW
May 25, 2011, 08:14:04 PM
 #65

I'm not sure it's been mentioned before, but the data type of the getDepth.php return does not seem to be application/json, so it is not possible to do a cross-domain call to MtGox for the depth of market data.

This would be a really easy and quick fix in the getDepth.php code...

robottwo
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile
June 07, 2011, 03:09:51 AM
 #66

Hi,
    The websockets API is *great*. I have a suggestions for the protocol:


The size in the depth messages should publish the new absolute size, not the relative size. Subscribers can still figure out the relative size change by subtracting from the previous update at that size, but this provides better error recovery on the client side.
zelyony
Newbie
*
Offline Offline

Activity: 23
Merit: 0



View Profile
June 08, 2011, 03:15:33 PM
Last edit: June 12, 2011, 11:33:27 AM by zelyony
 #67

hint (from my bugs)
see MSDN Math.Round( decimal d, int decimals ), which I use
MtGox rounds numbers NOT SAME:
If the value of the first digit in d to the right of the decimals decimal position is 5, the digit in the decimals position is rounded up if it is odd, or left unchanged if it is even. If the precision of d is less than decimals, d is returned unchanged. The behavior of this method follows IEEE Standard 754, section 4. This kind of rounding is sometimes called rounding to nearest, or banker's rounding. It minimizes rounding errors that result from consistently rounding a midpoint value in a single direction.

some datas:
{"channel":"24e67e0d-1cad-4cc0-9e7a-f8523ef460fe","depth":{"price":30.22425,"type":1,"volume":1},"op":"private","origin":"broadcast","private":"depth"}
{"channel":"d5f06780-30a8-4a48-a2f8-7ed181b4a13f","op":"private","origin":"broadcast","private":"ticker","ticker":{"buy":30,"high":31.89,"last":30,"low":18.6,"sell":30.2243,"vol":98781}}
zelyony
Newbie
*
Offline Offline

Activity: 23
Merit: 0



View Profile
June 08, 2011, 05:03:45 PM
 #68

There's a new MTGox websocket API. This API works by subscription to channels, and each channel is represented by an UUID.

Which min volume of order required for trading (min step size)?
I saw volume=0.007 in depth channel, but ticker channel ignores that values (so values lessOrEqual 0.007 I ignore)
jaybny
Sr. Member
****
Offline Offline

Activity: 410
Merit: 250


Proof-of-Skill - protoblock.com


View Profile WWW
June 10, 2011, 06:06:16 PM
 #69

is websockets down? any ETA?

thanks

Protoblock turns knowledge of American football into Fantasybit coin, a margin token used to monetize leveraged skill.

https://twitter.com/jaybny/status/1022596877332762624
af12345
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
June 11, 2011, 02:45:56 PM
 #70

I think the API shows a lot of promise, but it's seems to be missing one key detail --- without publishing an order-id on the depth message, and the constituent order-ids on the trade message, it's not really possible to ever get in sync.

The reason is as follows: if you start your connection and receive an order @ 25 for volume 10, and then there is a trade @ 25 for volume 5, you can't tell if the trade was for part of the order you just received, or an earlier order (pre your connection time).

If, however, you were to provide an order-id on the depth message, and the pair of order ids on the trades, then all ambiguity is removed.
Clark
Hero Member
*****
Offline Offline

Activity: 548
Merit: 502


So much code.


View Profile WWW
June 11, 2011, 03:27:26 PM
 #71

Here are some things I've noticed after building some web applications using the WebScokets API:

  • Switching to the Secure WebSocket (wss://) would dramatically improve compatibility, especially for those behind a proxy
  • Security would also allow users to send trades via the WebSocket, which would simplify trading to one connection instead of polling+WS.
  • Send the prices and volumes as integers! Bitcoins are stored as integers in the client but displayed as floats by dividing by 1e8. Some of the prices and volumes quoted over the WebSocket are floating point numbers with much more precision than the 8th decimal, which doesn't make sense in the framework of Bitcoin overall.
  • The ability to request the depth of market table entries through the WS
  • More consistency in depth of market updates - I have to poll the data every so often in order to eliminate discrepancies, which is not very robust and could be misleading to people using my service.

zelyony
Newbie
*
Offline Offline

Activity: 23
Merit: 0



View Profile
June 12, 2011, 05:27:35 PM
 #72

it will be good create IRC-channel
  • for talks
  • for "websockets OFF for hour"
  • for bans in websockets (if exists)

at now
opened socket, sent handshake, received nothing - conn reset by peer
and I dont know what happened and how long it will last
kseistrup
Hero Member
*****
Offline Offline

Activity: 566
Merit: 500


Unselfish actions pay back better


View Profile WWW
June 12, 2011, 05:30:14 PM
 #73


  • Switching to the Secure WebSocket (wss://) would dramatically improve compatibility, especially for those behind a proxy

+1 for wss://

Cheers,

Klaus Alexander Seistrup
matt.collier
Member
**
Offline Offline

Activity: 105
Merit: 10



View Profile
June 12, 2011, 10:32:56 PM
 #74

Hello all, developing in Java here.

Aiming at creating an interface similar to Trade Station's Matrix: http://www.tradestation.com/strategy_testing/market_depth.shtm

I'm using Open Office Calc as the front end.  I've got the real-time data flowing into calc nicely, but I've run into the same sync issues everyone else is having.

As others have done, I'm bootstrapping my depth info with http://mtgox.com/code/data/getDepth.php, but before long, none of the volume information makes any sense.

I'll be happy to share my source with any interested parties.  For now I'm going to put this on the back burner until a solution to the sync issue has been implemented.

I'll put my vote in for a channel that publishes absolute volume information in addition to some effective bootstrapping method.
bitoption
Newbie
*
Offline Offline

Activity: 56
Merit: 0


View Profile WWW
June 13, 2011, 05:17:55 AM
 #75

I'm getting deafening silence from my python websockets client today. This is sad, since I use it to give pricing cues on bitoption.org; I've noticed some websockets-gox stuff is working right now, some is not.

Any indications as to what's what and why?
Clark
Hero Member
*****
Offline Offline

Activity: 548
Merit: 502


So much code.


View Profile WWW
June 13, 2011, 05:39:32 AM
 #76

It would be nice to hear from MagicalTux about the progress of the back end rewrite and deployment. Also, a formal documentation of the WebSockets API is most welcome.

I'm still seeing the feed at the moment, but it stopped a little earlier today. Very odd.

netxshare
Full Member
***
Offline Offline

Activity: 120
Merit: 100


View Profile
June 13, 2011, 06:24:58 AM
 #77

I am also having issues, my current connection to the websocket is showing data but any new connectionss fail to get anything more then a response header.

donations: 1CWddfhXagPoWgzUCs7oVHFjwBmqbAoJRr
zelyony
Newbie
*
Offline Offline

Activity: 23
Merit: 0



View Profile
June 13, 2011, 07:24:25 AM
Last edit: June 14, 2011, 08:36:22 PM by zelyony
 #78

found site with fast check websockets (and wss too)
http://websocket.org/echo.html
browser must support websockets (or enabled it)

for now MtGox-WebSockets requires Sec-WebSocket-Key1 and Sec-WebSocket-Key2 and 8bytes-data

at now (UTC 19:27 13-jun) WS dont responds with 16bytes of hash

and at now (UTC 20:37 13-jun) no connection

at now (UTC 20:35 14-jun) System.Net.Sockets.SocketException: Connection refused
molecular
Donator
Legendary
*
Offline Offline

Activity: 2772
Merit: 1019



View Profile
June 13, 2011, 07:55:22 PM
 #79

I'm getting deafening silence from my python websockets client today. This is sad, since I use it to give pricing cues on bitoption.org; I've noticed some websockets-gox stuff is working right now, some is not.

Any indications as to what's what and why?

There have been 2 periods where no trades happened and the websocket was dead, apparently some mysql troubles. Maybe you stumbled into one of these.

PGP key molecular F9B70769 fingerprint 9CDD C0D3 20F8 279F 6BE0  3F39 FC49 2362 F9B7 0769
zelyony
Newbie
*
Offline Offline

Activity: 23
Merit: 0



View Profile
June 16, 2011, 06:43:52 PM
 #80

today I saw MtGox Live for Android

and here is screen of my iPhone app (not in AppStore yet) - depth state
http://img27.imageshack.us/img27/1115/screenshot20110616at223.png

in first version will be depth state & trades only, no wallet & orders
Pages: « 1 2 3 [4] 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 »  All
  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!