{"id":25747775,"url":"https://github.com/digitalruby/exchangesharp","last_synced_at":"2025-04-10T03:49:09.932Z","repository":{"id":40253211,"uuid":"102514158","full_name":"DigitalRuby/ExchangeSharp","owner":"DigitalRuby","description":"ExchangeSharp is a powerful, fast and easy to use .NET/C# API for interfacing with many crypto currency exchanges. REST and web sockets are supported.","archived":false,"fork":false,"pushed_at":"2024-04-12T20:31:47.000Z","size":16068,"stargazers_count":732,"open_issues_count":20,"forks_count":373,"subscribers_count":75,"default_branch":"main","last_synced_at":"2024-05-01T20:26:02.150Z","etag":null,"topics":["api","bitcoin","bitfinex","bithumb","bitstamp","bitstamp-api","bittrex","bittrex-api","blockchain","cryptocurrency","csharp","ethereum","exchange","gdax","gdax-api","gemini","kraken","kraken-exchange-api","poloniex","poloniex-api"],"latest_commit_sha":null,"homepage":"https://www.digitalruby.com","language":"C#","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/DigitalRuby.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","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},"funding":{"github":["jjxtra","vslee"]}},"created_at":"2017-09-05T18:08:02.000Z","updated_at":"2024-06-13T01:30:55.243Z","dependencies_parsed_at":"2023-12-05T21:26:33.717Z","dependency_job_id":"85f0c6f9-6968-44b6-bf3e-829da5c888b8","html_url":"https://github.com/DigitalRuby/ExchangeSharp","commit_stats":{"total_commits":1156,"total_committers":84,"mean_commits":"13.761904761904763","dds":0.3987889273356401,"last_synced_commit":"d155220a2d981296d4e3cac639688111fbff4455"},"previous_names":["jjxtra/exchangesharp"],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DigitalRuby%2FExchangeSharp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DigitalRuby%2FExchangeSharp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DigitalRuby%2FExchangeSharp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DigitalRuby%2FExchangeSharp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DigitalRuby","download_url":"https://codeload.github.com/DigitalRuby/ExchangeSharp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248154995,"owners_count":21056542,"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":["api","bitcoin","bitfinex","bithumb","bitstamp","bitstamp-api","bittrex","bittrex-api","blockchain","cryptocurrency","csharp","ethereum","exchange","gdax","gdax-api","gemini","kraken","kraken-exchange-api","poloniex","poloniex-api"],"created_at":"2025-02-26T12:17:49.722Z","updated_at":"2025-04-10T03:49:09.908Z","avatar_url":"https://github.com/DigitalRuby.png","language":"C#","readme":"\u003cimg src='logo.png' width='600' alt=\"Project's logo\" /\u003e\n\n[![Github Sponsorship](.github/github_sponsor_btn.svg)](https://github.com/sponsors/jjxtra)\n\n[![NuGet](https://img.shields.io/nuget/dt/DigitalRuby.ExchangeSharp.svg)][nuget]\n\n## Overview\n\nExchangeSharp is a C# **framework/lib** and [console app](#installing-the-cli) for trading and communicating with [various](#exchanges) exchange API end points for cryptocurrency assets. Many exchanges are supported, along with [web sockets](#websockets), withdraws and more!\n\nFeel free to visit the discord channel at \u003chttps://discord.gg/58ktxXuTVK\u003e and chat with other developers.\n\n### Features\n\n- Many [exchanges](/src//ExchangeSharp/API/Exchanges/) supported with public, private and web socket API\n- Easy to use code and API\n- Optional global market symbol normalization, since each exchange has their own way of doing market symbols\n- Runs anywhere .NET runs. (Windows, Mac, Linux, Containers, Serverless, iOS, Android, [etc.](https://docs.microsoft.com/en-us/dotnet/core/about))\n- Can be used from [many different C# platforms](https://github.com/dotnet/standard/blob/master/docs/versions/netstandard2.0.md#platform-support)\n- Has a great [CLI](#installing-the-cli) that enables you to use all features from all exchanges right from your command line.\n\n### Exchanges\n\nThe following cryptocurrency exchanges are supported:  \n(Web socket key: T = tickers, R = trades, B = orderbook / delta orderbook, O = private orders, U = user data)\n\n| Exchange Name       | Public REST | Private REST | Web Socket    | Notes                                       |\n|---------------------| ----------- |--------------| ------------- | ------------------------------------------- |\n| ApolloX             | x           | x            | T R B O U     |                                             |\n| Aquanow             | wip         | x            |               |                                             |\n| Binance             | x           | x            | T R B O U     |                                             |\n| ~~Binance Jersey~~  | ~~x~~       | ~~x~~        | ~~T R B O U~~ | Ceased operations                           |\n| Binance.US          | x           | x            | T R B O U     |                                             |\n| Binance DEX         |             |              |   R           |                                             |\n| Bitbank             | x           | x            |               |                                             |\n| Bitfinex            | x           | x            | T R   O       |                                             |\n| Bitflyer            |             |              |   R           |                                             |\n| Bithumb             | x           |              |   R           |                                             |\n| BitMEX              | x           | x            |   R   O       |                                             |\n| Bitstamp            | x           | x            |   R           |                                             |\n| Bittrex             | x           | x            | T R           |                                             |\n| BL3P                | x           | x            |   R B         | Trades stream does not send trade's ids.    |\n| Bleutrade           | x           | x            |               |                                             |\n| BtcTurk             |             |              |   R           |                                             |\n| BTSE                | x           | x            |               |                                             |\n| Bybit               | x           | x            |   R B         | Has public method for Websocket Positions   |\n| Coinbase (Advanced) | x           | x            | T R   O U     |                                             |\n| Coincheck           |             |              |   R           |                                             |\n| Coinmate            | x           | x            |               |                                             |\n| Crypto.com          |             |              |   R           |                                             |\n| Digifinex           | x           | x            |   R B         |                                             |\n| Dydx                |             |              |   R           |                                             |\n| FTX                 | x           | x            | T R           |                                             |\n| FTX.us              | x           | x            | T R           |                                             |\n| gate.io             | x           | x            |   R           |                                             |\n| Gemini              | x           | x            | T R B         |                                             |\n| HitBTC              | x           | x            |   R           |                                             |\n| Huobi               | x           | x            |   R B         |                                             |\n| Kraken              | x           | x            |   R           | Dark order symbols not supported            |\n| KuCoin              | x           | x            | T R B         |                                             |\n| LBank               | x           | x            |   R           |                                             |\n| Livecoin            | x           | x            |               |                                             |\n| MEXC                | x           | x            |     B         |                                             |\n| NDAX                | x           | x            | T R           |                                             |\n| OKCoin              | x           | x            |   R B         |                                             |\n| OKEx                | x           | x            | T R B O       |                                             |\n| Poloniex            | x           | x            | T R B         |                                             |\n| UPbit               |             |              |   R           |                                             |\n| YoBit               | x           | x            |               |                                             |\n| ZB.com              | wip         |              |   R           |                                             |\n\nThe following cryptocurrency services are supported:\n\n- Cryptowatch (partial)\n\nExchange constructors are private, to get access to an exchange in code use:\n\n`ExchangeAPI.GetExchangeAPIAsync\u003cT\u003e()`.\n\n### Installing the CLI\n\nOn \\*nix systems:\n\n- Run this command `curl https://github.com/DigitalRuby/ExchangeSharp/raw/main/install-console.sh | sh`\n\nOn Windows (or manually):\n\n- Download the [latest binaries](https://github.com/jjxtra/ExchangeSharp/releases/latest) for your OS.\n- Unzip it into a folder that is in your environment variable `PATH` (`ctrl` + `shift` + `pause|break` -\u003e Environment Variables)\n- Use it from your preferred command-line emulator (e.g. Powershell, cmd, etc.)\n- `exchange-sharp --help` shows all available commands\n\n### Notes\n\nExchangeSharp uses **`marketSymbol`** to refer to markets, or pairs of currencies.\n\nPlease send pull requests if you have made a change that you feel is worthwhile, want a bug fixed or want a new feature. You can also donate to get new features.\n\n### [Building/Compiling](./BUILDING.md)\n\n### Websockets\n\nIf you must use an older Windows (older than win8.1), you'll need to use the [Websocket4Net][websocket4net] nuget package, and override the web socket implementation by calling\n\n```csharp\nExchangeSharp.ClientWebSocket.RegisterWebSocketCreator(\n    () =\u003e new ExchangeSharpConsole.WebSocket4NetClientWebSocket()\n);\n```\n\nSee [`WebSocket4NetClientWebSocket.cs`][websocket4net] for implementation details.\n\n### Nuget\n\n#### dotnet CLI\n\n[`dotnet add package DigitalRuby.ExchangeSharp --version 1.2.0`][nuget]\n\n#### Package Manager on VS\n\n[`PM\u003e Install-Package DigitalRuby.ExchangeSharp -Version 1.2.0`][nuget]\n\n### Examples\n\n#### Creating an order\n\nThere's a lot of examples on how to use the API in our [console application](./src/ExchangeSharpConsole/Options). \\\ne.g.\n[`ExampleOption.cs`](./src/ExchangeSharpConsole/Options/ExampleOption.cs)\n\n#### Getting ticker info via Web Sockets\n\n```csharp\npublic static async Task Main(string[] args)\n{\n    // create a web socket connection to Binance. Note you can Dispose the socket anytime to shut it down.\n    using var api = await ExchangeAPI.GetExchangeAPIAsync\u003cExchangeBinanceAPI\u003e();\n    // the web socket will handle disconnects and attempt to re-connect automatically.\n    using var socket = await api.GetTickersWebSocket(tickers =\u003e\n    {\n        Console.WriteLine(\"{0} tickers, first: {1}\", tickers.Count, tickers.First());\n    });\n\n    Console.WriteLine(\"Press ENTER to shutdown.\");\n    Console.ReadLine(true);\n}\n```\n\n### Authentication\n\nPrivate api calls like placing orders require you to call `LoadApiKeys` first. You can generate an api keys file by running the bundled console application and choosing the generate key file option.\n\n### Logging\n\nExchangeSharp uses NLog internally _currently_. To log, use `ExchangeSharp.Logger`.\n\nDo **not** use `Console.WriteLine` to log messages in the lib project.\n\nProvide your own `nlog.config` or `app.config` nlog configuration if you want to change logging settings or turn logging off.\n\n### Caching\n\nThe `ExchageAPI` class provides a method caching mechanism. Use `MethodCachePolicy` to put caching behind public methods, or clear to remove caching. Some methods are cached by default. You can set `ExchangeAPI.UseDefaultMethodCachePolicy` to `false` to stop all caching as well.\n\nYou can also set request cache policy if you want to tweak how the http caching behaves.\n\n### How to contribute\n\nPlease read the [contributing guideline](CONTRIBUTING.md) **before** submitting a **pull request**.\n\n### Consulting\n\nI'm happy to make customizations to the software for you and keep in private repo, email \u003cexchangesharp@digitalruby.com\u003e.\n\n### Donations Gratefully Accepted\n\nBelieve it or not, donations are quite rare. I've posted publicly the total donation amounts below. If ExchangeSharp has helped you in any way, please consider donating.\n\n[![Donate with Bitcoin](https://en.cryptobadges.io/badge/small/1GBz8ithHvTqeRZxkmpHx5kQ9wBXuSH8AG)](https://en.cryptobadges.io/donate/1GBz8ithHvTqeRZxkmpHx5kQ9wBXuSH8AG)\n\n[![Donate with Litecoin](https://en.cryptobadges.io/badge/small/LWxRMaVFeXLmaq5munDJxADYYLv2szYi9i)](https://en.cryptobadges.io/donate/LWxRMaVFeXLmaq5munDJxADYYLv2szYi9i)\n\n[![Donate with Ethereum](https://en.cryptobadges.io/badge/small/0x77d3D990859a8c3e3486b5Ad63Da223f7F3778dc)](https://en.cryptobadges.io/donate/0x77d3D990859a8c3e3486b5Ad63Da223f7F3778dc)\n\n[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=L67Q4KQN5DHLY)\n\nDonation totals:\n0.039 BTC, 10.25 LTC\n\nThanks for visiting!\n\nJeff Johnson  \n\u003cjeff@digitalruby.com\u003e  \n\u003chttp://www.digitalruby.com\u003e\n\n[nuget]: https://www.nuget.org/packages/DigitalRuby.ExchangeSharp/\n[websocket4net]: https://github.com/kerryjiang/WebSocket4Net\n","funding_links":["https://github.com/sponsors/jjxtra","https://github.com/sponsors/vslee","https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=L67Q4KQN5DHLY"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalruby%2Fexchangesharp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdigitalruby%2Fexchangesharp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalruby%2Fexchangesharp/lists"}