File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 21
21
"""This script queries the OMEN subgraph to obtain the trades of a given address."""
22
22
23
23
import datetime
24
+ import os
24
25
import sys
25
26
from argparse import ArgumentParser
26
27
from collections import defaultdict
28
+ from dotenv import load_dotenv
29
+ from pathlib import Path
27
30
from string import Template
28
31
from typing import Any
29
32
38
41
FPMM_CREATOR = "0x89c5cc945dd550bcffb72fe42bff002429f46fec"
39
42
DEFAULT_FROM_DATE = "1970-01-01T00:00:00"
40
43
DEFAULT_TO_DATE = "2038-01-19T03:14:07"
44
+ SCRIPT_PATH = Path (__file__ ).resolve ().parent
45
+ STORE_PATH = Path (SCRIPT_PATH , ".trader_runner" )
46
+ ENV_FILE = Path (STORE_PATH , ".env" )
47
+
48
+ load_dotenv (ENV_FILE )
41
49
42
50
43
51
headers = {
@@ -167,7 +175,8 @@ def _query_omen_xdai_subgraph(
167
175
fpmm_to_timestamp : float ,
168
176
) -> dict [str , Any ]:
169
177
"""Query the subgraph."""
170
- url = "https://api.thegraph.com/subgraphs/name/protofire/omen-xdai"
178
+ subgraph_api_key = os .getenv ('SUBGRAPH_API_KEY' )
179
+ url = f"https://gateway-arbitrum.network.thegraph.com/api/{ subgraph_api_key } /subgraphs/id/9fUVQpFwzpdWS9bq5WkAnmKbNNcoBwatMR4yZq81pbbz"
171
180
172
181
grouped_results = defaultdict (list )
173
182
id_gt = ""
You can’t perform that action at this time.
0 commit comments