The Smarkets API is currently in private alpha, subscribe and you'll be updated when we start to open it up a bit more.
Tracking Changes in v0.4.0
written by mokele on 27 Oct 2011How can I track when the API gets updated? On GitHub of course. With the awesome compare view we can diff 0.3.0 with 0.4.0 without batting an eyelid. Subscribing to these articles and hanging out on IRC are also a good idea.
You can also track the public Smarkets API docs project and keep up to date when new specs are released and any and all explanation changes.
Along with this API spec update the erlang application and python library have been updated with some extra payload sending functions for the new types. Added to that, skarab (Hunter) has started work on a C# library named IronSmarkets which is now in heavy development. He’ll be talking about that in more details soon right here. So stay tuned for that.
The sandbox is for customers in a position to be placing bets at this time, but we’ll be providing more tools on top of the API for mass quote fetching in the coming months. See you on the other side!
/me goes back to organising live erlang release upgrades
API Sandbox v0.3.0
written by mokele on 19 Oct 2011We’ve updated the sandbox and the relevant code on GitHub and smarkets.github.com to the API version 0.3.0. What we’ve added is are:
-
orders-for-market-request - to fetcha list of open orders per market. We don’t think this set of messages is perfect quite yet, but we wanted to give you access to what is currently available so we can move towards the best solution. Iterative design++. We also want to have access to all open orders for an entire account, but seen as that might be of considerable size for many market makers we need to rethink how best to expose such high volumes of orders in the most elegant way possible. We really want the best.
-
more logout-reasons for your debugging pleasure
-
All connections are now over SSL - the cert isn’t verified due to just being a sandbox, but we’ll be sorting that out don’t you worry.
-
Fixes to async contract-quotes payloads when subscribed to a market so they’re sure to include a zero quantity for quotes where no quantity is left available. This will occur when all of a given quantity at a price is executed or cancelled.
-
Session Cleanup - All sessions left unused for more than 24 hours will be cleaned up and will no longer be resumable. We want to make creating new sessions as light weight as possible, so to achieve this we need to clean up the cruft on an ongoing basis. For 24 hour, 36(5|6) days a year access to the api we recommend maintaining a persistent connection to Smarkets, whether that’s through just 1 ongoing session or 5, we don’t mind… but if you leave one unused and want to forget about the market subscriptions and live order updates for that session, we’ll be cleaning that up, ok? good. For shorter-term connections to Smarkets such as mobile apps you can either make your connection to us on a server of your own and expose that to your mobile app, or simply have your mobile app create a new session and disconnect to save battery life. We’ll be writing more about the best approaches depending on what you’re developing, so stay tuned for that.
Added to this, we’ll soon be eating our own dog food by having our own website Smarkets.com place bets on your behalf over our WebSockets server connecting directly with our streaming API. We’re pretty excited about this part!
See you on freenode IRC channel #smarkets
Doing maths in JavaScript
written by rednum on 30 Sep 2011One of the things that we must get right at Smarkets is floating point arithmetic. While adding some new features to our frontend, it turned out we needed a better JavaScript library to handle floating point numbers for correctly displaying profit and loss. The best way to get one was to get an intern—i.e. me—to write it!
Hence I present decnum, the JavaScript decimal numbers library. It is a standalone project that provides arbitrary-precision numbers with arithmetic and comparison. The library comes with some tests, which you can run using nodeunit.
Since decnums are implemented as arrays of “digits” in base 10000, most of the operations can get a bit slow for really big numbers—especially division and multiplication, which run in quadratic time (the rest of the operations run in linear time). This shouldn’t be a problem unless you are using some really huge numbers in your calculations (or want some crazy precision), but if you do, you probably shouldn’t be writing in JavaScript in the first place!
Introducing the Smarkets API
written by mokele on 06 Sep 2011So, it’s time to talk about the Smarkets API, get even more feedback, and get you people using it! We’re still in private alpha, so the sandbox is only open to a few (hopefully you) people. Apologies if you don’t have access quite yet, it’s a busy time and we need to make sure everything is running smoothly before jumping too far ahead of ourselves.
Now let’s get down to business.
The Smarkets API was designed with two main objectives in mind - keeping developers happy, and letting them trade in the most sensible way possible. Hopefully it evolves to be far more than these things, but so far this has led us to the following design decisions:
-
Hosting as much as we can on GitHub (this one’s an obvious first step in the right direction)
-
Having a wire protocol compatible with Protocol Buffers allowing access to the Smarkets messaging protocol in a large number of different languages (this is a no-brainer for ease-of-use)
-
push messages (it’s a trading platform - there’s real money at stake)
- real-time market price updates
- order executions
- and a lot more planned
-
Exposing ids for horses, jockeys, and football teams (a requirement from speaking with client developers)
-
Beginning with officially supported Python and Erlang SDKs. (These are the languages we use internally; it’s what we know best)
-
Evolving the API on an ongoing basis based on feedback from the community. All feedback is welcome, and greatly encouraged. Join us in the #smarkets IRC channel on Freenode
We’re planning some developer meet-ups and tutorial sessions, so subscribe and we’ll keep you updated and help you in every way possible to take advantage of the Smarkets API for trading sports, current affairs, politics, entertainment, and much more.
If you have any questions in the form “Are you planning to X?”, the answer is most probably yes.
