Skip to content

Commit 50b8d06

Browse files
committed
Merge branch 'dev'
2 parents 5569283 + 71f0e1d commit 50b8d06

File tree

17 files changed

+1735
-150
lines changed

17 files changed

+1735
-150
lines changed

Const.go

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -119,42 +119,45 @@ var (
119119
QUARTER_CONTRACT = "quarter" //季度合约
120120
BI_QUARTER_CONTRACT = "bi_quarter" // NEXT QUARTER
121121
SWAP_CONTRACT = "swap" //永续合约
122+
SWAP_USDT_CONTRACT = "swap-usdt"
122123
)
123124

124125
//exchanges const
125126
const (
126-
KUCOIN = "kucoin.com"
127-
OKCOIN_COM = "okcoin.com"
128-
OKEX = "okex.com"
129-
OKEX_V3 = "okex.com_v3"
130-
OKEX_FUTURE = "okex.com_future"
131-
OKEX_SWAP = "okex.com_swap"
132-
HUOBI = "huobi.com"
133-
HUOBI_PRO = "huobi.pro"
134-
BITSTAMP = "bitstamp.net"
135-
KRAKEN = "kraken.com"
136-
ZB = "zb.com"
137-
BITFINEX = "bitfinex.com"
138-
BINANCE = "binance.com"
139-
BINANCE_SWAP = "binance.com_swap"
140-
POLONIEX = "poloniex.com"
141-
COINEX = "coinex.com"
142-
BITHUMB = "bithumb.com"
143-
GATEIO = "gate.io"
144-
BITTREX = "bittrex.com"
145-
GDAX = "gdax.com"
146-
BIGONE = "big.one"
147-
FCOIN = "fcoin.com"
148-
FCOIN_MARGIN = "fcoin.com_margin"
149-
FMEX = "fmex.com"
150-
HITBTC = "hitbtc.com"
151-
BITMEX = "bitmex.com"
152-
BITMEX_TEST = "testnet.bitmex.com"
153-
CRYPTOPIA = "cryptopia.co.nz"
154-
HBDM = "hbdm.com"
155-
COINBENE = "coinbene.com"
156-
ATOP = "a.top"
157-
BITGET_SWAP = "bitget_swap"
127+
KUCOIN = "kucoin.com"
128+
OKCOIN_COM = "okcoin.com"
129+
OKEX = "okex.com"
130+
OKEX_V3 = "okex.com_v3"
131+
OKEX_FUTURE = "okex.com_future"
132+
OKEX_SWAP = "okex.com_swap"
133+
HUOBI = "huobi.com"
134+
HUOBI_PRO = "huobi.pro"
135+
BITSTAMP = "bitstamp.net"
136+
KRAKEN = "kraken.com"
137+
ZB = "zb.com"
138+
BITFINEX = "bitfinex.com"
139+
BINANCE = "binance.com"
140+
BINANCE_SWAP = "binance.com_swap"
141+
BINANCE_FUTURES = "binance.com_futures"
142+
POLONIEX = "poloniex.com"
143+
COINEX = "coinex.com"
144+
BITHUMB = "bithumb.com"
145+
GATEIO = "gate.io"
146+
BITTREX = "bittrex.com"
147+
GDAX = "gdax.com"
148+
BIGONE = "big.one"
149+
FCOIN = "fcoin.com"
150+
FCOIN_MARGIN = "fcoin.com_margin"
151+
FMEX = "fmex.com"
152+
HITBTC = "hitbtc.com"
153+
BITMEX = "bitmex.com"
154+
BITMEX_TEST = "testnet.bitmex.com"
155+
CRYPTOPIA = "cryptopia.co.nz"
156+
HBDM = "hbdm.com"
157+
HBDM_SWAP = "hbdm.com_swap"
158+
COINBENE = "coinbene.com"
159+
ATOP = "a.top"
160+
BITGET_SWAP = "bitget_swap"
158161
)
159162

160163
const (
@@ -166,8 +169,9 @@ const (
166169
SPOT_MARGIN //币币杠杆交易
167170
WALLET // 资金账户
168171
_
169-
TIPS //余币宝
170-
SWAP //永续合约
172+
TIPS //余币宝
173+
SWAP //永续合约
174+
SWAP_USDT //usdt本位永续合约
171175
)
172176

173177
type LimitOrderOptionalParameter int

IMG_1177.jpg

-17.6 KB
Loading

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ ETH:0x98573ddb33cdddce480c3bc1f9279ccd88ca1e93
6767

6868
### 欢迎为作者付一碗面钱
6969

70-
<img src="https://raw.githubusercontent.com/nntaoli-project/goex/dev/wx_pay.JPG" width="250" alt="一碗面钱">&nbsp;&nbsp;&nbsp;<img src="https://raw.githubusercontent.com/nntaoli-project/goex/dev/IMG_1177.jpg" width="250" alt="一碗面钱">
70+
![微信](wx_pay.JPG) ![支付宝](IMG_1177.jpg)

binance/Binance.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
. "github.com/nntaoli-project/goex"
77
"net/http"
88
"net/url"
9+
"sort"
910
"strconv"
1011
"strings"
1112
"time"
@@ -305,6 +306,8 @@ func (bn *Binance) GetDepth(size int, currencyPair CurrencyPair) (*Depth, error)
305306
}
306307
}
307308

309+
sort.Sort(sort.Reverse(depth.AskList))
310+
308311
return depth, nil
309312
}
310313

@@ -492,7 +495,6 @@ func (bn *Binance) GetOneOrder(orderId string, currencyPair CurrencyPair) (*Orde
492495
ord.Amount = ToFloat64(respmap["origQty"].(string))
493496
ord.Price = ToFloat64(respmap["price"].(string))
494497
ord.DealAmount = ToFloat64(respmap["executedQty"])
495-
ord.AvgPrice = ord.Price // response no avg price , fill price
496498
ord.OrderTime = ToInt(respmap["time"])
497499

498500
cummulativeQuoteQty := ToFloat64(respmap["cummulativeQuoteQty"])

0 commit comments

Comments
 (0)