From 0153504510062c651783b891f8b4d688c096c0dd Mon Sep 17 00:00:00 2001 From: Adamantios Date: Mon, 30 Oct 2023 15:31:58 +0200 Subject: [PATCH 1/2] docs: write an advanced usage section --- README.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/README.md b/README.md index 839e00a1..0eab7888 100644 --- a/README.md +++ b/README.md @@ -144,3 +144,45 @@ Execute the following steps in a PowerShell terminal: 8. Open [Docker Desktop](https://www.docker.com/products/docker-desktop/) and leave it opened in the background. Now, open a Git Bash terminal and follow the instructions in the "[Run the script](#run-the-script)" section as well as the subsequent sections. You might need to install Microsoft Visual C++ 14.0 or greater. + +## Advanced usage + +In this chapter, we invite you to dive deeper into our service's capabilities. +Tailored for enthusiasts eager to customize and optimize, this section empowers you to make nuanced adjustments, +enhancing your experience to match unique requirements. + +##### Policy weights + +This script automatically sets some default weights to the agent's policy as a warm start +to help convergence and improve tool selection. +These data were obtained after many days of running the service and are set +[here](https://github.com/valory-xyz/trader-quickstart/blob/0f093ebbf0857b8484a017912c3992f00fbe1a29/run_service.sh#L133-L137). +As a result, the current weights are always deleted and replaced by this strategy +which is considered to boost the initial performance of the service. + +However, you may have found better performing policy weights and would like to remove this logic. +It can easily be done, by removing this method call, +[here](https://github.com/valory-xyz/trader-quickstart/blob/0f093ebbf0857b8484a017912c3992f00fbe1a29/run_service.sh#L698), +in order to set your own custom warm start. +Setting your own custom weights can be done by editing the corresponding files in `.trader_runner`. +Moreover, you may store your current policy as a backup before editing those files, using the following command: + +```shell +cp ".trader_runner/available_tools_store.json" ".trader_runner/available_tools_store_$(date +"%d-%m-%Y")".json +``` + +##### Tool selection + +Sometimes, a mech tool might temporarily misbehave. +As a result, the service would end up performing mech calls without being able to use the response. +Assuming that this tool has a large reward rate in the policy weights, +the service might end up spending a considerable amount of xDAI before adjusting the tool's reward rate, +without making any progress. +If a tool is temporarily misbehaving, you could use an environment variable in order to exclude it. +This environment variable is defined +[here](https://github.com/valory-xyz/trader/blob/v0.8.0/packages/valory/services/trader/service.yaml#L109-L112) +and can be overriden by setting it anywhere in the `run_service.sh` script with a new value, e.g.: + +```shell +IRRELEVANT_TOOLS=["some-misbehaving-tool", "openai-text-davinci-002", "openai-text-davinci-003", "openai-gpt-3.5-turbo", "openai-gpt-4", "stabilityai-stable-diffusion-v1-5", "stabilityai-stable-diffusion-xl-beta-v2-2-2", "stabilityai-stable-diffusion-512-v2-1", "stabilityai-stable-diffusion-768-v2-1"] +``` From 553bd7e17da3438979fc86cc29f5248b05603a13 Mon Sep 17 00:00:00 2001 From: Adamantios Zaras Date: Mon, 30 Oct 2023 16:56:16 +0200 Subject: [PATCH 2/2] chore: apply suggestions from code review Co-authored-by: David Galindo <35235550+dagacha@users.noreply.github.com> --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0eab7888..c1504c61 100644 --- a/README.md +++ b/README.md @@ -147,9 +147,7 @@ Now, open a Git Bash terminal and follow the instructions in the "[Run the scrip ## Advanced usage -In this chapter, we invite you to dive deeper into our service's capabilities. -Tailored for enthusiasts eager to customize and optimize, this section empowers you to make nuanced adjustments, -enhancing your experience to match unique requirements. +This chapter is for advanced users who want to further customize the trader agent's behaviour without changing the underlying trading logic. ##### Policy weights @@ -173,7 +171,7 @@ cp ".trader_runner/available_tools_store.json" ".trader_runner/available_tools_s ##### Tool selection -Sometimes, a mech tool might temporarily misbehave. +Sometimes, a mech tool might temporarily return invalid results. As a result, the service would end up performing mech calls without being able to use the response. Assuming that this tool has a large reward rate in the policy weights, the service might end up spending a considerable amount of xDAI before adjusting the tool's reward rate,