Created
February 7, 2017 10:12
-
-
Save bartavelle/275c0b946cb2abf79bde2c25a3ebb501 to your computer and use it in GitHub Desktop.
Financial exchange bis
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Bitfinex where | |
import Lib | |
type BitfinexExchange = Exchange | |
type LevelCount = Int | |
data BitfinexBookMessage = BitfinexBookMessage { getTime :: Time | |
, getExchange :: BitfinexExchange | |
, getBookMessage :: BookMessage | |
, getLevelCount :: LevelCount | |
} deriving (Show, Eq) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Lib where | |
data Side = Buy | Sell deriving (Eq, Show) | |
newtype Price = Price Rational deriving (Eq, Show) | |
newtype Amount = Amount Rational deriving (Eq, Show) | |
newtype Currency = Currency String deriving (Eq, Show) | |
newtype Time = Time Integer deriving (Eq, Show) | |
type ExchangeName = String | |
data Exchange = Exchange { getName :: ExchangeName | |
, getBase :: Currency | |
, getQuote :: Currency | |
} deriving (Show, Eq) | |
newtype Message = Message { getTime :: Time } | |
deriving (Show, Eq) | |
data BookMessage = BookMessage { getPrice :: Price | |
, getSide :: Side | |
, getAmount :: Maybe Amount | |
} deriving (Show, Eq) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment