We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback
00:00

Formal Metadata

Title
Smarkets
Subtitle
Keystone Sponsor Talk - Why Python is at the heart of Smarkets
Title of Series
Number of Parts
132
Author
License
CC Attribution - NonCommercial - ShareAlike 3.0 Unported:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal and non-commercial purpose as long as the work is attributed to the author in the manner specified by the author or licensor and the work or content is shared also in adapted form only under the conditions of this
Identifiers
Publisher
Release Date
Language

Content Metadata

Subject Area
Genre
Abstract
Smarkets is heavily invested in Python and this is why we've decided to be the Keystone sponsor of EuroPython 2018! In this talk, we'll tell you more about what we do at Smarkets, why we think we're a unique place to work, the interesting things we're doing at the Conference and of course how we use Python every day. We'll also tell you about some of our current challenges in upgrading from 3.6 to 3.7, evaluating asyncio in production and what we've learned from type hinting over the past two years.
35
74
Thumbnail
11:59
SoftwarePlastikkarteVotingEvent horizonMobile appWebsiteDesign by contractPhysical systemBitPredictabilityRight angleMereologyComputer animation
VotingIndependence (probability theory)PredictabilityIndependence (probability theory)WebsiteSource code
VotingIndependence (probability theory)PredictabilityWebsiteUtility softwareMultiplication sign
VotingIndependence (probability theory)Erlang distributionDecimalOrder (biology)BuildingGreen's functionSoftware testingOpen sourceDifferent (Kate Ryan album)Open sourceProjective planeDirected graphLevel (video gaming)VideoconferencingBitEscape characterBlogAdditionAuthorizationShared memoryRight angleMoment (mathematics)Process (computing)LiquidSoftware frameworkPredictabilityHypothesisPhysical systemCodeFormal languageProduct (business)Service (economics)RobotNumberFilm editingMereologySocial classEvent horizonCodeTerm (mathematics)Key (cryptography)Division (mathematics)Erlang distributionInterior (topology)Graph (mathematics)Line (geometry)PlastikkarteType theoryDependent and independent variablesGame theoryMultiplication signWeb 2.0Ultraviolet photoelectron spectroscopyDot productTowerBridging (networking)SurfaceOffice suiteGroup actionFreewareResultantOperator (mathematics)Table (information)Water vaporMatching (graph theory)Pairwise comparisonAutomatic differentiationSelf-organizationSoftware testingDebuggerComputer animation
Transcript: English(auto-generated)
Hi, so my name is Phil and I work at Smarkets and I suspect by now you've probably seen our name and logo over quite a lot of things and it's my pleasure to introduce us to you, explain what we do, why we're here as a sponsor and why Python is so very important
to us. So, to get straight into it, Smarkets is at heart an event trading exchange which means that people use our systems to buy the outcome or sell the outcome of events. For the most part, this is probably the most well known for sports betting, so if for example
a lot of people get entertainment out of betting on their favorite team to win or betting against their friend's team to win, so there's a lot of that that goes on. But for us, we have quite a bit of interest in something called prediction markets and a prediction market is a bit of a misnomer because it often really doesn't predict anything
which I'll get into in a minute, but the idea is that you can create a market for an event that's of interest to you, people will trade on the outcome of that event and you can see how they're trading to predict what that event will do. I'm going to get into that in just a second and explain a bit more, but for those of
you who actually want to know what Smarkets looks like, if you come in as a customer and use the site, it's like on the right, you'll use our website or the apps and you can see you can buy or sell contracts in an event or we have a trading API and quite a lot of people trade for our site in an automated fashion. So coming back to prediction markets, so one of the questions you might ask or I would ask here
as a topical question is if Scotland has an independence referendum before the year 2020, will they vote to be independent? And we have a market on this on our site and that market predicts that it's slightly more likely that they will vote to be independent at this time, it's 55%.
So this is a kind of idea of a prediction market and of course if you think this is wrong, you can go trade on this now and you'll make money, so that's the kind of notion for it. It has some utility of course beyond this, like if there's a general election for example
and you know that one party's coming in and they're going to raise taxes, you may want to come to our exchange and kind of hedge off that cost, which is another idea of doing it. So when I've told people about this, they've often asked well how predictive is it? Did you get the Brexit results right? Did you get the Trump results right? And I'm afraid to say we didn't, but all our markets predicted that Brexit wouldn't happen
and Trump wouldn't get elected, but I think in comparison to the polls, our markets showed that there's a lot more uncertainty in the outcome. It wasn't as clear cut as the polls had, so I think there's some real value in these markets existing. So that's the main part of Smarkets, Smarkets is an event exchange. We also have a division, let's say market maker or a trader, so this division called
Hanson trades on Smarkets and various other exchanges and if you imagine what they're trying to do, they're trying to always set the right price for the event and the outcomes. So in this graph, which hopefully is quite interesting, is a game between Tottenham and Crystal Palace and you can see from the start, sadly for the Crystal Palace supporters,
it's not likely that they're going to win it, but it starts very likely that Tottenham is going to win. As the game goes on, this decays as you get towards the end and there's no score, the draw becomes more likely and then a goal is scored and you can see it switched around quite a bit and now in the run up to the end of the match, it's very likely that Tottenham will win.
And for all of this, like what the trading entity is doing is pricing these markets and trying to make sure the true probability of the event is close to where they're pricing it or within the bid and ask spread for those of you who know financial terms. So those are the two divisions really of Smarkets and it probably would help a bit if
I told you where we sit in the marketplace. So for the sports betting, especially in exchange market, there's four competitors really. The biggest one is Betfair, who I suspect you're likely to have heard of. There's us, there's Matchbook and there's Betdac and together we're probably the UK market in betting exchanges. We're the second biggest at the moment and we're
taking Betfair's market share which is great for us. In addition, like I said, these prediction markets are very interesting to us. There's a company in the US called Predictit that just focuses solely on these. There's a few others placed around cryptocurrencies and the blockchain.
We also see them as our competition and us being in that marketplace and we think at the moment we have better liquidities so our markets are more predictive if you will. So that's us as a kind of commercial company. I'm going to quickly tell you a bit about what we're like as a company to work for. So this is one of my colleagues Tim sitting in his desk in our London office
which is very close to Tower Bridge. So it makes for a nice picture to kind of demonstrate where we are. We're about 100 people now but one of the really nice things about us is we're very diverse. These are all the little dots showing where our colleagues come from. We have about 28 nationalities I think at the moment although I think it's a bit higher and we have an office in LA, in London and an operations office in Malta.
We think and our employees, my colleagues seem to think we've got very nice culture and so this is I've just taken this from Glassdoor which is quite nice. One of the things I think that everyone seems to like is the foosball tables which is why we went to sponsor the
foosball tables as well downstairs. So a lot of my colleagues would probably be very happy to play you at that game if you want to ask them. So that's us as a kind of company, very quick kind of introduction just to let you know who we are. I'm going to say now why we're here and of course we're here as a Keystone sponsor and there's lots of reasons to do this,
lots of business reasons but for me personally the real aim of being here and being the Keystone sponsor is to support the community, to give back to the community and kind of try and join the community really. We've reached the stage now where we can start contributing to open source a lot more and we want to start doing this and we want to
be kind of known. I'll come to that later on. So what we've done here is we've brought along an escape room that's proved very popular. I suspect a lot of you before we've explained it probably thought we did escape rooms because it's the main thing that people have asked about. I'm sad to say there's no slots left but you can try and convince an existing team
that you can join them tomorrow. So yeah another reason why you might want to make friends at this conference. I should say as well that we're hiring of course like many of the companies. We think we've got a very nice interview process. We don't like to make people wait. We try and
make it very quick. We try and make it very pleasant and we've been interviewing here. If you're interested please come to talk to me and my colleagues. It'd be fantastic to hire some more people. Okay so probably the bit you're really interested in though is why we care about Python and why we're here in that regard and in some respects it's a bit of tautology for me
because Python is kind of the hearts market. Over two-thirds of our code base is Python and our other languages are JavaScript which is the front end and C++ and Erlang which we build the very latency critical systems. So I'm gonna go through some things that we've done in Python we think are interesting. I can only really skirt the surface of them because I don't
have enough time but if you're interested in any of these details please come talk to me and my colleagues and I can go into more. So the first thing is like I suspect most people here you've got to go through the Python 2 to Python 3 transition and we did this some time ago and I think we learned quite a bit if you'd like to if you're going through it yourself I can
hopefully give you some good advice. We started in 2015. We completed the year after in 2016 and now these past couple of weeks we're actually moving from 3.6 to 3.7 so we're quite happy with that and hopefully I'll never have to write Python 2 again. In the ads that we put out I
included this bit of code. I tried to include this bit of code to kind of give a few examples of the things we're really interested in at the moment to kind of spark some some comments. So a lot of my colleagues are very keen on us moving to 3.7 just so we can use data classes. I know there was a talk earlier today about it so hopefully the rest of you have all seen how good this is but this is one of the big keys for us for moving so quickly.
In addition, a few years ago we decided that all our code which should be type-inted and for about the last two years now we've been type-inting every line of code we've added. So there's only one bit here which is the JSON response part that really demonstrates that. We were doing that for quite some time. So I think we've got a lot of
knowledge of how to do this in practice. We gave some talks at the PyCon UK a couple of years ago if you want to look it up or again come ask me. And the final thing we've been getting into very recently because we have a lot of web microservices is asyncio based systems and there was a talk I'll come to in a minute but this is something we're really trying to push
and so that was the last bit I was trying to get across in this little snippet. So I can't really go into details sorry but some of my colleagues having talks I'll reference in a second but if you'd like to ask me please do. Okay so we gave some talks. We started with a workshop on Tuesday which explained and led people through building an actual sports trading bot that traded on smartkits. I think a number
of you actually got to the stage where your bots were trading on smartkits. I don't know how many of you made money or how it worked but it definitely got to that stage and all the code and the talks are obviously available and you can go take a look.
Yesterday we gave a talk on ETL pipelines particularly for us is the accounting pipeline because we're a fintech company and we get audited a lot so the upgrades and what we did to that pipeline made a big difference to us and Isabel explained how we did it. We also spoke yesterday about how we're starting to introduce asyncio into production and at this conference it seems very topical so hopefully that was a very interesting talk to
those who saw it and then today we spoke about how to keep master always green using one of our open source projects called Margebot and it's the open source projects that I want to finish on going back to why we're here trying to contribute back to the community. We're
trying to do this for open source as well so we have two projects that we maintain as a company one is called flake8strict which is a very opinionated linter so for those of you who like linting this one takes it a bit further and there's a blog post that explains it. Like I said a second ago there's Margebot which you can also go and use and see that talk
and I should say all of these and the details of them are available on our blog which is smartshq.com. The final thing I should say that we've been doing is we funded this is David Mcleiber on the right and he's the author of the hypothesis framework which I think a lot of you really enjoy using for testing and we funded him to do two projects on
hypothesis and we think that went very well so it's something we probably look at doing again in the future so if you think you've got an interesting open source project and you want to come talk to me about possible funding ideas then please do. So that's how we're trying to get back and hopefully now you know why we're here whose markets are and what we're up to.
So I'd like to thank the organizers for letting me explain ourselves to you we're not a very big company so I think it was quite important and thank you for the rest of you for listening.