Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
exchange-binance
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhangheng
exchange-binance
Commits
12dd5b6b
Commit
12dd5b6b
authored
Jun 02, 2023
by
wangfa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
合约价格同步
parent
de2d1e6c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
3 deletions
+1
-3
um_price_stream.py
+1
-3
No files found.
um_price_stream.py
View file @
12dd5b6b
...
...
@@ -4,7 +4,6 @@ from db.redis_db import RedisClientLocal
SOCKET
=
"wss://fstream.binance.com/ws"
SUBSCRIBE_MESSAGE
=
"{
\"
method
\"
:
\"
SUBSCRIBE
\"
,
\"
params
\"
:[
\"
!markPrice@arr
\"
]}"
MARK_PRICES
=
{}
def
on_open
(
ws
):
...
...
@@ -19,9 +18,8 @@ def on_close(ws):
def
on_message
(
ws
,
message
):
message
=
json
.
loads
(
message
)
for
item
in
message
:
print
(
item
)
MARK_PRICES
[
item
[
"s"
]]
=
item
[
"p"
]
redis_con
.
con
()
.
set
(
f
"laravel_cache:premium-price:binance:{item['s']}"
,
item
[
'p'
])
print
(
"保存成功"
)
...
...
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