Safe Haskell | None |
---|
- initDepthStore :: IO DepthStoreHandle
- updateDepthStore :: DepthStoreHandle -> DepthStoreType -> Integer -> Integer -> IO ()
- setHasFullDepth :: DepthStoreHandle -> IO ()
- simulateBTCSell :: DepthStoreHandle -> Integer -> IO DepthStoreAnswer
- simulateBTCBuy :: DepthStoreHandle -> Integer -> IO DepthStoreAnswer
- simulateUSDSell :: DepthStoreHandle -> Integer -> IO DepthStoreAnswer
- simulateUSDBuy :: DepthStoreHandle -> Integer -> IO DepthStoreAnswer
- data DepthStoreHandle
- data DepthStoreType
- data DepthStoreAnswer
- simulateBTC :: Integer -> [DepthStoreEntry] -> Maybe Integer
- simulateUSD :: Integer -> [DepthStoreEntry] -> Maybe Integer
- data DepthStoreEntry = DepthStoreEntry {}
Documentation
updateDepthStore :: DepthStoreHandle -> DepthStoreType -> Integer -> Integer -> IO ()Source
setHasFullDepth :: DepthStoreHandle -> IO ()Source
simulateBTCSell :: DepthStoreHandle -> Integer -> IO DepthStoreAnswerSource
Simulate how much USD can be earned by selling the specified amount of BTC.
The function will return NotEnoughDepth
in case there is not enough depth
to cover the full amount. If no recent data is available, it will return
DepthStoreUnavailable
. In the latter case it will have retried a few times
before giving up. The function will not block for longer than about 20
seconds.
simulateBTCBuy :: DepthStoreHandle -> Integer -> IO DepthStoreAnswerSource
Simulate how much USD will be needed to buy the specified amount of BTC.
See simulateBTCSell
for more details.
simulateUSDSell :: DepthStoreHandle -> Integer -> IO DepthStoreAnswerSource
Simulate how much BTC can be earned by selling the specified amount of USD.
See simulateBTCSell
for more details.
simulateUSDBuy :: DepthStoreHandle -> Integer -> IO DepthStoreAnswerSource
Simulate how much BTC will be needed to buy the specified amount of USD.
See simulateBTCSell
for more details.
data DepthStoreHandle Source
data DepthStoreAnswer Source
simulateBTC :: Integer -> [DepthStoreEntry] -> Maybe IntegerSource
simulateUSD :: Integer -> [DepthStoreEntry] -> Maybe IntegerSource