Skip to content

Commit

Permalink
Merge pull request #275 from valory-xyz/feat/configurable-api-specs
Browse files Browse the repository at this point in the history
Make all the api specs configurable
  • Loading branch information
Adamantios authored Jun 12, 2024
2 parents 04f46fa + 3562253 commit 943b8ee
Show file tree
Hide file tree
Showing 5 changed files with 179 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ security:
.PHONY: generators
generators: clean-cache fix-abci-app-specs
tox -e abci-docstrings
tomte format-copyright --author valory --exclude-part abci --exclude-part http_client --exclude-part ipfs --exclude-part ledger --exclude-part p2p_libp2p_client --exclude-part gnosis_safe --exclude-part gnosis_safe_proxy_factory --exclude-part multisend --exclude-part service_registry --exclude-part protocols --exclude-part abstract_abci --exclude-part abstract_round_abci --exclude-part registration_abci --exclude-part reset_pause_abci --exclude-part termination_abci --exclude-part transaction_settlement_abci --exclude-part websocket_client --exclude-part contract_subscription --exclude-part mech --exclude-part mech_interact_abci
tomte format-copyright --author valory --exclude-part abci --exclude-part http_client --exclude-part ipfs --exclude-part ledger --exclude-part p2p_libp2p_client --exclude-part gnosis_safe --exclude-part gnosis_safe_proxy_factory --exclude-part multisend --exclude-part service_registry --exclude-part protocols --exclude-part abstract_abci --exclude-part abstract_round_abci --exclude-part registration_abci --exclude-part reset_pause_abci --exclude-part termination_abci --exclude-part transaction_settlement_abci --exclude-part websocket_client --exclude-part contract_subscription --exclude-part mech --exclude-part mech_interact_abci --exclude-part http_server
autonomy packages lock
tox -e fix-doc-hashes

