Skip to content

Commit

Permalink
adding precision to token prices
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberosa committed Nov 27, 2024
1 parent 1ee0ae6 commit e236a6c
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 15 deletions.
12 changes: 6 additions & 6 deletions packages/packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
"contract/valory/staking_token/0.1.0": "bafybeiep4r6qyilbfgzdvx6t7zvpgaioxqktmxm7puwtnbpb2ftlib43gy",
"contract/valory/relayer/0.1.0": "bafybeicawmds6czx7db2lcktvexwrp245jpekgulndtos5s5zdid3ilvq4",
"skill/valory/market_manager_abci/0.1.0": "bafybeihhosfhw3725txnae7ouch3wixpuigv6litz2q7o7r5gznyinpsjy",
"skill/valory/decision_maker_abci/0.1.0": "bafybeib6xqa6p2jehvjqr4skivjlf5iv4ijddeztpyo6tjsuajrotymswa",
"skill/valory/trader_abci/0.1.0": "bafybeiharh25ymk4h77nhugc4msfjun6er4kvh3v2f3unkeykx3enlo3nm",
"skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeichmzogvjpdh3ggzyhxesukaox5htflamonohr6wyxd6gq4uzohoa",
"skill/valory/decision_maker_abci/0.1.0": "bafybeiboc5pkrlyphacvehl65itnb3r5a77xemfcjfvgivagycq3j7cd4a",
"skill/valory/trader_abci/0.1.0": "bafybeihtsoqhgm3ftrdu77rbz2lxh7yxwgkjalre2r73suvigqxkdz7jiy",
"skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeiaoc6snzvzjdb2dh74yxucxondwbh7zcglq3ciluj37m3fcuozdgm",
"skill/valory/staking_abci/0.1.0": "bafybeictd5pxhscuhqntvctb7l5lfjausxt2m22rg5mkaiuj4cwwcxpvne",
"skill/valory/check_stop_trading_abci/0.1.0": "bafybeifmi64g4ki6zwbcncb35ovhd4sllw4xrszrkturpeqdhgf5bkiini",
"agent/valory/trader/0.1.0": "bafybeifkxprkfhlgvky3f46qayfgn3n2km5sys37drjtfvg6zpr2ajwyqq",
"service/valory/trader/0.1.0": "bafybeigey2wvtru3zb6dphmuhgfhrgiayk7j5yvef56ihkd43i5x2npc6m",
"service/valory/trader_pearl/0.1.0": "bafybeiak4rtegnd5erbd5gg2dtarxfqgsyaaxfwakkgxmag4bfhwhiniqa"
"agent/valory/trader/0.1.0": "bafybeihid2nprmrwmzdnhioycd47wbpo74kqjuqmrtxxfzwhfaa3sogbsy",
"service/valory/trader/0.1.0": "bafybeifxugwcb7ekv3ogrxkqwhd5fty24nmmoa77vay5zmb25kbi3tebye",
"service/valory/trader_pearl/0.1.0": "bafybeihszb4x6ihisbhdidy5gb6ir4rlvven4xcgyynp4cuuvmh5xno74q"
},
"third_party": {
"protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi",
Expand Down
6 changes: 3 additions & 3 deletions packages/valory/agents/trader/aea-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ skills:
- valory/reset_pause_abci:0.1.0:bafybeigrdlxed3xlsnxtjhnsbl3cojruihxcqx4jxhgivkd5i2fkjncgba
- valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm
- valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae
- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeichmzogvjpdh3ggzyhxesukaox5htflamonohr6wyxd6gq4uzohoa
- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeiaoc6snzvzjdb2dh74yxucxondwbh7zcglq3ciluj37m3fcuozdgm
- valory/market_manager_abci:0.1.0:bafybeihhosfhw3725txnae7ouch3wixpuigv6litz2q7o7r5gznyinpsjy
- valory/decision_maker_abci:0.1.0:bafybeib6xqa6p2jehvjqr4skivjlf5iv4ijddeztpyo6tjsuajrotymswa
- valory/trader_abci:0.1.0:bafybeiharh25ymk4h77nhugc4msfjun6er4kvh3v2f3unkeykx3enlo3nm
- valory/decision_maker_abci:0.1.0:bafybeiboc5pkrlyphacvehl65itnb3r5a77xemfcjfvgivagycq3j7cd4a
- valory/trader_abci:0.1.0:bafybeihtsoqhgm3ftrdu77rbz2lxh7yxwgkjalre2r73suvigqxkdz7jiy
- valory/staking_abci:0.1.0:bafybeictd5pxhscuhqntvctb7l5lfjausxt2m22rg5mkaiuj4cwwcxpvne
- valory/check_stop_trading_abci:0.1.0:bafybeifmi64g4ki6zwbcncb35ovhd4sllw4xrszrkturpeqdhgf5bkiini
- valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm
Expand Down
2 changes: 1 addition & 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:bafybeifkxprkfhlgvky3f46qayfgn3n2km5sys37drjtfvg6zpr2ajwyqq
agent: valory/trader:0.1.0:bafybeihid2nprmrwmzdnhioycd47wbpo74kqjuqmrtxxfzwhfaa3sogbsy
number_of_agents: 4
deployment:
agent:
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/services/trader_pearl/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license: Apache-2.0
fingerprint:
README.md: bafybeibg7bdqpioh4lmvknw3ygnllfku32oca4eq5pqtvdrdsgw6buko7e
fingerprint_ignore_patterns: []
agent: valory/trader:0.1.0:bafybeifkxprkfhlgvky3f46qayfgn3n2km5sys37drjtfvg6zpr2ajwyqq
agent: valory/trader:0.1.0:bafybeihid2nprmrwmzdnhioycd47wbpo74kqjuqmrtxxfzwhfaa3sogbsy
number_of_agents: 1
deployment:
agent:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ def _compute_scaled_liquidity_measure(
) -> float:
"""Function to compute the scaled liquidity measure from token amounts and prices"""
precision = 8
token_prices = [round(x, precision) for x in token_prices]
return round(
sum(amount * price for amount, price in zip(token_amounts, token_prices))
/ (10**18),
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/skills/decision_maker_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fingerprint:
behaviours/blacklisting.py: bafybeifitqx2omj5qdwokizhqjkxvybtsyxo22dxkucbtxaocafzgbseku
behaviours/check_benchmarking.py: bafybeiao2lyj7apezkqrpgsyzb3dwvrdgsrgtprf6iuhsmlsufvxfl5bci
behaviours/claim_subscription.py: bafybeigbqkhc6mb73rbwaks32tfiqx6u2xza43uiy6rvbtrnqd6m4fru3e
behaviours/decision_receive.py: bafybeiax4jzw7my3zymk4y6vkiht237x3nyiizhewpkwvp36h3yuw5utkq
behaviours/decision_receive.py: bafybeifkhoat7xu7okraegqfca3f2ddclvtytsio2rqcjc22kkvyk54coa
behaviours/decision_request.py: bafybeibytikxjg7bdblrr73ghimsxad6snzahzwyyrxs2mdo462mct2vm4
behaviours/handle_failed_tx.py: bafybeidxpc6u575ymct5tdwutvzov6zqfdoio5irgldn3fw7q3lg36mmxm
behaviours/order_subscription.py: bafybeicrmdvhci5prfldvuf3bclbbqi6j7lpv6hmphw3qwgmkmwat3od44
Expand Down
4 changes: 2 additions & 2 deletions packages/valory/skills/trader_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ skills:
- valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae
- valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm
- valory/market_manager_abci:0.1.0:bafybeihhosfhw3725txnae7ouch3wixpuigv6litz2q7o7r5gznyinpsjy
- valory/decision_maker_abci:0.1.0:bafybeib6xqa6p2jehvjqr4skivjlf5iv4ijddeztpyo6tjsuajrotymswa
- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeichmzogvjpdh3ggzyhxesukaox5htflamonohr6wyxd6gq4uzohoa
- valory/decision_maker_abci:0.1.0:bafybeiboc5pkrlyphacvehl65itnb3r5a77xemfcjfvgivagycq3j7cd4a
- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeiaoc6snzvzjdb2dh74yxucxondwbh7zcglq3ciluj37m3fcuozdgm
- valory/staking_abci:0.1.0:bafybeictd5pxhscuhqntvctb7l5lfjausxt2m22rg5mkaiuj4cwwcxpvne
- valory/check_stop_trading_abci:0.1.0:bafybeifmi64g4ki6zwbcncb35ovhd4sllw4xrszrkturpeqdhgf5bkiini
- valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ protocols:
- valory/ledger_api:1.0.0:bafybeihdk6psr4guxmbcrc26jr2cbgzpd5aljkqvpwo64bvaz7tdti2oni
skills:
- valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u
- valory/decision_maker_abci:0.1.0:bafybeib6xqa6p2jehvjqr4skivjlf5iv4ijddeztpyo6tjsuajrotymswa
- valory/decision_maker_abci:0.1.0:bafybeiboc5pkrlyphacvehl65itnb3r5a77xemfcjfvgivagycq3j7cd4a
- valory/staking_abci:0.1.0:bafybeictd5pxhscuhqntvctb7l5lfjausxt2m22rg5mkaiuj4cwwcxpvne
- valory/mech_interact_abci:0.1.0:bafybeid6m3i5ofq7vuogqapdnoshhq7mswmudhvfcr2craw25fdwtoe3lm
behaviours:
Expand Down

0 comments on commit e236a6c

Please sign in to comment.