Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate graph endpoints #107

Merged
merged 3 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"contract/valory/fpmm/0.1.0": "bafybeiai2ruj27nnglvn7yc5atojyojo3fkmofw6wrjgz2ybps2uwdizx4",
"skill/valory/market_creation_manager_abci/0.1.0": "bafybeibg5r6nfsc6vriijjkwx7k5banxdalwl4umu5ggjbwrselvgs2z7u",
"skill/valory/market_maker_abci/0.1.0": "bafybeidindpjfmasok5bpjujaytbqhtvsu6sp5fxlu2i2rwt2hhk66ytye",
"agent/valory/market_maker/0.1.0": "bafybeictoxyqhimwypessy4nnmup65qq6t3umej2dyhv7w6ryn4zsavnta",
"service/valory/market_maker/0.1.0": "bafybeif3v4polc33v4snzsnhwdb5dcwbjg4jdth5ifre3hyjomtn73zioi"
"agent/valory/market_maker/0.1.0": "bafybeie4xnbsq32waqc5scvhgyg5nttalo7klfijf53bwaxo5u44nrqlbq",
"service/valory/market_maker/0.1.0": "bafybeibsrih6fw4f4v6jqq7thhovepg7zel2ei6wz4ngpquxdldr2lx7iq"
},
"third_party": {
"protocol/valory/contract_api/1.0.0": "bafybeidgu7o5llh26xp3u3ebq3yluull5lupiyeu6iooi2xyymdrgnzq5i",
Expand Down
25 changes: 25 additions & 0 deletions packages/valory/agents/market_maker/aea-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -220,4 +220,29 @@ models:
openai_api_key: ${str:openai_api_key}
mech_contract_address: ${str:0x77af31de935740567cf4ff1986d04b2c964a786a}
answer_retry_intervals: ${list:[0, 86400, 259200, 604800, 1209600]}
randomness_api:
args:
method: ${str:GET}
response_key: ${str:null}
response_type: ${str:dict}
jmoreira-valory marked this conversation as resolved.
Show resolved Hide resolved
retries: ${int:5}
url: ${str:https://drand.cloudflare.com/public/latest}
mech_response:
args:
headers:
Content-Type: ${str:application/json}
method: ${str:GET}
response_key: ${str:result}
response_type: ${str:str}
retries: ${int:5}
url: ${str:''}
omen_subgraph:
args:
headers:
Content-Type: ${str:application/json}
method: ${str:POST}
response_key: ${str:data:fixedProductMarketMakers}
response_type: ${str:list}
retries: ${int:5}
url: ${str:https://api.thegraph.com/subgraphs/name/protofire/omen-xdai}
is_abstract: false
27 changes: 26 additions & 1 deletion packages/valory/services/market_maker/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license: Apache-2.0
fingerprint:
README.md: bafybeibwz3af6326msp4h3kqehijvmyhaytvyfbo3o2npc2w4b6zrg6pfq
fingerprint_ignore_patterns: []
agent: valory/market_maker:0.1.0:bafybeictoxyqhimwypessy4nnmup65qq6t3umej2dyhv7w6ryn4zsavnta
agent: valory/market_maker:0.1.0:bafybeie4xnbsq32waqc5scvhgyg5nttalo7klfijf53bwaxo5u44nrqlbq
number_of_agents: 1
deployment:
agent:
Expand Down Expand Up @@ -106,6 +106,31 @@ models:
google_api_key: ${GOOGLE_API_KEY:str:google_api_key}
google_engine_id: ${GOOGLE_ENGINE_ID:str:google_engine_id}
openai_api_key: ${OPENAI_API_KEY:str:openai_api_key}
randomness_api:
args:
method: ${RANDOMNESS_API_METHOD:str:GET}
response_key: ${RANDOMNESS_API_RESPONSE_KEY:str:null}
response_type: ${RANDOMNESS_API_RESPONSE_TYPE:str:dict}
retries: ${RANDOMNESS_API_RETRIES:int:5}
url: ${RANDOMNESS_API_URL:str:https://drand.cloudflare.com/public/latest}
mech_response:
args:
headers:
Content-Type: ${MECH_RESPONSE_API_CONTENT_TYPE:str:application/json}
method: ${MECH_RESPONSE_API_METHOD:str:GET}
response_key: ${MECH_RESPONSE_API_RESPONSE_KEY:str:result}
response_type: ${MECH_RESPONSE_API_RESPONSE_TYPE:str:str}
retries: ${MECH_RESPONSE_API_RETRIES:int:5}
url: ${MECH_RESPONSE_API_URL:str:''}
omen_subgraph:
args:
headers:
Content-Type: ${OMEN_SUBGRAPH_CONTENT_TYPE:str:application/json}
method: ${OMEN_SUBGRAPH_METHOD:str:POST}
response_key: ${OMEN_SUBGRAPH_RESPONSE_KEY:str:data:fixedProductMarketMakers}
response_type: ${OMEN_SUBGRAPH_RESPONSE_TYPE:str:list}
retries: ${OMEN_SUBGRAPH_RETRIES:int:5}
url: ${OMEN_SUBGRAPH_URL:str:https://api.thegraph.com/subgraphs/name/protofire/omen-xdai}
---
public_id: valory/ledger:0.19.0
type: connection
Expand Down
3 changes: 2 additions & 1 deletion scripts/list_finalizing_markets.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"import json\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import os\n",
"import pandas as pd\n",
"import pytz\n",
"import requests\n",
Expand Down Expand Up @@ -397,7 +398,7 @@
"\n",
"\n",
"def _execute_fpmm_query() -> Dict[str, Any]:\n",
" url = \"https://api.thegraph.com/subgraphs/name/protofire/omen-xdai\"\n",
" url = os.getenv('OMEN_SUBGRAPH_URL', 'https://api.thegraph.com/subgraphs/name/protofire/omen-xdai')\n",
"\n",
" all_markets = []\n",
" creationTimestamp_gt = \"0\"\n",
Expand Down
5 changes: 4 additions & 1 deletion scripts/omen_subgraph_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"""Script for retrieving Omen markets."""

import json
import os
import time
from datetime import datetime
from enum import Enum
Expand All @@ -33,7 +34,9 @@
TEXT_ALIGNMENT = 30
MINIMUM_WRITE_FILE_DELAY_SECONDS = 20
FPMMS_JSON_PATH = "fpmms.json"
THEGRAPH_ENDPOINT = "https://api.thegraph.com/subgraphs/name/protofire/omen-xdai"
THEGRAPH_ENDPOINT = os.getenv(
"OMEN_SUBGRAPH_URL", "https://api.thegraph.com/subgraphs/name/protofire/omen-xdai"
)

FPMMS_QUERY = """
query fpmms_query($creator: Bytes, $id_gt: ID) {
Expand Down
Loading