File tree Expand file tree Collapse file tree 3 files changed +12
-8
lines changed Expand file tree Collapse file tree 3 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -192,6 +192,7 @@ test-suite bfx-test
192
192
, base >= 4.7 && < 5
193
193
, base16-bytestring
194
194
, bytestring
195
+ , conduit
195
196
, containers
196
197
, cryptonite
197
198
, envparse
Original file line number Diff line number Diff line change @@ -564,14 +564,14 @@ mkOrder args = do
564
564
pure
565
565
$ mkOrderNetBaseAmt args
566
566
grossBaseAmt <-
567
- case bos of
568
- Buy ->
569
- tweakMoneyAmount Buy
570
- . MoneyAmount
571
- $ unMoneyAmount netBaseAmt
572
- / (1 - unFeeRate (mkOrderFee args))
573
- Sell ->
574
- pure netBaseAmt
567
+ tweakMoneyAmount bos
568
+ $ case bos of
569
+ Buy ->
570
+ MoneyAmount
571
+ $ unMoneyAmount netBaseAmt
572
+ / (1 - unFeeRate (mkOrderFee args))
573
+ Sell ->
574
+ netBaseAmt
575
575
price <-
576
576
mkOrderMarketAveragePrice
577
577
args
Original file line number Diff line number Diff line change @@ -126,6 +126,9 @@ spec = before sysEnv $ do
126
126
& # limit
127
127
.~ Just 5
128
128
res `shouldSatisfy` isRight
129
+ it " roundMoneyAmount" . const $ do
130
+ amt <- roundMoneyAmount . MoneyAmount $ 3391591 % 10000000000
131
+ amt `shouldBe` MoneyAmount (8479 % 25000000 )
129
132
it " mkOrder" . const $ do
130
133
let req =
131
134
Bfx. MkOrder
You can’t perform that action at this time.
0 commit comments