trade-o-matic 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/trade-o-matic/adapters/bitfinex_backend.rb +13 -5
- data/lib/trade-o-matic/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cdb3595eea3330dbf40ed1afd20fb8348bb8bb4d
|
4
|
+
data.tar.gz: 78a9ef0e573e675b114c32d080919d6b5e8757c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc904cab00433f2d3976d980c2bbd2faccf79912e72f5e9ed1e7d23bf58c0bddd17e6e978994b640e60313cc41755ace6d94d8244cd1ca2a999d4842bc293f4b
|
7
|
+
data.tar.gz: 7ecfa279fa0a9b8394d361f43f0c22a28653fa8aae669e60b011fda220f0d6fd1948d0281cea65102642cac232e5d2351ca1dce963970a47d8c2677b00959fca
|
@@ -85,14 +85,22 @@ module Trader
|
|
85
85
|
end
|
86
86
|
|
87
87
|
def create_order(_session, _pair, _volume, _price, _type)
|
88
|
-
|
88
|
+
params = {
|
89
89
|
exchange: "bitfinex",
|
90
90
|
symbol: "BTCUSD",
|
91
91
|
side: _type == Order::BID ? 'buy' : 'sell',
|
92
|
-
amount: _volume.to_s('F')
|
93
|
-
|
94
|
-
|
95
|
-
|
92
|
+
amount: _volume.to_s('F')
|
93
|
+
}
|
94
|
+
|
95
|
+
if _price.nil?
|
96
|
+
params[:price] = _type == Order::BID ? '1.0' : '1000000.0' # some safe values just in case
|
97
|
+
params[:type] = 'exchange market'
|
98
|
+
else
|
99
|
+
params[:price] = _price.to_s('F')
|
100
|
+
params[:type] = 'exchange limit'
|
101
|
+
end
|
102
|
+
|
103
|
+
wrap_order auth_post(_session, 'order/new', params)
|
96
104
|
end
|
97
105
|
|
98
106
|
def fetch_order(_session, _id)
|