{"id":19346922,"url":"https://github.com/godmode2k/viabtc_exchange_server","last_synced_at":"2026-02-13T10:36:07.035Z","repository":{"id":183957671,"uuid":"671043863","full_name":"godmode2k/viabtc_exchange_server","owner":"godmode2k","description":"A trading engine with high-speed performance and real-time notification (Matching Engine, 매칭엔진)","archived":false,"fork":false,"pushed_at":"2024-11-04T14:07:39.000Z","size":7351,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-01T15:14:05.446Z","etag":null,"topics":["cryptocurrency","cryptocurrency-exchanges","matching-engine","trading","trading-engine","viabtc-exchange-server"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/godmode2k.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"custom":["https://github.com/godmode2k"]}},"created_at":"2023-07-26T12:14:40.000Z","updated_at":"2024-11-04T14:07:43.000Z","dependencies_parsed_at":"2025-07-01T15:11:49.721Z","dependency_job_id":"58d95dc3-76df-41f7-a84c-b638e7a33a99","html_url":"https://github.com/godmode2k/viabtc_exchange_server","commit_stats":null,"previous_names":["godmode2k/viabtc_exchange_server"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/godmode2k/viabtc_exchange_server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/godmode2k%2Fviabtc_exchange_server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/godmode2k%2Fviabtc_exchange_server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/godmode2k%2Fviabtc_exchange_server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/godmode2k%2Fviabtc_exchange_server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/godmode2k","download_url":"https://codeload.github.com/godmode2k/viabtc_exchange_server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/godmode2k%2Fviabtc_exchange_server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29401733,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T06:24:03.484Z","status":"ssl_error","status_checked_at":"2026-02-13T06:23:12.830Z","response_time":78,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cryptocurrency","cryptocurrency-exchanges","matching-engine","trading","trading-engine","viabtc-exchange-server"],"created_at":"2024-11-10T04:13:17.642Z","updated_at":"2026-02-13T10:36:07.014Z","avatar_url":"https://github.com/godmode2k.png","language":"C","funding_links":["https://github.com/godmode2k"],"categories":[],"sub_categories":[],"readme":"\n# ViaBTC Exchange Server (Matching Engine, 매칭엔진)\n\n\nSummary\n----------\n\u003e ViaBTC-Exchange-Server on Docker \u003c/br\u003e\n\n\nEnvironment\n----------\n\u003e build all and tested on GNU/Linux\n\n    GNU/Linux: Ubuntu 20.04_x64 LTS\n    Docker (+ Docker-Compose)\n    Kafka\n    Redis-Sentinel\n    Database: MySQL or MariaDB\n    ViaBTC-Exchange-Server (https://github.com/viabtc/viabtc_exchange_server)\n\n\n## Directory\n\n```\n* dockerfile-dist\n\n* kafka (SEE: README.md)\n - bitnami-kafka-docker\n - kafka-docker-1.1.0 (wurstmeister/kafka)\n\n* redis (SEE: README.md)\n - redis-sentinel (redis-sentinel-docker-example)\n\n* origin_viabtc_exchange_server\n - source-based (https://github.com/viabtc/viabtc_exchange_server)\n```\n\n\n## Changed\n\n* You can find added new search keyword \"//! ADD NEW:\" in source code (./viabtc_exchange_server/).\n\n```\n1. Build\n OS: Ubuntu 20.04 LTS x86_64\n Docker (Ubuntu 20.04),\n Kafka: librdkafka v2.2.0, Kafka (bitnami-kafka-docker: Docker image)\n Redis: redis v4.0.10, redis-sentinel (Docker image)\n ViaBTC-Exchange-Server: Ubuntu 20.04 LTS x86_64 (with MySQL 8.x, MariaDB)\n\n\n2. Listing/Delisting without restart services. [in-progress]\n\n\n3. Redis Server connection issue when run ViaBTC services inside Docker.\n i.e., you can see logs below.\n\n Redis Host (private or public?): 172.20.0.3:6379\n this PID (153) running inside Docker.\n now, Docker container (private) -\u003e Redis Host (public): 10.0.2.5:6380\n\n\n4. Change fee calculates.\n in bid, change fee calculates base-currency to quote-currency\n instead of ViaBTC's approach (base-currency - fee).\n\n before: bid (AAA/BBB) -\u003e (AAA - fee)\n after: bid (AAA/BBB) -\u003e (BBB - fee)\n\n You can also replace this back to origin. (matchengine/me_market.c)\n```\n\n\n## Build\n\n```\n1. EDIT Dockerfile\n\n* source code filename (date)\n  COPY ./viabtc_exchange_server_src_yyyy.mm.dd.tar /\n  RUN tar xvf /viabtc_exchange_server_src_yyyy.mm.dd.tar\n\n* librdkafk\n  # // clone\n  RUN git clone https://github.com/edenhill/librdkafka.git\n  or\n  RUN git clone https://github.com/confluentinc/librdkafka.git\n\n  # // download (version)\n  RUN wget -O /librdkafka-v2.2.0.tar.gz https://github.com/confluentinc/librdkafka/archive/refs/tags/v2.2.0.tar.gz\n  #RUN curl -o /librdkafka-v2.2.0.tar.gz -L https://github.com/confluentinc/librdkafka/archive/refs/tags/v2.2.0.tar.gz\n  RUN tar xzvf /librdkafka-v2.2.0.tar.gz -C / \u0026\u0026 ln -s /librdkafka-2.2.0 /librdkafka\n\n\n2. EDIT configure\n\n* config.json (log path, Kafka, Redis, Database, ...)\n - for all service processes (matchengine, alertcenter, readhistory, accesshttp, accessws, marketprice)\n -\n - You can use 'set_info.sh' script file\n\n* init_trade_history.sh (Database init script (Database info))\n - You can use 'set_info.sh' script file\n\n* set_info.sh (configure script)\n - config.json (log path, Kafka, Redis, Database, ...)\n - init_trade_history.sh (Database init script (Database info))\n\n\n3. Build and Run\n $ docker build -f Dockerfile.viabtc_exchange_server_backends -t viabtc_exchange_server:1.0 .\n\n\n // Kafka\n $ cd kafka/bitnami-kafka-docker\n EDIT 'docker-compose-kafka-with-zookeeper.yml'\n  - KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://\u003cPublic IP\u003e:9092\n $ sudo sh run_start_kafka_with_zookeeper.sh\n\n\n // Redis-Sentinel\n $ cd redis/redis-sentinel/redis-sentinel-docker-example\n $ sudo sh run_start_redis_sentinel.sh\n\n\n // MySQL or MariaDB\n $ docker run -d -e MYSQL_ROOT_PASSWORD=\"...\" -p 33060:3306 mysql:latest\n or\n $ docker run -d -e MARIADB_ROOT_PASSWORD=\"...\" -p 33060:3306 mariadb:latest\n\n\n // ViaBTC Exchange Server\n $ docker run --rm -it --name \"viabtc_exchange_server\" viabtc_exchange_server:1.0\n $ docker exec -it \u003ccontainer id\u003e bash\n or\n $ docker exec -it -u root \u003ccontainer id\u003e bash\n\n (container) $ sh set_info.sh # EDIT (log path, Kafka, Redis, Database, ...)\n (container) $ sh init_trade_history.sh # EDIT (Database info)\n\n (container) $ cd /viabtc_exchange_server\n (container) $ sh restart_all.sh\n (container) $ sh stop_all.sh\n```\n\n\n## Test\n\n```\n--------------------------------------------\nHTTP API\n--------------------------------------------\nhttps://github.com/viabtc/viabtc_exchange_server/wiki/HTTP-Protocol\n\n// $ curl http://127.0.0.1:8080 -d '{\"method\": \"\", \"params\": [], \"id\": 1}'\n\n\n\ncurl http://127.0.0.1:8080/ -d '{\"method\": \"balance.query\", \"params\": [1, \"BTC\"], \"id\": 1}'\n{\n\t\"error\": null,\n\t\t\"result\": {\n\t\t\t\"BTC\": {\n\t\t\t\t\"available\": \"0\",\n\t\t\t\t\"freeze\": \"0\"\n\t\t\t}\n\t\t},\n\t\t\"id\": 1\n}\n\n\n\n// Asset\n------------------------------------\n\ncurl http://127.0.0.1:8080/ -d '{\"method\": \"asset.list\", \"params\": [], \"id\": 1}'\ncurl http://127.0.0.1:8080/ -d '{\"method\": \"asset.summary\", \"params\": [], \"id\": 1}'\n\n\n\n// Balance\n------------------------------------\n\n// balance\ncurl http://127.0.0.1:8080/ -d '{\"method\": \"balance.query\", \"params\": [1, \"BTC\"], \"id\": 1}'\n// balance history: limit count: 100\ncurl http://127.0.0.1:8080/ -d '{\"method\": \"balance.history\", \"params\": [1, \"BTC\", \"\", 0, 0, 0, 100], \"id\": 1}'\n\n// set\ncurl http://127.0.0.1:8080/ -d '{\"method\": \"balance.update\", \"params\": [1, \"BTC\", \"deposit\", 100, \"100.1234\", {}], \"id\": 1}'\ncurl http://127.0.0.1:8080/ -d '{\"method\": \"balance.update\", \"params\": [1, \"BTC\", \"deposit\", 101, \"100.1234\", {}], \"id\": 1}'\ncurl http://127.0.0.1:8080/ -d '{\"method\": \"balance.update\", \"params\": [1, \"BTC\", \"withdraw\", 100, \"-10.34\", {}], \"id\": 1}'\n\n\n\n// Trade\n------------------------------------\n\n[Order Book]\n\n// Order list: sell\ncurl http://127.0.0.1:8080/ -d '{\"method\": \"order.book\", \"params\": [\"BTCBCH\", 1, 0, 100], \"id\": 1}'\n\n// Order list: buy\ncurl http://127.0.0.1:8080/ -d '{\"method\": \"order.book\", \"params\": [\"BTCBCH\", 2, 0, 100], \"id\": 1}'\n\n// Order list: depth\ncurl http://127.0.0.1:8080/ -d '{\"method\": \"order.depth\", \"params\": [\"BTCBCH\", 0, \"0\"], \"id\": 1}'\n\n\n// inquire\ncurl http://127.0.0.1:8080/ -d '{\"method\": \"order.pending\", \"params\": [1, \"BTCBCH\", 0, 100], \"id\": 1}'\ncurl http://127.0.0.1:8080/ -d '{\"method\": \"order.pending_detail\", \"params\": [\"BTCBCH\", 0], \"id\": 1}'\n// - all, limit 1\ncurl http://127.0.0.1:8080/ -d '{\"method\": \"order.finished\", \"params\": [1, \"BTCBCH\", 0, 0, 0, 1, 0], \"id\": 1}'\n// - sell, limit 1\ncurl http://127.0.0.1:8080/ -d '{\"method\": \"order.finished\", \"params\": [1, \"BTCBCH\", 0, 0, 0, 1, 1], \"id\": 1}'\n// - buy, limit 1\ncurl http://127.0.0.1:8080/ -d '{\"method\": \"order.finished\", \"params\": [1, \"BTCBCH\", 0, 0, 0, 1, 2], \"id\": 1}'\n// - executed order details: order id 100\ncurl http://127.0.0.1:8080/ -d '{\"method\": \"order.finished_detail\", \"params\": [100], \"id\": 1}'\n// - order details: order id 100, limit 1\ncurl http://127.0.0.1:8080/ -d '{\"method\": \"order.deals\", \"params\": [100, 0, 0], \"id\": 1}'\n\n\n[Trade]\n\n// place limit order\n// - sell 10.1234 at 8000\ncurl http://127.0.0.1:8080/ -d '{\"method\": \"order.put_limit\", \"params\": [1, \"BTCBCH\", 1, \"10.1234\", \"8000\", \"0.002\", \"0.001\", \"text\"], \"id\": 1}'\n// - buy 10 at 8000\ncurl http://127.0.0.1:8080/ -d '{\"method\": \"order.put_limit\", \"params\": [1, \"BTCBCH\", 2, \"10\", \"8000\", \"0.002\", \"0.001\", \"text\"], \"id\": 1}'\n\n// place market order\n// - sell\ncurl http://127.0.0.1:8080/ -d '{\"method\": \"order.put_market\", \"params\": [1, \"BTCBCH\", 1, \"10.1234\", \"0.002\", \"text\"], \"id\": 1}'\n\n// cancel order: order id 100\ncurl http://127.0.0.1:8080/ -d '{\"method\": \"order.cancel\", \"params\": [1, \"BTCBCH\", 100], \"id\": 1}'\n\n\n\n// Market\n------------------------------------\n\ncurl http://127.0.0.1:8080/ -d '{\"method\": \"market.list\", \"params\": [], \"id\": 1}'\ncurl http://127.0.0.1:8080/ -d '{\"method\": \"market.summary\", \"params\": [], \"id\": 1}'\ncurl http://127.0.0.1:8080/ -d '{\"method\": \"market.summary\", \"params\": [\"BTCBCH\"], \"id\": 1}'\n\n\n// Market price (last)\ncurl http://127.0.0.1:8080/ -d '{\"method\": \"market.last\", \"params\": [\"BTCBCH\"], \"id\": 1}'\n\n// executed history\n// - limit count: 100\ncurl http://127.0.0.1:8080/ -d '{\"method\": \"market.deals\", \"params\": [\"BTCBCH\", 100, 0], \"id\": 1}'\n\n// user executed history\n// - limit count: 100\ncurl http://127.0.0.1:8080/ -d '{\"method\": \"market.user_deals\", \"params\": [1, \"BTCBCH\", 0, 100], \"id\": 1}'\n\n\n// Kline\ncurl http://127.0.0.1:8080/ -d '{\"method\": \"market.kline\", \"params\": [\"BTCBCH\", 1, 100, 1], \"id\": 1}'\n\n\n// status\n// - period (cycle period): 86400 for last 24 hours\ncurl http://127.0.0.1:8080/ -d '{\"method\": \"market.status\", \"params\": [\"BTCBCH\", 86400], \"id\": 1}'\n\n\n// status today\ncurl http://127.0.0.1:8080/ -d '{\"method\": \"market.status_today\", \"params\": [\"BTCBCH\"], \"id\": 1}'\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgodmode2k%2Fviabtc_exchange_server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgodmode2k%2Fviabtc_exchange_server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgodmode2k%2Fviabtc_exchange_server/lists"}