GithubHelp home page GithubHelp logo

tebello-thejane / bitx.hs Goto Github PK

View Code? Open in Web Editor NEW
11.0 11.0 3.0 594 KB

(Hopefully useful) Haskell bindings to the BitX bitcoin exchange's API.

License: BSD 3-Clause "New" or "Revised" License

Haskell 100.00%
api bitcoin bitcoin-exchange haskell haskell-bindings

bitx.hs's Issues

Creating managers is expensive

Currently a new connection manager is created for every request. This is fairly expensive, mainly because for TLS all of the certificates in the certificate store need to be parsed and loaded. If I replace globalManager with this, my CPU usage goes down a lot:

{-# NOINLINE yuck #-}
yuck :: NetCon.Manager
yuck = unsafePerformIO (NetCon.newManager NetCon.tlsManagerSettings)

globalManager :: IO NetCon.Manager
globalManager = pure yuck

(Obviously this isn't a great thing to do, it's just a quick'n'dirty PoC of sharing the manager)

What we probably want is some way to pass a manager in to the operation to be used, but I'm not quite sure how to do this without creating duplicate variants of every operation in the API, which sounds tedious.

Ticker values need to be `Scientific`

Currently these are Int, which is fine for XBTZAR since no decimals are allowed in the price, but useless for ETHXBT since the prices are always fractional in this market.

Travis jobs randomly run into 503 issues

The travis jobs randomly time out when testing live API connectivity. This might be due to the default (non-container-based) infrastructure sharing the same IP address between multiple instances running the same test, and thus flooding BitX.

Perhaps moving to container-based infrastructure might help.

ETHXBT pair

Luno recently added this (along with the ETH asset). Should be a pretty easy change, I'll try send a PR shortly.

Could not find module ‘Network’

src/Network/Bitcoin/BitX/Internal.hs:26:1: error:
    Could not find module ‘Network’
    Use -v to see a list of the files searched for.
   |
26 | import Network (withSocketsDo)

Precision issue

λ> B.postEncode $ B.OrderRequest B.XRPXBT B.BID 673 0.00002683
[("pair","XRPXBT"),("type","BID"),("volume","673"),("price","0.000026")]

Not sure where we're losing precision but this is clearly wrong!

Stackage nightly test failure

Failures:
  test/Network/Bitcoin/BitX/Spec/Specs/NetSpec.hs:24: 
  1) Network.Bitcoin.BitX.Spec.Specs.Net, 
       Public BitX connectivity, 
       getTrades connects to BitX and works

Streaming API

I have some code implementing the streaming websocket API which I'd like to contribute, but it probably needs some more cleaning up. Also I used type-level symbols for pairs rather than value-level constants, so the API will probably need to be changed. Filing this so I hopefully don't forget forever.

CI is totally buggered

We have basically given up on Travis-CI as it has a lot of noisy failures.

  • Are we trying to support too many GHC versions?
  • And what about the jobs which just decide to fail on whim?

Get this shit stable and fixed, so that we don't ignore valid failures due to all this noise.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.