Skip to content

Commit

Permalink
Merge pull request #10 from valory-xyz/feat/service
Browse files Browse the repository at this point in the history
Create trader service
  • Loading branch information
Adamantios authored Jul 12, 2023
2 parents 95b5b6e + 42cfd89 commit dce9a82
Show file tree
Hide file tree
Showing 10 changed files with 495 additions and 162 deletions.
240 changes: 119 additions & 121 deletions .github/workflows/common_checks.yaml
Original file line number Diff line number Diff line change
@@ -1,121 +1,119 @@
#name: main_workflow
#
#on:
# push:
# branches:
# - develop
# - main
# pull_request:
#
#jobs:
# lock_check:
# continue-on-error: False
# runs-on: ${{ matrix.os }}
#
# strategy:
# matrix:
# os: [ ubuntu-latest, macos-latest, windows-latest ]
# python-version: [ "3.10" ]
# poetry-version: ["1.4.0"]
#
# timeout-minutes: 10
#
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
# - name: Install and configure Poetry
# uses: snok/install-poetry@v1
# with:
# version: ${{ matrix.poetry-version }}
# virtualenvs-create: true
# virtualenvs-in-project: false
# virtualenvs-path: ~/my-custom-path
# installer-parallel: true
#
# copyright_and_dependencies_check:
# continue-on-error: False
# runs-on: ${{ matrix.os }}
#
# strategy:
# matrix:
# os: [ ubuntu-latest ]
# python-version: [ "3.10" ]
#
# timeout-minutes: 30
#
# steps:
# - uses: actions/checkout@v3
# with:
# fetch-depth: 0
# - uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
# - name: Install dependencies
# run: pip install tomte[tox,cli]==0.2.12
# - name: Check copyright headers
# run: tomte check-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
# - name: License compatibility check
# run: tox -e liccheck
# - name: Check dependencies
# run: tox -e check-dependencies
# - name: Check doc links
# run: tomte check-doc-links
# - name: Check doc IPFS hashes
# run: tox -e check-doc-hashes
#
# linter_checks:
# continue-on-error: False
# runs-on: ${{ matrix.os }}
#
# strategy:
# matrix:
# os: [ ubuntu-latest ]
# python-version: [ "3.10" ]
#
# timeout-minutes: 30
#
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
# - name: Install dependencies
# run: |
# pip install tomte[tox,cli]==0.2.12
#
# # Install `mdspell` for spelling checks
# sudo npm install -g markdown-spellcheck
#
# - name: Check generate protocols
# run: tox -e check-generate-all-protocols
# - name: Security checks
# run: tomte check-security
# - name: Check packages
# run: tox -e check-packages
# - name: Check hash
# run: tox -e check-hash
# - name: Code checks
# run: tomte check-code
# - name: Check spelling
# run: tomte check-spelling
# - name: AbciApp consistency checks
# run: |
# tox -e check-abci-docstrings
# tox -e check-abciapp-specs
# tox -e check-handlers
# tox -e analyse-service
#
# scan:
# name: gitleaks
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# with:
# fetch-depth: 0
# - run: |
# wget https://github.com/zricethezav/gitleaks/releases/download/v8.10.1/gitleaks_8.10.1_linux_x64.tar.gz && \
# tar -xzf gitleaks_8.10.1_linux_x64.tar.gz && \
# sudo install gitleaks /usr/bin && \
# gitleaks detect --report-format json --report-path leak_report
name: main_workflow

on:
push:
branches:
- develop
- main
pull_request:

jobs:
lock_check:
continue-on-error: False
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
python-version: [ "3.10" ]
poetry-version: ["1.4.0"]

timeout-minutes: 10

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: ${{ matrix.poetry-version }}
virtualenvs-create: true
virtualenvs-in-project: false
virtualenvs-path: ~/my-custom-path
installer-parallel: true

copyright_and_dependencies_check:
continue-on-error: False
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ ubuntu-latest ]
python-version: [ "3.10" ]

