{"id":27429467,"url":"https://github.com/byteball/odex-orderbook-replication","last_synced_at":"2025-07-12T07:35:36.402Z","repository":{"id":72989874,"uuid":"256562301","full_name":"byteball/odex-orderbook-replication","owner":"byteball","description":"Order book replication bot for creating liquidity on ODEX","archived":false,"fork":false,"pushed_at":"2020-11-26T16:54:29.000Z","size":53,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-12T07:35:32.849Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/byteball.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-04-17T17:02:36.000Z","updated_at":"2022-03-24T13:46:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"dfcc238f-70f7-4c53-b865-596fe8e18114","html_url":"https://github.com/byteball/odex-orderbook-replication","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/byteball/odex-orderbook-replication","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byteball%2Fodex-orderbook-replication","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byteball%2Fodex-orderbook-replication/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byteball%2Fodex-orderbook-replication/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byteball%2Fodex-orderbook-replication/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/byteball","download_url":"https://codeload.github.com/byteball/odex-orderbook-replication/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byteball%2Fodex-orderbook-replication/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264958196,"owners_count":23689011,"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":"2025-04-14T14:17:49.555Z","updated_at":"2025-07-12T07:35:36.388Z","avatar_url":"https://github.com/byteball.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ODEX orderbook replication bot\n\nThis trading bot replicates the orderbook from Bittrex to ODEX for GBYTE/BTC trading pair. On ODEX, a BTC-pegged stablecoin is used instead of BTC. The bot copies all pending buy and sell orders from the source exchange (Bittrex) to the destination exchange (ODEX) while adding a configurable (2% by default) markup. Once an order is filled on ODEX, the bot immediately sends an opposite market order of the same amount to Bittrex. For example, if the bot's sell order for 1 GBYTE is filled on ODEX, it immediately buys 1 GBYTE on Bittrex. Thus, its exposure stays constant while it earns the difference between the buy and sell prices, which is supposed to be equal to the markup, minus exchange fees.\n\nIf the source exchange is more liquid than the destination exchange, the bot's activity improves the depth of the orderbook on the destination exchange (ODEX).\n\nThis bot and its source code are offered as is, without any guarantees of its correct operation. The bot might lose money because of bugs, unreliable network connections, and other reasons.\n\n## Install\nInstall node.js 8+, clone the repository, then say\n```sh\nnpm install\n```\n\n## Configure\n\nEnable API access on Bittrex and get the corresponding API key. Your API keys should be with access to trading only, don't enable withdrawals for security reasons.\n\nCreate a `~/.config/odex-orderbook-replication/conf.json` file and set your API credentials for the source (Bittrex) exchange in `sourceApiKey` and `sourceApiSecret` keys. Alternatively, you can set these fields in `.env` (see the `.env.sample` provided).\n\nRegarding its work with ODEX, there are two modes the bot can operate in:\n* The bot includes its own Obyte wallet, separate from your main trading account. You don't need to setup any API access on ODEX. But you need to deposit/withdraw to/from the bot's account separately.\n* The bot trades on your main ODEX account. ODEX UI doesn't include this option yet but you can send a `grant` command to the ODEX AA directly to grant the bot the right to trade on your behalf. Then, the bot's address will be allowed to create and cancel orders but not to deposit and withdraw funds. Set your main ODEX address as `owner_address` in conf.\n\nSubsequent discussion assumes the former mode.\n\n## Prepare\n\nDeposit BTC and GBYTE to Bittrex.\n\nTo deposit to ODEX, run this script first:\n```sh\nnode run-idle.js\n```\nNote the pairing code that it prints, use it to pair your Obyte wallet to the bot. In chat with the bot, type `address` to learn its Obyte address.\n\nClick the address and send both GBYTE and a BTC-pegged stablecoin to the bot. Now the coins are on the bot's wallet but not on the exchange yet.\n\nType e.g. `deposit 10 GBYTE` or `deposit 0.2 BTC_20200701` to deposit 10 GBYTE or 0.2 BTC_20200701 respectively to the bot's balance on the exchange. You'll have to wait for confirmation after the first deposit, otherwise the bot will complain about lack of funds when you attempt a second deposit. All subsequent deposit commands can be issued without delay.\n\nAfter the bot's deposits to ODEX are confirmed, you are ready to trade.\n\nRefer to [ODEX client documentation](https://github.com/byteball/odex-client#trading-balances) and [headless wallet documentation](https://github.com/byteball/headless-obyte#remote-control) for other chat commands you can give to the bot.\n\nThe total amount of orders the bot can create on the destination exchange is capped by your balances on the exchanges. For example, the total amount of GBYTE you can have in asks on the destination exchange is capped by both your GBYTE balance on the destination exchange and your BTC balance on the source exchange (as you will use BTC to buy GBYTE on the source exchange when GBYTE is sold on the destination exchange).\n\n## Run\n```sh\nnode start.js\n```\nIt is recommended to run the bot using [pm2](https://pm2.keymetrics.io/) to enable automatic restarts. Install pm2 globally:\n```sh\nnpm install -g pm2\n```\nRun:\n```sh\npm2 start start.js --time\n```\nStop:\n```sh\npm2 stop start.js\n```\nLogs will grow quite fast. Refer to pm2 documentation for proper log management.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyteball%2Fodex-orderbook-replication","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbyteball%2Fodex-orderbook-replication","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyteball%2Fodex-orderbook-replication/lists"}