{"id":13507359,"url":"https://github.com/Cinderella-Man/igthorn","last_synced_at":"2025-03-30T08:30:37.033Z","repository":{"id":37704529,"uuid":"187092214","full_name":"Cinderella-Man/igthorn","owner":"Cinderella-Man","description":"Cryptocurrency trading platform","archived":false,"fork":false,"pushed_at":"2023-01-04T21:46:37.000Z","size":15653,"stargazers_count":101,"open_issues_count":24,"forks_count":14,"subscribers_count":9,"default_branch":"1.0.1","last_synced_at":"2024-10-30T00:49:32.513Z","etag":null,"topics":["binance","cryptocurrency","elixir","elixir-phoenix","phoenix-liveview","strategies","streaming","trading-bot"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Cinderella-Man.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-16T19:51:20.000Z","updated_at":"2024-09-30T04:33:26.000Z","dependencies_parsed_at":"2023-02-02T21:01:22.507Z","dependency_job_id":null,"html_url":"https://github.com/Cinderella-Man/igthorn","commit_stats":null,"previous_names":["frathon/igthorn"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cinderella-Man%2Figthorn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cinderella-Man%2Figthorn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cinderella-Man%2Figthorn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cinderella-Man%2Figthorn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cinderella-Man","download_url":"https://codeload.github.com/Cinderella-Man/igthorn/tar.gz/refs/heads/1.0.1","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246296372,"owners_count":20754625,"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":["binance","cryptocurrency","elixir","elixir-phoenix","phoenix-liveview","strategies","streaming","trading-bot"],"created_at":"2024-08-01T02:00:32.087Z","updated_at":"2025-03-30T08:30:32.007Z","avatar_url":"https://github.com/Cinderella-Man.png","language":"Elixir","funding_links":[],"categories":["Applications"],"sub_categories":[],"readme":"# Igthorn\n\n[![Build Status](https://travis-ci.com/Frathon/Igthorn.svg?branch=1.0.1)](https://travis-ci.com/Frathon/Igthorn)\n\nIgthorn is a batteries-included cryptocurrency trading platform written in Elixir.\n\nNon-comprehensive list of Igthorn's features:\n- baked-in backtesting engine that allows to test your strategies against historical data\n- \"naive\" trading strategy\n- list and search through current and historical trades, orders and transactions\n- view chart representations of your trading\nand many others\n\nIgthorn is a boilerplate for kick-starting your crypto trading project. It contains everything you\nneed to immediately focus on writing profitable algos instead of worrying about setup, custom framework etc.\n\nIt's structured as umbrella app that consist of:\n\n- `Ui` - GUI - Phoenix frontend allows fine tuning of crypto trading environment using browser\ninstead of raw db queries. Things that can be done via browser include:\n* starting/stoping straming on symbol,\n* modyfing naive strategy settings\n* starting/stoping trading\n* starting backtesting\n* and others.\n\n- `Hefty` - Backend - streaming and trading backend supporting Binance consisting of:\n* naive trading strategy\n* backtesting engine\n* business logic used by UI\n* and others\n\n\n## Limit of Liability/Disclaimer of Warranty\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n## Setting up\n\n```\ndocker-compose up -d\nmix deps.get\ncd apps/ui/assets \u0026\u0026 npm install \u0026\u0026 cd ../../..\ncd apps/hefty \u0026\u0026 mix ecto.reset \u0026\u0026 cd ../..\n\niex -S mix phx.server\n```\n\nSeeding script checks is there `api_key` and `secret` filled in config of Hefty. It will perform additional query to binance to fetch current assets' balances.\n\n## Usage\n\nAfter starting the server with `iex -S mix phx.server` it will automatically go to database and check\nare there any symbols with enabled streaming and starts streaming for them.\n\nUser interface provides a way to start streaming `trade events` into db under the local url:\nhttp://localhost:4000/streaming-settings\n\nThere's a column called \"streaming\" which contains true/false. By clicking on true/false in one of the rows you will flip(enable/disable) streaming for that symbol.\n\nHere's a diagram of processes with 4 streams open:\n\n![Hefty Supervision Tree](/docs/hefty_supervision_tree.png)\n\nEnabling streaming will put data in Postgres database called `hefty_dev` in table `trade_events`.\n\n## Dumping events\n\nTo get data out from database into csv file exs script can be used:\n\n```\ncd apps/hefty\nmix run priv/repo/scripts/dump-daily-trade-events.exs --date \"2019-05-16\"\n```\n\nThis will create bunch of files in main directory of project (one for each symbol that it has any events in the day).\n\n## Screenshots\n\n![Seeding process](/docs/seeding.png)\n![Settings screen](/docs/settings.png)\n![Dashboard screen](/docs/dashboard.png)\n\n## Naive trader strategy\n\nSingle strategy should be provided for\npeople to understand how to implement one on their own.\n\nNaive strategy described in video called \"[My Adventures in Automated Crypto Trading](https://youtu.be/b-8ciz6w9Xo?t=2257)\" by Timothy Clayton\n\n## Technical considerations:\n\n- My aim is to keep UI close to Elixir with as minimal Javascript as possible so I definietly prefer to keep going on [Liveview](https://github.com/phoenixframework/phoenix_live_view) route.\n\n- Would like to keep streaming seperate from trading as I would like to allow for multiple strategies running simultaneously.\n\n## To do:\n\n- dashboard screen to allow people to have strategies that flag \"interesting\" symbols (for example [volume trading](https://www.investopedia.com/articles/technical/02/010702.asp))\n- possibly implement different exchanges to allow for strategies like [arbitrage](https://www.investopedia.com/terms/a/arbitrage.asp) and others.\n\n## Backtesting\n\nStep 1 - Initialize empty database\n\n```\ncd apps/hefty \u0026\u0026 MIX_ENV=backtesting mix ecto.reset \u0026\u0026 cd ../..\n```\n\nStep 2 - Import historical data\n\nThere's a CLI script that will download historical files for you. there's about 20 days of data\nfrom June (2019-06-03 up to 2019-06-23). To load it you need to specify directory to store csv\ndumps(script will download them for you) to as well as `from` and `to` dates and `symbol` that you are interested in - example below:\n\n```\ncd apps/hefty \u0026\u0026 MIX_ENV=backtesting mix run priv/repo/scripts/load-trade-events.exs --path=\"/backup/projects/binance-trade-events/\" --from=\"2019-06-03\" --to=\"2019-06-22\" --symbol=\"XRPUSDT\" \u0026\u0026 cd ../..\n```\n\nThis will give you a little bit over 2.8 million events(20 days of trading data).\n\nStep 3 - Start application in backtesting environment\n\n```\nMIX_ENV=backtesting iex -S mix phx.server\n```\n\nStep 4 - Enable trading on `XRPUSDT` pair - go to \"Naive trader settings\" and search for the symbol. Click on \"Edit\" set budget to some decent amount like 1000 and click \"Save\". Now click on \"Disabled\" button to enable trading. At this moment system will listen to XRPUSDT stream.\n\nStep 5 - Now go to `Backtesting` section chose \"XRPUSDT\" symbol, select 2 dates (2019-06-03 and 2019-06-09) and click \"Submit\" which will send all 1 million events through naive strategy trader(s).\n\n## Documentation\n\nHosted at [docs.igthorn.com](http://docs.igthorn.com)\n\nTo regenerate run:\n\n```\nmix docs\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCinderella-Man%2Figthorn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCinderella-Man%2Figthorn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCinderella-Man%2Figthorn/lists"}