Skip to content

Commit 734ca49

Browse files
authored
Enhance Spot Tickers API functionality (#57)
1 parent f785baa commit 734ca49

File tree

18 files changed

+421
-22
lines changed

18 files changed

+421
-22
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "CryptoExchangeAPIs"
22
uuid = "5e3d4798-c815-4641-85e1-deed530626d3"
3-
version = "0.30.0"
3+
version = "0.31.0"
44

55
[deps]
66
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

docs/src/pages/Kucoin.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ CryptoExchangeAPIs.Kucoin.Spot.public_client
1616
```@docs
1717
CryptoExchangeAPIs.Kucoin.Spot.candle
1818
CryptoExchangeAPIs.Kucoin.Spot.deposit
19+
CryptoExchangeAPIs.Kucoin.Spot.ticker
20+
CryptoExchangeAPIs.Kucoin.Spot.ticker_all
1921
```
2022

2123
## Futures

docs/src/pages/Okex.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ CryptoExchangeAPIs.Okex.OkexAPIError
66
CryptoExchangeAPIs.Okex.Data
77
```
88

9+
## Common
10+
11+
```@docs
12+
CryptoExchangeAPIs.Okex.Common.public_client
13+
```
14+
15+
```@docs
16+
CryptoExchangeAPIs.Okex.Common.ticker
17+
```
18+
919
## Spot
1020

1121
```@docs

docs/src/pages/Upbit.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ CryptoExchangeAPIs.Upbit.Spot.market_list
1717
CryptoExchangeAPIs.Upbit.Spot.order_book
1818
CryptoExchangeAPIs.Upbit.Spot.status_wallet
1919
CryptoExchangeAPIs.Upbit.Spot.ticker
20+
CryptoExchangeAPIs.Upbit.Spot.ticker_all
2021
```

src/Bithumb/Spot/API/Ticker.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Ticker
22

3-
export TikerQuery,
4-
TikerData,
3+
export TickerQuery,
4+
TickerData,
55
ticker
66

77
using Serde

src/Bybit/Spot/API/Ticker.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ Base.@kwdef struct TickerQuery <: BybitPublicQuery
1616
end
1717

1818
struct TickerData <: BybitData
19+
s::String
1920
ap::Float64
2021
bp::Float64
2122
h::Float64
2223
l::Float64
2324
lp::Float64
2425
o::Float64
2526
qv::Float64
26-
s::String
2727
t::NanoDate
2828
v::Float64
2929
end
@@ -60,14 +60,14 @@ to_pretty_json(result.result)
6060
"retCode":0,
6161
"retMsg":"OK",
6262
"result":{
63+
"s":"ADAUSDT",
6364
"ap":0.6636,
6465
"bp":0.6634,
6566
"h":0.6687,
6667
"l":0.6315,
6768
"lp":0.6633,
6869
"o":0.6337,
6970
"qv":1.1594252877069e7,
70-
"s":"ADAUSDT",
7171
"t":"2024-03-25T19:05:35.491000064",
7272
"v":1.780835204e7
7373
},

src/Cryptocom/Spot/API/Ticker.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ Base.@kwdef struct TickerQuery <: CryptocomPublicQuery
1616
end
1717

1818
struct TickerInfo <: CryptocomData
19+
i::String
1920
h::Float64
2021
l::Maybe{Float64}
2122
a::Maybe{Float64}
22-
i::String
2323
v::Float64
2424
vv::Float64
25-
oi::Float64
25+
oi::Maybe{Float64}
2626
c::Maybe{Float64}
2727
b::Maybe{Float64}
2828
k::Maybe{Float64}
@@ -76,10 +76,10 @@ to_pretty_json(result.result)
7676
"result":{
7777
"data":[
7878
{
79+
"i":"BTCUSD-PERP",
7980
"h":63090.7,
8081
"l":59671.8,
8182
"a":62296.2,
82-
"i":"BTCUSD-PERP",
8383
"v":10797.3637,
8484
"vv":6.6340329849e8,
8585
"oi":1844.5729,

src/Deribit/Common/API/Instrument.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ export InstrumentQuery,
44
InstrumentData,
55
instrument
66

7+
export Currency,
8+
InstrumentKind
9+
710
using Serde
811
using Dates, NanoDates, TimeZones
912

@@ -85,7 +88,7 @@ using Serde
8588
using CryptoExchangeAPIs.Deribit
8689
8790
result = Deribit.Common.instrument(;
88-
currency = CryptoExchangeAPIs.Deribit.Common.Instrument.BTC
91+
currency = Deribit.Common.Instrument.BTC
8992
)
9093
9194
to_pretty_json(result.result)

src/Deribit/Common/API/Ticker.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ struct Stats <: DeribitData
3232
end
3333

3434
struct TickerData <: DeribitData
35+
instrument_name::String
3536
ask_iv::Maybe{Float64}
3637
best_ask_amount::Maybe{Float64}
3738
best_ask_price::Maybe{Float64}
@@ -44,7 +45,6 @@ struct TickerData <: DeribitData
4445
funding_8h::Maybe{Float64}
4546
greeks::Maybe{Greeks}
4647
index_price::Maybe{Float64}
47-
instrument_name::String
4848
interest_rate::Maybe{Float64}
4949
interest_value::Maybe{Float64}
5050
last_price::Maybe{Float64}
@@ -103,6 +103,7 @@ to_pretty_json(result.result)
103103
"usOut":"2024-05-17T12:10:28.639980032",
104104
"usIn":"2024-05-17T12:10:28.639770880",
105105
"result":{
106+
"instrument_name":"BTC-PERPETUAL",
106107
"ask_iv":null,
107108
"best_ask_amount":227380.0,
108109
"best_ask_price":66265.0,
@@ -115,7 +116,6 @@ to_pretty_json(result.result)
115116
"funding_8h":2.703e-5,
116117
"greeks":null,
117118
"index_price":66245.52,
118-
"instrument_name":"BTC-PERPETUAL",
119119
"interest_rate":null,
120120
"interest_value":0.011170326646787519,
121121
"last_price":66265.0,

src/Gateio/Spot/API/Ticker.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ Base.@kwdef struct TickerQuery <: GateioPublicQuery
1616
end
1717

1818
struct TickerData <: GateioData
19+
currency_pair::String
1920
base_volume::Maybe{Float64}
2021
change_percentage::Float64
2122
change_utc0::Maybe{Float64}
2223
change_utc8::Maybe{Float64}
23-
currency_pair::String
2424
etf_leverage::Maybe{Float64}
2525
etf_net_value::Maybe{Float64}
2626
etf_pre_net_value::Maybe{Float64}
@@ -70,11 +70,11 @@ to_pretty_json(result.result)
7070
```json
7171
[
7272
{
73+
"currency_pair":"ADA_USDT",
7374
"base_volume":2.0167711540647e7,
7475
"change_percentage":-4.77,
7576
"change_utc0":null,
7677
"change_utc8":null,
77-
"currency_pair":"ADA_USDT",
7878
"etf_leverage":null,
7979
"etf_net_value":null,
8080
"etf_pre_net_value":null,

0 commit comments

Comments
 (0)