Files
gocryptotrader/exchanges/gateio/testdata/wsFutures.json
Ryan O'Hara-Reid 16f543666f GateIO: Fix and standardise ping handling (#2023)
* gateio: standardise ping handlers (cherry-pick)

* Add tests and expand incoming cases for proof

* lint: fix and add commentary on ping delay

* Update exchange/websocket/connection.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchanges/gateio/gateio_websocket.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* linter: fix

* Update exchange/websocket/connection.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* fix test

* glorious: insane catch

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
2025-09-10 21:02:09 +10:00

17 lines
6.9 KiB
JSON

{"time":1541659086,"channel":"futures.tickers","event":"update","error":null,"result":[{"contract":"BTC_USD","last":"118.4","change_percentage":"0.77","funding_rate":"-0.000114","funding_rate_indicative":"0.01875","mark_price":"118.35","index_price":"118.36","total_size":"73648","volume_24h":"745487577","volume_24h_btc":"117","volume_24h_usd":"419950","quanto_base_rate":"","volume_24h_quote":"1665006","volume_24h_settle":"178","volume_24h_base":"5526","low_24h":"99.2","high_24h":"132.5"}]}
{"channel":"futures.trades","event":"update","time":1541503698,"result":[{"size":-108,"id":27753479,"create_time":1545136464,"create_time_ms":1545136464123,"price":"96.4","contract":"BTC_USD"}]}
{"time":1615366379,"channel":"futures.book_ticker","event":"update","error":null,"result":{"t":1615366379123,"u":2517661076,"s":"BTC_USD","b":"54696.6","B":37000,"a":"54696.7","A":47061}}
{"channel":"futures.orders","event":"update","time":1541505434,"result":[{"contract":"BTC_USD","create_time":1628736847,"create_time_ms":1628736847325,"fill_price":40000.4,"finish_as":"filled","finish_time":1628736848,"finish_time_ms":1628736848321,"iceberg":0,"id":4872460,"is_close":false,"is_liq":false,"is_reduce_only":false,"left":0,"mkfr":-0.00025,"price":40000.4,"refr":0,"refu":0,"size":1,"status":"finished","text":"-","tif":"gtc","tkfr":0.0005,"user":"110xxxxx"}]}
{"time":1543205083,"channel":"futures.usertrades","event":"update","error":null,"result":[{"id":"3335259","create_time":1628736848,"create_time_ms":1628736848321,"contract":"BTC_USD","order_id":"4872460","size":1,"price":"40000.4","role":"maker","text":"api","fee":0.0009290592,"point_fee":0}]}
{"channel":"futures.liquidates","event":"update","time":1541505434,"result":[{"entry_price":209,"fill_price":215.1,"left":0,"leverage":0,"liq_price":213,"margin":0.007816722941,"mark_price":213,"order_id":4093362,"order_price":215.1,"size":-124,"time":1541486601,"time_ms":1541486601123,"contract":"BTC_USD","user":"1040xxxx"}]}
{"channel": "futures.auto_deleverages", "event": "update", "time": 1541505434, "result": [{"entry_price": 209,"fill_price": 215.1,"position_size": 10,"trade_size": 10,"time": 1541486601,"time_ms": 1541486601123,"contract": "BTC_USD","user": "1040"} ]}
{"channel":"futures.position_closes","event":"update","time":1541505434,"result":[{"contract":"BTC_USD","pnl":-0.000624354791,"side":"long","text":"web","time":1547198562,"time_ms":1547198562123,"user":"211xxxx"}]}
{"channel":"futures.balances","event":"update","time":1541505434,"result":[{"balance":9.998739899488,"change":-2.074115e-06,"text":"BTC_USD:3914424","time":1547199246,"time_ms":1547199246123,"type":"fee","user":"211xxx"}]}
{"time":1551858330,"channel":"futures.reduce_risk_limits","event":"update","error":null,"result":[{"cancel_orders":0,"contract":"BTC_USD","leverage_max":10,"liq_price":136.53,"maintenance_rate":0.09,"risk_limit":450,"time":1551858330,"time_ms":1551858330123,"user":"20011"}]}
{"time": 1588212926,"channel": "futures.positions", "event": "update", "error": null, "result": [ { "contract": "BTC_USD", "cross_leverage_limit": 0, "entry_price": 40000.36666661111, "history_pnl": -0.000108569505, "history_point": 0, "last_close_pnl": -0.000050123368,"leverage": 0,"leverage_max": 100,"liq_price": 0.1,"maintenance_rate": 0.005,"margin": 49.999890611186,"mode": "single","realised_pnl": -1.25e-8,"realised_point": 0,"risk_limit": 100,"size": 3,"time": 1628736848,"time_ms": 1628736848321,"user": "110xxxxx"}]}
{"time":1596798126,"channel":"futures.autoorders","event":"update","error":null,"result":[{"user":123456,"trigger":{"strategy_type":0,"price_type":0,"price":"10000","rule":2,"expiration":86400},"initial":{"contract":"BTC_USDT","size":10,"price":"10000","tif":"gtc","text":"web","iceberg":0,"is_close":false,"is_reduce_only":false},"id":9256,"trade_id":0,"status":"open","reason":"","create_time":1596798126,"name":"price_autoorders","is_stop_order":false,"stop_trigger":{"rule":0,"trigger_price":"","order_price":""}}]}
{"time":1678468497,"time_ms":1678468497232,"channel":"futures.order_book","event":"all","result":{"t":1678468497168,"id":4010394406,"contract":"BTC_USD","asks":[{"p":"19909","s":3100},{"p":"19909.1","s":5000},{"p":"19910","s":3100},{"p":"19914.4","s":4400},{"p":"19916.6","s":5000},{"p":"19917.2","s":8255},{"p":"19919.2","s":5000},{"p":"19920.3","s":11967},{"p":"19922.2","s":5000},{"p":"19924.2","s":5000},{"p":"19927.1","s":17129},{"p":"19927.2","s":5000},{"p":"19929","s":20864},{"p":"19929.3","s":5000},{"p":"19929.7","s":24683},{"p":"19930.3","s":750},{"p":"19931.4","s":5000},{"p":"19931.5","s":1},{"p":"19934.2","s":5000},{"p":"19935.4","s":1}],"bids":[{"p":"19901.2","s":5000},{"p":"19900.3","s":3100},{"p":"19900.2","s":5000},{"p":"19899.3","s":2983},{"p":"19899.2","s":6035},{"p":"19897.2","s":5000},{"p":"19895.7","s":5984},{"p":"19895","s":5000},{"p":"19892.9","s":195},{"p":"19892.8","s":5000},{"p":"19889.4","s":5000},{"p":"19889","s":8800},{"p":"19888.5","s":11968},{"p":"19887.1","s":5000},{"p":"19886.4","s":24683},{"p":"19885.7","s":1},{"p":"19883.8","s":5000},{"p":"19880.2","s":5000},{"p":"19878.2","s":5000},{"p":"19876.8","s":1}]}}
{"time":1678469222,"time_ms":1678469222982,"channel":"futures.order_book_update","event":"update","result":{"t":1678469222617,"s":"BTC_USD","U":4010424331,"u":4010424361,"b":[{"p":"19860.7","s":5984},{"p":"19858.6","s":5000},{"p":"19845.4","s":20864},{"p":"19859.1","s":0},{"p":"19862.5","s":0},{"p":"19358","s":0},{"p":"19864.5","s":5000},{"p":"19840.7","s":0},{"p":"19863.6","s":3100},{"p":"19839.3","s":0},{"p":"19851.5","s":8800},{"p":"19720","s":0},{"p":"19333","s":0},{"p":"19852.7","s":5000},{"p":"19861.5","s":0},{"p":"19860.6","s":3100},{"p":"19833.6","s":0},{"p":"19360","s":0},{"p":"19863.5","s":5000},{"p":"19736.9","s":0},{"p":"19838.5","s":0},{"p":"19841.3","s":0},{"p":"19858.1","s":3100},{"p":"19710.9","s":0},{"p":"19342","s":0},{"p":"19852.1","s":11967},{"p":"19343","s":0},{"p":"19705","s":0},{"p":"19836.5","s":0},{"p":"19862.6","s":3100},{"p":"19729.6","s":0},{"p":"19849.9","s":5000}],"a":[{"p":"19900.5","s":0},{"p":"19883.1","s":11967},{"p":"19910.9","s":0},{"p":"19897.7","s":5000},{"p":"19875.9","s":5984},{"p":"19899.6","s":0},{"p":"19878","s":4400},{"p":"19877.6","s":0},{"p":"19889.5","s":5000},{"p":"19875.5","s":3100},{"p":"19875.3","s":0},{"p":"19878.5","s":0},{"p":"19895.2","s":0},{"p":"20284.6","s":0},{"p":"19880.7","s":5000},{"p":"19875.4","s":0},{"p":"19985.8","s":0},{"p":"19887.1","s":5000},{"p":"19896","s":1},{"p":"19869.3","s":0},{"p":"19900","s":0},{"p":"19875.6","s":5000},{"p":"19980.6","s":0},{"p":"19885.1","s":5000},{"p":"19877.7","s":5000},{"p":"20000","s":0},{"p":"19892.2","s":8255},{"p":"19886.8","s":0},{"p":"20257.4","s":0},{"p":"20280","s":0},{"p":"20002.5","s":0},{"p":"20263.1","s":0},{"p":"19900.2","s":0}]}}
{"time":1678469467,"time_ms":1678469467981,"channel":"futures.candlesticks","event":"update","result":[{"t":1678469460,"v":0,"c":"19896","h":"19896","l":"19896","o":"19896","n":"1m_BTC_USD"}]}
{"time":1756700469,"channel":"futures.pong","event":"","result":null}