Please Critique my First Project - A Bitcoin Market API Client
Hiya, so I've spent the last 2 months or so learning Haskell. I've finished the UPenn course, LYAH and a little bit of RWH. I wanted to get a project going so I tried making an API client for the CampBX Bitcoin Market. I started out by following along with the FPComplete Mailchimp API Tutorial. I'm asking you beautiful people for any feedback on it so I can be sure that I'm on the right track here, stuff like code style/idioms, project layout, public interface, implementation, docs, ideas for new features, anything you want to tell me, etc.: https://github.com/prikhi/campbx-haskell Typical usage would be something like this:
main :: IO () main = do cfg <- defaultCampBXConfig _ <- runCampBX cfg $ do totalAskVolume <- calculateAskVolume <$> getDepth liftIO . putStrLn $ "Total Ask Volume: " ++ show totalAskVolume return () calculateAskVolume :: Depth -> BTCAmount calculateAskVolume depthList = sum . map askAmount . asks $ depthList where askAmount (Ask (_, q)) = q
There are still some things I want to work on:
Define Asks and Bids using Record Syntax. The JSON for a Bid/Ask comes back as a 2 item Array but the generically derived instance expects an object. I haven't completely wrapped my head around Aeson's Array parsing...
Write tests. I'm imagining they would be more "given this JSON, make sure the data structure is created correctly" instead of property-based testing.
Use something other than Doubles to represent Amounts + Prices. Is there a standard library for accurate math with decimals(I need up to 8 decimal places)? I suppose I could always just use Integers to represent Satoshis(the smallest subunit of bitcoins).
What are the steps to create a Bitcoin API from scratch for Bitcoin market data ?
I cant find informations about how the already existing Bitcoin APIs come up with their market data. Maybe there's something I dont understand? Do they look directly into the blockchain? If its the case, how? Thank you
I'm looking specifically for API's focused around data. For example, Raphael (http://raphaeljs.com/) is a sweet API but it's for drawing, not data. There are a few lists if you google it but I was wondering if you, as a human, know of anything really cool or interesting.
Automated Trading and Market Making stableDEX.io will provide a real-time web socket API enabling cutting-edge capabilities for automated trading. #StableDex #Blockchain #Ethereum #Bitcoin #IEO #Tokensale #cryptocurrency https://stabledex.io/
New themarketplace.i2p domain and support for EUR, AUD, GBP, USD, CAD, NZD, CNY currencies for both vendors AND customers!
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Hi, We our proud to announce we have released our most requested feature, Currencies, to allow customers and vendors to use any of our supported currencies (EUR, AUD, GBP, USD, CAD, NZD, CNY) and the amount will be converted to your chosen currency during browsing and then to bitcoin at checkout. This feature has been highly requested by vendors to allow the use of less volatile currencies for pricing their items. We will never be more than 10 minutes out of date with our prices and we use multiple servers to poll bitcoin market API's and then poll for this data from our backend servers. We are now also the only marketplace that has been approved for the default i2p address book and as such, we are available at http://themarketplace.i2p without any further configuration required from users. Thanks, TMPSchultz -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (Darwin) Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJSkCsqAAoJEBLtEWOvmHDdRtcIALCYOXpYBEI0v2M/J7vubr+q CJ/7qu3NY5AEtI0YH+6iO7kL6eu/VcoyYvou7Nr6hkpV39T75bXiQ5wHVlmfrE A5yJ9obIiKs6OrfDdkyssWe+6q3IkgPIeNc9UalU4kOOx+T57lhegYE/jXt8Ve2Y 0XnqhCfaHLLzl0JvGE5T7GCHTOPHma8/Jo9r11+8dwwURxG6gb2fhT2ABo7MQ8 h48dvZvAGfzTQlCqIk9E42uAb2nLUEHOWYkFGG3bFJ/pf+nWr8X1ah6iNWmimo57 hDcrK7n3E4qHbk0zqBdyDWtwNT6Z5Qu4ZatpSaIZvW40WHQrVmR9TNU07CaYMCI= =Ne+W -----END PGP SIGNATURE-----
With the large increase in the popularity of various blockchain projects over the last few years, there has also been a large increase in the number of Bitcoin and blockchain APIs that have appeared on the market.
05-09 10:23 - 'Virtual Crypto® Technologies Launches Bit4sure, a Proprietary Cryptocurrency Transaction Confirmation API OTC Markets:VRCP' (globenewswire.com) by /u/PhylissKylln removed from /r/Bitcoin within 176-186min
[OC] Which front offices and agents are the 3 major newsbreakers connected to? I went through 6000+ tweets to find out!
If this sounds somewhat familiar, that's because I did a 2019-2020 version and posted it back in March. In terms of changes from that post:
I've expanded the timeline to tweets from September 27, 2018. This is the first official day where each of Shams, Woj and Haynes were at their own respective companies. Shams moved to the Athletic from Yahoo in August, and Haynes moved from ESPN to Yahoo in September.
I've also expanded the criteria on when a tweet could possibly be linked to an agent
TL;DR Tracked tweetsof Woj, Shams and Haynes from 2018-2020 to see whether any of them report on a certain team or a certain agent's players more than their counterparts.Here is the main graphconcerning a reporter's percentage of tweets per team separated into three periods (2019 season, 2020 offseason, 2020 season). Here is aseparate graphwith the Lakers and Warriors, because Haynes's percentages would skew the first graph. During times like the NBA trade deadline or the lifting of the NBA free-agency moratorium, it’s not uncommon to see Twitter replies to (or Reddit comments about) star reporters reference their performance relative to others. Woj is the preeminent scoop hound, but he is also notorious for writing hit pieces on LeBron (sources say it’s been widely rumoured that the reason for these is that Woj has always been unable to place a reliable source in LeBron’s camp). On the other end of the spectrum, it has been revealed that in exchange for exclusive intel on league memos and Pistons dealings, Woj wrote puff pieces on then-GM Joe Dumars (see above Kevin Draper link). Last summer, Woj was accused of being a Clippers shill on this very discussion board for noticeably driving the Kawhi Leonard free agency conversation towards the team. This is the reason I undertook this project: to see whether some reporters have more sources in certain teams (and certain agencies) than other reporters. First I’ll explain the methodology, then present the data with some initial comments.
To make this manageable on myself, I limited myself to tracking the 3 major national reporters: Shams Charania of the Athletic, Chris Haynes of Yahoo Sports and the aforementioned Adrian Wojnarowski of ESPN.
I didn’t use beat reporters, as most (if not all) of their sources would be concentrated on their local team
Others that I considered but ultimately decided not to track:
Brian Windhorst of ESPN (double-dipping in ESPN)
Zach Lowe of ESPN (I consider him more of an analyst)
Marc Spears of ESPN (harder to sift through Twitter feeds, as he posts a lot more unrelated/non-news-breaking content)
Marc Stein of the New York Times (same as Spears)
Kevin O'Connor of The Ringer (same as Lowe)
The time period I initially tracked for was from January 1, 2020 to the end of the regular season March, but after finding a Twitter scraping tool on GitHub called Twint, I was able to easily retrieve all tweets since September 27, 2018. However, a month ago, Twitter closed their old API endpoints, and Twint ceased to work. I used vicinitas.io but the data loading became more time-consuming. Therefore, the tweets are up to the date of October 15 2020. How I determined information was by manually parsing text tweets by the reporter (no retweets):
This means I did not include images or multimedia appearances such as television, radio or podcasts. The rationale for this is that I simply don’t have the time to listen/watch and record all the instances of providing information through sources on these mediums.
Now, I didn’t take every single text tweet:
I didn’t include direct statements, be they from players or front office folks
I separated them, along with podcast guests in another tab
I didn’t include the summary tweet that Woj & Shams love to do: “Story filed to/Story on [employer]:..” because it doesn’t add anything apart from a link to a story (also, I personally don’t want to be called an ESPN/Yahoo/Athletic shill)
If the tweet added a reporter’s own analysis to someone else’s tweet, it was not included
If it was new information, the tweet was retained
Tweets that related solely to retired players were not included: mainly Haynes reporting Dwyane Wade joining CAA, as well as the unfortunate passing of Kobe Bryant on January 26
I grouped multiple tweets about the same subject delivered around the same time frame (such as trades) into one, as doing otherwise would arbitrarily inflate totals
There’s no hard and fast rule for whether or not to group tweets
For example, the big 4-team trade that created the Pocket Rockets was grouped in full
On the other hand, the Miami-Memphis trade was split up because the full details came like a day later
Sometimes, I used my judgment to determine whether a tweet’s underlying information would have come from a source, and therefore whether I should include that tweet or not
For example, consider the All-Star tweets: Haynes and Shams both posted the All-Star starters, but looking at the time signatures led me to believe that this was simply relaying the information from the TNT reveal
On the other hand, both Shams and Haynes posted tweets disclosing the All-Star Reserves before the TNT reveal
Next, I had to assign possible teams to each tweet:
Items such as changes to the league calendar, the naming of All-Star Reserves and salary cap projections were immediately attached to an NBA source
Injuries and trades were fairly straightforward, assigning these tweets to the participating teams
Items such as league mandated fines/suspensions, invitations to All-Star competitions and game protests were credited to both a general NBA source, as well as the related team(s)
Direct sources from agents or mentions of specific agents were attributed as a catch-all “Agent”
In the former, team was not included: examples include Matisse Thybulle’s agent on not being selected for the Rising Stars Game or Royce O’Neale’s agents confirming his contract extension with the Jazz
In the latter, team was included: examples include two Knicks switching their agent to Rich Paul
New addition: anything related to a player's status with a team were also attributed to agents (qualifying offers, extensions, option decisions, waivers, and contracts/deals)
I then found which agents correspond to which players (big shoutout to realgm.com and the Wayback Machine)
Rumours were slightly more difficult
As we know very well, league sources is an exceedingly vague term
Instead of attempting to pinpoint a rival executive with a motive to make a comment, I took the “Occam’s Razor” approach and assumed that the teams involved had someone talk to the reporter
When it was impossible to even determine a participant team, it was the general “NBA” source to the rescue
Chris Haynes has the highest percentage of tweets relating to the Detroit Pistons in all three periods. He also reports on far more Portland news than Shams or Woj.
Shams' Brooklyn edge is evident. The Athletic was also the outlet that Kevin Durant felt comfortable talking to about his positive coronavirus test. As well, Shams reported on Spencer Dinwiddie's quest to tokenize his contract (similar to bitcoin).
Adrian Wojnarowski has increased his percentage of tweets regarding the LA Clippers period-over-period, but so have the other two reporters.
It's surprising that Dallas's numbers are so low, considering they're a good team with an international superstar.
My hypothesis from my previous post is that Shams and Woj each have capable Mavericks deputies in the Tims (Cato and MacMahon, respectively) and decide to leave that market alone
Shams does have the highest percentage of Mavericks tweets in all three seasons however.
Now, you'll notice that there's two teams missing from the above graph: the Golden State Warriors and the Los Angeles Lakers. Here's the graphs for those two teams. As you can see, they would skew the previous graph far too much. During the 2019 NBA season, 27% of Chris Haynes's qualifying tweets could be possibly linked to the Warriors, and 14% of his qualifying tweets could be possibly linked to the Lakers.
Here's the top 10 agents in terms of number of potential tweets concerning their clients.
Woj has the most tweets directly connected to agents by far. It wasn't uncommon to see "Player X signs deal with Team Y, Agent Z of Agency F tells ESPN." The agents that go to Woj (and some of their top clients):
Mark Bartelstein of Priority Sports (Bradley Beal, Kyle Lowry, Gordon Hayward)
Jeff Schwartz and Sam Goldfeder of Excel Sports (Khris Middleton, Nikola Jokic, CJ McCollum and Kevin Love)
Steven Heumann and Austin Brown of Creative Artists Agency (Andrew Wiggins, Chris Paul, Donovan Mitchell and Zion Williamson)
One thing I found very intriguing: 15/16 of tweets concerning an Aaron Turner client were reported on by Shams. Turner is the head of Verus Basketball, whose clients include Terry Rozier, Victor Oladipo and Kevin Knox. Shams also reported more than 50% of news relating to clients of Sam Permut of Roc Nation. Permut is the current agent of Kyrie Irving, after Irving fired Jeff Wechsler near the beginning of the 2019 offseason. Permut also reps the Morris brothers and Trey Burke. As for Chris Haynes, he doesn't really do much agent news (at least not at the level of Woj and Shams). However, he reported more than 50% of news relating to clients of Aaron Goodwin of Goodwin Sports Management, who reps Damian Lillard and DeMar DeRozan. Here are the top 10 free agents from Forbes, along with their agent and who I predict will be the first/only one to break the news.
Most Likely Reporter
Too close to call, leaning Shams
Too close to call, leaning Shams
Alexander Raskovic, Jason Ranne
Limited data, but part of Wasserman, whose players are predominantly reported on by Woj
Thanks for reading! As always with this type of work, human error is not completely eliminated. If you think a tweet was mistakenly removed, feel free to drop me a line and I’ll try to explain my thought process on that specific tweet! Hope y’all enjoyed the research!
This repository provides documentation for BTC Markets' API. For more information please refer to the wiki area. Introduction. Authentication. Trading updated 03/15/19. Market data updated 7/24/19. Account management updated 3/14/19. Fund Transfer updated 08/06/19. FAQ. WebSocket feed. WebSocket v2. WebSocket v1 - deprecated . Sample Codes (Officially supported) Java: https://github.com ... Bitcoin (BTC), Bitcoin Cash (BCH), Litecoin (LTC), Ethereum (ETH), Dash (DASH), Ripple (XRP), Monero (XMR) plus many more. The full list of supported cryptocurrency markets can be found at this endpoint: Price Symbols. The full list of cryptocurrencies and tokens with full names is here: Full Names. Our Cryptocurrency price data is sourced and aggregated from exchanges all over the world, a ... Use CoinMarketCap's free crypto API to get the best, most accurate real-time, historical cryptocurrency and exchange trade data for Bitcoin, Ethereum and more. CoinMarketCap Developers. API Documentation; Pricing; FAQ; Log In; The world's cryptocurrency data authority has a professional API made for you. Get Your API Key Now. A new suite of powerful, flexible, and accurate cryptocurrency ... Bitcoin Charts / Markets API MASTER RECORD. Payments Bitcoin, Charts. Provides financial and technical data related to the Bitcoin network, including market activity, both current and historic, and weighted prices for several world currencies for use in pricing goods in terms of Bitcoin. Bitcoincharts provides a simple API to most of its data; developers can integrate the data into their ... Die auf bitcoin.de zum Handel angebotenen Kryptowährungen sind nicht für alle Investoren geeignet. Stellen Sie daher unbedingt sicher, dass Sie die mit dem Handel von Kryptowährungen verbundenen Risiken vollständig verstanden haben und lassen Sie sich gegebenenfalls von einer unabhängigen und sachkundigen Person oder Institution beraten, bevor Sie den Handel aufnehmen. Ihre etwaigen ...
Codugh: A Bitcoin-powered developer API marketplace
Quick and easy tutorial on how to use the CoinMarketCap API in the Spreadstreet Google Sheets add-in. What it does: The ticker is a high level overview of the state of the market. It shows you the ... The project is envisioned to help developers monetize their codes with Bitcoin SV payments. ... BBVA API Market, innovation for growing your business - Duration: 2:55. BBVA 4,023 views. 2:55 ... Udemy Course (95% off): https://goo.gl/V9tcFp Python Code (GitHub): https://goo.gl/QzSpnf Video Referenced: https://goo.gl/FDHq2d This video explains the bas... Crypto APIs is the infrastructure layer of any Crypto & Blockchain product. - Blockchain APIs - supports BTC, LTC, ETH, BCH, BSV, DOGE, Zcash, DASH, Tether, BTG mainnet - Market Data APIs - Get ... Quick and easy tutorial on how to use bitcoin charts API in the Spreadstreet Google Sheets add-in. What it does: This will return an array with elements for each market from the Bitcoin Charts API