timeout-minutes: 30

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install tomte[tox,cli]==0.2.12
- name: Check copyright headers
run: tomte check-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
- name: License compatibility check
run: tox -e liccheck
- name: Check dependencies
run: tox -e check-dependencies
- name: Check doc links
run: tomte check-doc-links
- name: Check doc IPFS hashes
run: tox -e check-doc-hashes

linter_checks:
continue-on-error: False
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ ubuntu-latest ]
python-version: [ "3.10" ]

timeout-minutes: 30

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install tomte[tox,cli]==0.2.12
# Install `mdspell` for spelling checks
sudo npm install -g markdown-spellcheck
- name: Security checks
run: tomte check-security
- name: Check packages
run: tox -e check-packages
- name: Check hash
run: tox -e check-hash
- name: Code checks
run: tomte check-code
- name: Check spelling
run: tomte check-spelling
- name: AbciApp consistency checks
run: |
tox -e check-abci-docstrings
tox -e check-abciapp-specs
tox -e check-handlers
tox -e analyse-service
scan:
name: gitleaks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: |
wget https://github.com/zricethezav/gitleaks/releases/download/v8.10.1/gitleaks_8.10.1_linux_x64.tar.gz && \
tar -xzf gitleaks_8.10.1_linux_x64.tar.gz && \
sudo install gitleaks /usr/bin && \
gitleaks detect --report-format json --report-path leak_report
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ leak_report
agent/
trader/
!/packages/valory/agents/trader/
!/packages/valory/services/trader/
22 changes: 11 additions & 11 deletions packages/packages.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"dev": {
"skill/valory/market_manager_abci/0.1.0": "bafybeicain3mpp5wi5dnlmvibpjcww4j3gbbgubkx2x6byb5rinyxrxmgm",
"skill/valory/decision_maker_abci/0.1.0": "bafybeicyjkkhftedfj2xbwstfnbtodnvnlg2gtazvfhfi3ehvtzrhmctaa",
"skill/valory/trader_abci/0.1.0": "bafybeidohsxvfbrt5h4jv2cg3mvnxqayvnjfsoqk2plgsbqhlcterqlwc4",
"contract/valory/market_maker/0.1.0": "bafybeibri3g2khx7prxkmcvlupqnojetysl3wfmjelqwynk7yvmy5gmruy",
"agent/valory/trader/0.1.0": "bafybeidj3nxm3njw3zz6tglngvmrzjbnhz3bmbnbta2r3dryj3xbseumue",
"service/valory/trader/0.1.0": "bafybeidc53mmontlq3gsuvnomamijq5xidtnzxket34stokmtyuod6tebi"
"skill/valory/market_manager_abci/0.1.0": "bafybeihosbo5jkviuy2bdgbt4gll3ba4hgxwgbkj6lup23z5wiopb7vf7q",
"skill/valory/decision_maker_abci/0.1.0": "bafybeia52wpwgnqxb3bm4mgbb5y2cq6lvuuhv2uvmfvsg6qglmrbfsdkru",
"skill/valory/trader_abci/0.1.0": "bafybeigpnlzqcktz6b43l4azljemu4lobsastxdzfdbzhukzctb5tusxly",
"contract/valory/market_maker/0.1.0": "bafybeifihhoertnx3itmfzbuf4lazclzjuctxurayajguyn7ggsddolhte",
"agent/valory/trader/0.1.0": "bafybeibuasbe47gl3nbo2wsvpzls5fpu5nmbsakuodc3hh3zbv65wwj26u",
"service/valory/trader/0.1.0": "bafybeieqtx6toktbm6injnm26maeiqtplyttcjp5xao6445fytaubkucdy"
},
"third_party": {
"protocol/open_aea/signing/1.0.0": "bafybeibqlfmikg5hk4phzak6gqzhpkt6akckx7xppbp53mvwt6r73h7tk4",
Expand All @@ -17,9 +17,9 @@
"protocol/valory/tendermint/0.1.0": "bafybeicusvezoqlmyt6iqomcbwaz3xkhk2qf3d56q5zprmj3xdxfy64k54",
"protocol/valory/ipfs/0.1.0": "bafybeic72ncgqbzoz2guj4p4yjqulid7mv6yroeh65hxznloamoveeg7hq",
"skill/valory/abstract_abci/0.1.0": "bafybeiff2dqnkeorf343fmb3547fhiznvdw4ewbwl4rqluek2cv6ibl5hi",
"skill/valory/reset_pause_abci/0.1.0": "bafybeidrupr6pesmkdwx6yq2po5z54elgh2wteyweohfaem4qgxlluklme",
"skill/valory/registration_abci/0.1.0": "bafybeifkjbbdrazpnl6uggwv44dwnbwtrw4o2be4buq7qbhwgctdqww4lq",
"skill/valory/abstract_round_abci/0.1.0": "bafybeifobajvcwzzvguf7o5wpr6p7mv433bwtiiabaqst2zdb7hqmcl7dy",
"skill/valory/reset_pause_abci/0.1.0": "bafybeibqz7y3i4aepuprhijwdydkcsbqjtpeea6gdzpp5fgc6abrvjz25a",
"skill/valory/registration_abci/0.1.0": "bafybeib6fsfur5jnflcveidnaeylneybwazewufzwa5twnwovdqgwtwsxm",
"skill/valory/abstract_round_abci/0.1.0": "bafybeiac62ennpw54gns2quk4g3yoaili2mb72nj6c52czobz5dcwj4mwi",
"connection/valory/abci/0.1.0": "bafybeihofnsokowicviac6yz3uhur52l3mf54s2hz4i2je5ie4vlruouga",
"connection/valory/http_client/0.23.0": "bafybeidykl4elwbcjkqn32wt5h4h7tlpeqovrcq3c5bcplt6nhpznhgczi",
"connection/valory/ledger/0.19.0": "bafybeicgfupeudtmvehbwziqfxiz6ztsxr5rxzvalzvsdsspzz73o5fzfi",
Expand All @@ -28,8 +28,8 @@
"contract/valory/gnosis_safe_proxy_factory/0.1.0": "bafybeiaa6fgwtykrti6i7sbt22raavpsbobsq2xgem4nkbcg744agnmkae",
"contract/valory/gnosis_safe/0.1.0": "bafybeif5fdwoxq5mscrurtuimadmtctyxxeeui45u4g6leqobzls7bsl3u",
"contract/valory/service_registry/0.1.0": "bafybeibdy55edqs3djptv77ljkmbf6m3zizhutmvwgj3hpsagvmzhr4jbm",
"skill/valory/transaction_settlement_abci/0.1.0": "bafybeigzuht2t6ueebxx567zkyx4om2dcrmx6cynu5gqtflh5bz7hbgahu",
"skill/valory/transaction_settlement_abci/0.1.0": "bafybeihdpac4ayfgop3ixflimlb3zzyeejlpqtljfptdak6tc7aq4u5fzi",
"contract/valory/multisend/0.1.0": "bafybeict2k3vf3c4fvzosaq5kku2ivtzsskbomrujmmoicut7eg52onnje",
"skill/valory/termination_abci/0.1.0": "bafybeidindokcjbpcqo5sx3vstabvv4nr4t4ifc4ikb4cdgab25nuefvm4"
"skill/valory/termination_abci/0.1.0": "bafybeieb3gnvjxxsh73g67m7rivzknwb63xu4qeagpkv7f4mqz33ecikem"
}
}
60 changes: 46 additions & 14 deletions packages/valory/agents/trader/aea-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ aea_version: '>=1.0.0, <2.0.0'
fingerprint:
README.md: bafybeiexvxghmwzokfocrlq6johtoz7dvpqm6gg6vmcapu43yjjfqc435q
__init__.py: bafybeighcq4pmuzte6vhvvprrvo563vzghkoit2h6qdqxf2ma5bghevkee
tests/__init__.py: bafybeihatrrk4q6f7iuhrump5q3x2rpk42hnnyusmpk3jd4bpgw4s6esta
tests/test_apy_estimation.py: bafybeibignn5sp3y5oc4jnon3uctjrj6zo527vd6j4ouqazsxr33tlpuqy
fingerprint_ignore_patterns: []
connections:
- valory/abci:0.1.0:bafybeihofnsokowicviac6yz3uhur52l3mf54s2hz4i2je5ie4vlruouga
Expand All @@ -18,7 +16,7 @@ connections:
- valory/p2p_libp2p_client:0.1.0:bafybeidwcobzb7ut3efegoedad7jfckvt2n6prcmd4g7xnkm6hp6aafrva
contracts:
- valory/service_registry:0.1.0:bafybeibdy55edqs3djptv77ljkmbf6m3zizhutmvwgj3hpsagvmzhr4jbm
- valory/market_maker:0.1.0:bafybeibri3g2khx7prxkmcvlupqnojetysl3wfmjelqwynk7yvmy5gmruy
- valory/market_maker:0.1.0:bafybeifihhoertnx3itmfzbuf4lazclzjuctxurayajguyn7ggsddolhte
protocols:
- open_aea/signing:1.0.0:bafybeibqlfmikg5hk4phzak6gqzhpkt6akckx7xppbp53mvwt6r73h7tk4
- valory/abci:0.1.0:bafybeig3dj5jhsowlvg3t73kgobf6xn4nka7rkttakdb2gwsg5bp7rt7q4
Expand All @@ -30,14 +28,14 @@ protocols:
- valory/tendermint:0.1.0:bafybeicusvezoqlmyt6iqomcbwaz3xkhk2qf3d56q5zprmj3xdxfy64k54
skills:
- valory/abstract_abci:0.1.0:bafybeiff2dqnkeorf343fmb3547fhiznvdw4ewbwl4rqluek2cv6ibl5hi
- valory/abstract_round_abci:0.1.0:bafybeifobajvcwzzvguf7o5wpr6p7mv433bwtiiabaqst2zdb7hqmcl7dy
- valory/registration_abci:0.1.0:bafybeifkjbbdrazpnl6uggwv44dwnbwtrw4o2be4buq7qbhwgctdqww4lq
- valory/reset_pause_abci:0.1.0:bafybeidrupr6pesmkdwx6yq2po5z54elgh2wteyweohfaem4qgxlluklme
- valory/termination_abci:0.1.0:bafybeidindokcjbpcqo5sx3vstabvv4nr4t4ifc4ikb4cdgab25nuefvm4
- valory/transaction_settlement_abci:0.1.0:bafybeigzuht2t6ueebxx567zkyx4om2dcrmx6cynu5gqtflh5bz7hbgahu
- valory/market_manager_abci:0.1.0:bafybeicain3mpp5wi5dnlmvibpjcww4j3gbbgubkx2x6byb5rinyxrxmgm
- valory/decision_maker_abci:0.1.0:bafybeicyjkkhftedfj2xbwstfnbtodnvnlg2gtazvfhfi3ehvtzrhmctaa
- valory/trader_abci:0.1.0:bafybeidohsxvfbrt5h4jv2cg3mvnxqayvnjfsoqk2plgsbqhlcterqlwc4
- valory/abstract_round_abci:0.1.0:bafybeiac62ennpw54gns2quk4g3yoaili2mb72nj6c52czobz5dcwj4mwi
- valory/registration_abci:0.1.0:bafybeib6fsfur5jnflcveidnaeylneybwazewufzwa5twnwovdqgwtwsxm
- valory/reset_pause_abci:0.1.0:bafybeibqz7y3i4aepuprhijwdydkcsbqjtpeea6gdzpp5fgc6abrvjz25a
- valory/termination_abci:0.1.0:bafybeieb3gnvjxxsh73g67m7rivzknwb63xu4qeagpkv7f4mqz33ecikem
- valory/transaction_settlement_abci:0.1.0:bafybeihdpac4ayfgop3ixflimlb3zzyeejlpqtljfptdak6tc7aq4u5fzi
- valory/market_manager_abci:0.1.0:bafybeihosbo5jkviuy2bdgbt4gll3ba4hgxwgbkj6lup23z5wiopb7vf7q
- valory/decision_maker_abci:0.1.0:bafybeia52wpwgnqxb3bm4mgbb5y2cq6lvuuhv2uvmfvsg6qglmrbfsdkru
- valory/trader_abci:0.1.0:bafybeigpnlzqcktz6b43l4azljemu4lobsastxdzfdbzhukzctb5tusxly
default_ledger: ethereum
required_ledgers:
- ethereum
Expand Down Expand Up @@ -98,10 +96,44 @@ models:
all_participants: ${list:["0x0000000000000000000000000000000000000000"]}
consensus_threshold: ${int:null}
safe_contract_address: ${str:0x0000000000000000000000000000000000000000}
cleanup_history_depth: ${int:1}
cleanup_history_depth_current: ${int:null}
finalize_timeout: ${float:60.0}
genesis_config:
genesis_time: ${str:2022-09-26T00:00:00.000000000Z}
chain_id: ${str:chain-c4daS1}
consensus_params:
block:
max_bytes: ${str:22020096}
max_gas: ${str:-1}
time_iota_ms: ${str:1000}
evidence:
max_age_num_blocks: ${str:100000}
max_age_duration: ${str:172800000000000}
max_bytes: ${str:1048576}
validator:
pub_key_types: ${list:["ed25519"]}
version: ${dict:{}}
voting_power: ${str:10}
init_fallback_gas: ${int:0}
keeper_allowed_retries: ${int:3}
keeper_timeout: ${float:30.0}
max_attempts: ${int:10}
reset_tendermint_after: ${int:2}
retry_attempts: ${int:400}
retry_timeout: ${int:3}
request_retry_delay: ${float:1.0}
request_timeout: ${float:10.0}
service_id: ${str:trader}
tendermint_url: ${str:http://localhost:26657}
tendermint_com_url: ${str:http://localhost:8080}
round_timeout_seconds: ${float:3650.0}
reset_pause_duration: ${int:3600}
tendermint_check_sleep_delay: ${int:3}
tendermint_max_retries: ${int:5}
tx_timeout: ${float:10.0}
round_timeout_seconds: ${float:120.0}
validate_timeout: ${int:1205}
history_check_timeout: ${int:1205}
reset_pause_duration: ${int:30}
max_healthcheck: ${int:43200}
multisend_address: ${str:0x0000000000000000000000000000000000000000}
drand_public_key: ${str:868f005eb8e6e4ca0a47c8a77ceaa5309a47978a7c71bc5cce96366b5d7a569937c529eeda66c7293784a9402801af31}
Expand All @@ -118,7 +150,7 @@ models:
opening_margin: ${int:300}
languages: ${list:["en_US"]}
mech_agent_id: ${int:3}
mech_tool: prediction-online
mech_tool: ${str:prediction-online}
bet_amount_per_threshold:
0.0: ${int:0}
0.1: ${int:0}
Expand Down
2 changes: 0 additions & 2 deletions packages/valory/contracts/market_maker/contract.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ fingerprint:
__init__.py: bafybeicoucixii3fv5xlpk3zfewm4ys4okidcng54bhtjxvwup7g2jcjza
build/FixedProductMarketMaker.json: bafybeigim7n3f67r5czfc5wp2m7cxzxwvnhxops3n5j2zlawenan7qrrtu
contract.py: bafybeicfiicuke4ly5hpcxtyvnob5bgzrqsopuxalruxp2m3w4koxmhrqa
tests/__init__.py: bafybeiel37q64d2i24nab4nt5qu3zfbqonyid2sbap2i4m6yvcpm7zl4iy
tests/test_contract.py: bafybeiapphtneb4ddpxmgxn2wius7ystafrnahkcbtlichwum4mlp7p7ze
fingerprint_ignore_patterns: []
contracts: []
class_name: FixedProductMarketMakerContract
Expand Down
Loading

0 comments on commit dce9a82

Please sign in to comment.