Expand Down
4 changes: 2 additions & 2 deletions packages/packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeiaybhcckjudnmelw3vc4mhw7fmydisyguanvlb2h6kdbhke3kjsvi",
"skill/valory/staking_abci/0.1.0": "bafybeigo7bicej5t2rbki37cmcwkzgwpcnopokn7ijhylmkihsbqw47xr4",
"skill/valory/check_stop_trading_abci/0.1.0": "bafybeickfeuqlpmryegnfvfu2duk2v4ycowwloohu3xxrafd5md6xl5swi",
"agent/valory/trader/0.1.0": "bafybeiczhuenxymwnoankdarwogerydxmzkjeefe6anokksaok25dto6nu",
"service/valory/trader/0.1.0": "bafybeih3l6tcadclvaumuvgyle3jgt52d6o7s5rb4r34tfmzsic25bmwje"
"agent/valory/trader/0.1.0": "bafybeif4ssbi37xitim37xrhy3s2udsh3urxz4qcedb4zld5qqhsnyssqm",
"service/valory/trader/0.1.0": "bafybeigjo346bffktt4hyiycvrmx2yjsn26pma2zvycio6bka3vui7g244"
},
"third_party": {
"protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi",
Expand Down
71 changes: 71 additions & 0 deletions packages/valory/agents/trader/aea-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,77 @@ models:
part_prefix_mode: ${bool:true}
bet_amount_field: ${str:collateral_amount}
results_filename: ${str:benchmarking_results.csv}
network_subgraph:
args:
headers:
Content-Type: ${str:application/json}
method: ${str:POST}
response_key: ${str:data:blocks}
response_index: ${int:0}
response_type: ${str:dict}
retries: ${int:5}
url: ${str:https://api.thegraph.com/subgraphs/name/stakewise/ethereum-gnosis}
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}
randomness_api:
args:
method: ${str:GET}
response_key: ${str:null}
response_type: ${str:dict}
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:''}
agent_tools:
args:
headers:
Content-Type: ${str:application/json}
method: ${str:GET}
response_key: ${str:tools}
response_type: ${str:list}
retries: ${int:5}
url: ${str:''}
trades_subgraph:
args:
headers:
Content-Type: ${str:application/json}
method: ${str:POST}
response_key: ${str:data:fpmmTrades}
response_type: ${str:list}
retries: ${int:5}
url: ${str:https://api.thegraph.com/subgraphs/name/protofire/omen-xdai}
conditional_tokens_subgraph:
args:
headers:
Content-Type: ${str:application/json}
method: ${str:POST}
response_key: ${str:data:user:userPositions}
response_type: ${str:list}
retries: ${int:5}
url: ${str:https://api.thegraph.com/subgraphs/name/gnosis/conditional-tokens-gc}
realitio_subgraph:
args:
headers:
Content-Type: ${str:application/json}
method: ${str:POST}
response_key: ${str:data:answers}
response_type: ${str:list}
retries: ${int:5}
url: ${str:https://api.thegraph.com/subgraphs/name/realityeth/realityeth-gnosis}
---
public_id: valory/p2p_libp2p_client:0.1.0
type: connection
Expand Down
97 changes: 96 additions & 1 deletion packages/valory/services/trader/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: bafybeigtuothskwyvrhfosps2bu6suauycolj67dpuxqvnicdrdu7yhtvq
fingerprint_ignore_patterns: []
agent: valory/trader:0.1.0:bafybeiczhuenxymwnoankdarwogerydxmzkjeefe6anokksaok25dto6nu
agent: valory/trader:0.1.0:bafybeif4ssbi37xitim37xrhy3s2udsh3urxz4qcedb4zld5qqhsnyssqm
number_of_agents: 4
deployment:
agent:
Expand Down Expand Up @@ -161,6 +161,77 @@ type: skill
part_prefix_mode: ${BENCHMARKING_MODE_PART_PREFIX_MODE:bool:true}
bet_amount_field: ${BENCHMARKING_MODE_BET_AMOUNT_FIELD:str:collateral_amount}
results_filename: ${BENCHMARKING_MODE_RESULTS_FILENAME:str:benchmarking_results.csv}
network_subgraph: &id005
args:
headers:
Content-Type: ${NETWORK_SUBGRAPH_CONTENT_TYPE:str:application/json}
method: ${NETWORK_SUBGRAPH_METHOD:str:POST}
response_key: ${NETWORK_SUBGRAPH_RESPONSE_KEY:str:data:blocks}
response_index: ${NETWORK_SUBGRAPH_RESPONSE_INDEX:int:0}
response_type: ${NETWORK_SUBGRAPH_RESPONSE_TYPE:str:dict}
retries: ${NETWORK_SUBGRAPH_RETRIES:int:5}
url: ${NETWORK_SUBGRAPH_URL:str:https://api.thegraph.com/subgraphs/name/stakewise/ethereum-gnosis}
omen_subgraph: &id006
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}
randomness_api: &id007
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: &id008
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:''}
agent_tools: &id009
args:
headers:
Content-Type: ${AGENT_TOOLS_API_CONTENT_TYPE:str:application/json}
method: ${AGENT_TOOLS_API_METHOD:str:GET}
response_key: ${AGENT_TOOLS_API_RESPONSE_KEY:str:tools}
response_type: ${AGENT_TOOLS_API_RESPONSE_TYPE:str:list}
retries: ${AGENT_TOOLS_API_RETRIES:int:5}
url: ${AGENT_TOOLS_API_URL:str:''}
trades_subgraph: &id010
args:
headers:
Content-Type: ${TRADES_SUBGRAPH_CONTENT_TYPE:str:application/json}
method: ${TRADES_SUBGRAPH_METHOD:str:POST}
response_key: ${TRADES_SUBGRAPH_RESPONSE_KEY:str:data:fpmmTrades}
response_type: ${TRADES_SUBGRAPH_RESPONSE_TYPE:str:list}
retries: ${TRADES_SUBGRAPH_RETRIES:int:5}
url: ${TRADES_SUBGRAPH_URL:str:https://api.thegraph.com/subgraphs/name/protofire/omen-xdai}
conditional_tokens_subgraph: &id011
args:
headers:
Content-Type: ${CONDITIONAL_TOKENS_SUBGRAPH_CONTENT_TYPE:str:application/json}
method: ${CONDITIONAL_TOKENS_SUBGRAPH_METHOD:str:POST}
response_key: ${CONDITIONAL_TOKENS_SUBGRAPH_RESPONSE_KEY:str:data:user:userPositions}
response_type: ${CONDITIONAL_TOKENS_SUBGRAPH_RESPONSE_TYPE:str:list}
retries: ${CONDITIONAL_TOKENS_SUBGRAPH_RETRIES:int:5}
url: ${CONDITIONAL_TOKENS_SUBGRAPH_URL:str:https://api.thegraph.com/subgraphs/name/gnosis/conditional-tokens-gc}
realitio_subgraph: &id012
args:
headers:
Content-Type: ${REALITIO_SUBGRAPH_CONTENT_TYPE:str:application/json}
method: ${REALITIO_SUBGRAPH_METHOD:str:POST}
response_key: ${REALITIO_SUBGRAPH_RESPONSE_KEY:str:data:answers}
response_type: ${REALITIO_SUBGRAPH_RESPONSE_TYPE:str:list}
retries: ${REALITIO_SUBGRAPH_RETRIES:int:5}
url: ${REALITIO_SUBGRAPH_URL:str:https://api.thegraph.com/subgraphs/name/realityeth/realityeth-gnosis}
1:
models:
params:
Expand Down Expand Up @@ -264,6 +335,14 @@ type: skill
rpc_sleep_time: ${RPC_SLEEP_TIME:int:10}
mech_interaction_sleep_time: ${MECH_INTERACTION_SLEEP_TIME:int:10}
benchmark_tool: *id004
network_subgraph: *id005
omen_subgraph: *id006
randomness_api: *id007
mech_response: *id008
agent_tools: *id009
trades_subgraph: *id010
conditional_tokens_subgraph: *id011
realitio_subgraph: *id012
2:
models:
params:
Expand Down Expand Up @@ -367,6 +446,14 @@ type: skill
rpc_sleep_time: ${RPC_SLEEP_TIME:int:10}
mech_interaction_sleep_time: ${MECH_INTERACTION_SLEEP_TIME:int:10}
benchmark_tool: *id004
network_subgraph: *id005
omen_subgraph: *id006
randomness_api: *id007
mech_response: *id008
agent_tools: *id009
trades_subgraph: *id010
conditional_tokens_subgraph: *id011
realitio_subgraph: *id012
3:
models:
params:
Expand Down Expand Up @@ -470,6 +557,14 @@ type: skill
rpc_sleep_time: ${RPC_SLEEP_TIME:int:10}
mech_interaction_sleep_time: ${MECH_INTERACTION_SLEEP_TIME:int:10}
benchmark_tool: *id004
network_subgraph: *id005
omen_subgraph: *id006
randomness_api: *id007
mech_response: *id008
agent_tools: *id009
trades_subgraph: *id010
conditional_tokens_subgraph: *id011
realitio_subgraph: *id012
---
public_id: valory/ledger:0.19.0
type: connection
Expand Down
18 changes: 9 additions & 9 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 943b8ee

Please sign in to comment.