-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
64 lines (51 loc) · 1.94 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import requests
import json
from binance.spot import Spot
from decouple import config
API=config('API')
client = Spot()
url = "https://beta.api.solanalysis.com/rest/get-project-stats"
def get_price():
payload = json.dumps({
"conditions": {
"project_ids": [
"degenboyzdao1"
]
}
})
headers = { 'Authorization': API, 'Content-Type': 'application/json'}
original = requests.request("POST", url, headers=headers, data=payload)
payload = json.dumps({
"conditions": {
"project_ids": [
"9a8JV3n2N3vMfGKcV1gj89Pf34ZaKrZqkMs8VpEbhjKJ"
]
}
})
headers = { 'Authorization': API, 'Content-Type': 'application/json'}
radiated1 = requests.request("POST", url, headers=headers, data=payload)
payload = json.dumps({
"conditions": {
"project_ids": [
"kgPFYXgAzNje2z9NBTCyRx3uXkqXq2JMwxkW5cQtWDC"
]
}
})
headers = { 'Authorization': API, 'Content-Type': 'application/json'}
radiated2 = requests.request("POST", url, headers=headers, data=payload)
payload = json.dumps({
"conditions": {
"project_ids": [
"GfdmASNhXMdEBHcbABAzzWhsBfGtUuYABFezfV28xvvN"
]
}
})
headers = { 'Authorization': API, 'Content-Type': 'application/json'}
pharos = requests.request("POST", url, headers=headers, data=payload)
return original.json()["project_stats"][0]["floor_price"], radiated1.json()["project_stats"][0]["floor_price"], radiated2.json()["project_stats"][0]["floor_price"], pharos.json()["project_stats"][0]["floor_price"]
def get_sol():
link = "https://api.coingecko.com/api/v3/simple/price?ids=solana&vs_currencies=usd"
solana = requests.request("GET", link).json()["solana"]["usd"]
link = "https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd"
bitcoin = requests.request("GET", link).json()["bitcoin"]["usd"]
return bitcoin, solana