Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kucoin
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rongjun
kucoin
Commits
99595ca7
Commit
99595ca7
authored
May 30, 2019
by
zihan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
手续费调整
parent
1d740a3a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
30 deletions
+2
-30
kucoinCollector.js
kucoinCollector.js
+2
-30
No files found.
kucoinCollector.js
View file @
99595ca7
...
@@ -50,35 +50,6 @@ class KucoinCollector extends BaseCollector{
...
@@ -50,35 +50,6 @@ class KucoinCollector extends BaseCollector{
// this._fetchDepthByRest(symbols,subscribeDepth,callback);
// this._fetchDepthByRest(symbols,subscribeDepth,callback);
// },20000);
// },20000);
}
}
_fetchDepthByRest
(
symbols
,
depth
,
callback
){
const
restSymbols
=
symbols
;
const
perInterval
=
60
;
const
totalInterval
=
perInterval
*
restSymbols
.
length
+
100
;
setInterval
(()
=>
{
const
sortedSymbols
=
restSymbols
.
sort
(()
=>
{
return
Math
.
random
()
>
0.5
});
for
(
let
i
=
0
;
i
<
sortedSymbols
.
length
;
i
++
){
const
symbol
=
sortedSymbols
[
i
];
const
ipAddress
=
IPs
[
i
%
IPs
.
length
];
setTimeout
(()
=>
{
this
.
api
.
getOrderbook
(
symbol
,
depth
,
ipAddress
,(
error
,
result
)
=>
{
if
(
error
){
console
.
error
(
"get depth by rest error:"
);
console
.
error
(
error
);
return
;
}
const
data
=
result
.
data
;
const
timeStamp
=
data
.
timestamp
;
callback
(
data
.
SELL
.
slice
(
0
,
depth
).
map
((
item
)
=>
[
item
[
0
],
item
[
1
]]),
data
.
BUY
.
slice
(
0
,
depth
).
map
((
item
)
=>
[
item
[
0
],
item
[
1
]]),
symbol
,
timeStamp
);
// totalOrderbook[symbol]={asks:data.SELL,bids:data.BUY};
});
},
i
*
perInterval
);
}
},
totalInterval
);
}
_fetchDepthByWebsocket
(
symbols
,
depth
,
callback
){
_fetchDepthByWebsocket
(
symbols
,
depth
,
callback
){
function
subsCallback
(
error
,
result
){
function
subsCallback
(
error
,
result
){
if
(
error
){
if
(
error
){
...
@@ -129,7 +100,8 @@ class KucoinCollector extends BaseCollector{
...
@@ -129,7 +100,8 @@ class KucoinCollector extends BaseCollector{
return
symbolDetail
.
symbol
;
return
symbolDetail
.
symbol
;
}
}
getFeeRate
(
fromCurrency
,
toCurrency
){
getFeeRate
(
fromCurrency
,
toCurrency
){
return
0.0007
;
// return 0.0007;
return
0.001
;
}
}
processAmount
(
fromCurrency
,
toCurrency
,
amount
){
processAmount
(
fromCurrency
,
toCurrency
,
amount
){
const
detail
=
this
.
_getSymbolDetail
(
fromCurrency
,
toCurrency
);
const
detail
=
this
.
_getSymbolDetail
(
fromCurrency
,
toCurrency
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment