{"id":22111135,"url":"https://github.com/volumefi/optimized-twap-bot-script","last_synced_at":"2025-03-24T04:28:40.346Z","repository":{"id":196709290,"uuid":"695266964","full_name":"VolumeFi/optimized-twap-bot-script","owner":"VolumeFi","description":null,"archived":false,"fork":false,"pushed_at":"2023-09-26T19:27:24.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-01-29T10:29:37.650Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VolumeFi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-09-22T18:14:32.000Z","updated_at":"2023-09-22T18:17:11.000Z","dependencies_parsed_at":"2023-09-27T03:00:54.793Z","dependency_job_id":null,"html_url":"https://github.com/VolumeFi/optimized-twap-bot-script","commit_stats":null,"previous_names":["volumefi/optimized-twap-bot-script"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VolumeFi%2Foptimized-twap-bot-script","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VolumeFi%2Foptimized-twap-bot-script/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VolumeFi%2Foptimized-twap-bot-script/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VolumeFi%2Foptimized-twap-bot-script/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VolumeFi","download_url":"https://codeload.github.com/VolumeFi/optimized-twap-bot-script/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245209170,"owners_count":20577995,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-01T10:34:32.278Z","updated_at":"2025-03-24T04:28:40.327Z","avatar_url":"https://github.com/VolumeFi.png","language":"Python","readme":"# Twap Optimizer\n\n## Overview\n\nThis Python script finds the optimal number of trades to maximize the output value based on a given input amount and a set of prices. It also takes into account the gas costs for each trade. The optimal interval between trades is also calculated but currently serves as a placeholder.\n\n## Requirements\n\n- Python 3.x\n\n## How to Run\n\n1. Save the Python script in a file, for example `trade_optimizer.py`.\n\n2. Open your terminal or command prompt.\n\n3. Run the script with the `--input_amount` and `--prices` parameters. For example:\n\n    ```bash\n    python trade_optimizer.py --input_amount 1e6 --prices 0.995 0.996 0.997 0.998 0.999\n    ```\n\n## Arguments\n\n- `--input_amount`: The input amount in USD that you are willing to trade.\n  \n- `--prices`: A list of prices corresponding to different input amounts. The i-th entry is the price corresponding to `input_amount / i`.\n\n## Functionality\n\n- `get_gas_cost()`: Placeholder function to get the gas cost. Currently returns a fixed value.\n\n- `get_optimal_trades(input_amount, prices, gas_cost)`: Calculates the optimal number of trades and the resulting output amount.\n\n- `get_optimal_interval()`: Placeholder function that returns the optimal time interval between trades in minutes.\n\n- `optimize(input_amount: float, prices: list)`: Main function that returns the optimal number of trades, the interval, and the optimal output.\n\n## Output\n\nThe script outputs a tuple containing the optimal number of trades, the interval between trades, and the optimal output amount.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvolumefi%2Foptimized-twap-bot-script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvolumefi%2Foptimized-twap-bot-script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvolumefi%2Foptimized-twap-bot-script/lists"}