{"id":22608987,"url":"https://github.com/bitfinexcom/bitfinex-api-rb","last_synced_at":"2026-03-06T07:31:27.274Z","repository":{"id":55414236,"uuid":"43223781","full_name":"bitfinexcom/bitfinex-api-rb","owner":"bitfinexcom","description":"BITFINEX Ruby trading API - Bitcoin, Litecoin, and Ether exchange","archived":false,"fork":false,"pushed_at":"2024-09-05T06:38:35.000Z","size":228,"stargazers_count":81,"open_issues_count":6,"forks_count":95,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-04-09T22:14:38.162Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.bitfinex.com/","language":"Ruby","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/bitfinexcom.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2015-09-26T21:30:56.000Z","updated_at":"2024-09-13T14:39:11.000Z","dependencies_parsed_at":"2024-09-06T11:38:12.249Z","dependency_job_id":"722e7851-3417-4913-90c5-8f767d01c5cd","html_url":"https://github.com/bitfinexcom/bitfinex-api-rb","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/bitfinexcom/bitfinex-api-rb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Fbitfinex-api-rb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Fbitfinex-api-rb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Fbitfinex-api-rb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Fbitfinex-api-rb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitfinexcom","download_url":"https://codeload.github.com/bitfinexcom/bitfinex-api-rb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Fbitfinex-api-rb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30165617,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T04:43:31.446Z","status":"ssl_error","status_checked_at":"2026-03-06T04:40:30.133Z","response_time":250,"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":[],"created_at":"2024-12-08T15:10:29.410Z","updated_at":"2026-03-06T07:31:27.248Z","avatar_url":"https://github.com/bitfinexcom.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bitfinex Trading API for Ruby - Bitcoin, Ethereum, Ripple and more\n\n[![Code Climate](https://codeclimate.com/repos/56db27e5b86182573b0045ed/badges/bd763083d70114379a41/gpa.svg)](https://codeclimate.com/repos/56db27e5b86182573b0045ed/feed)\n\nA Ruby reference implementation of the Bitfinex REST \u0026 WebSocket APIs.\n\nThis repo is primarily made up of 3 classes: RESTv1, RESTv2, and WSv2, which implement their respective versions of the Bitfinex API. It is recommended that you use the REST APIs for reading data, and the WebSocket API for submitting orders and interacting with the Bitfinex platform.\n\nCheck the [Bitfinex API documentation](http://docs.bitfinex.com/) for more information.\n\n### Features\n* Official implementation\n* REST API v1\n* REST API v2\n* WebSockets API version 2\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'bitfinex-rb', :require =\u003e \"bitfinex\"\n```\n\nAnd then execute:\n```bash\nbundle\n```\n\nOr install it yourself as:\n```bash\ngem install bitfinex-rb\n```\n\n### Quickstart\n```ruby\nclient = Bitfinex::WSv2.new({\n  :api_key =\u003e ENV['API_KEY'],\n  :api_secret =\u003e ENV['API_SECRET'],\n  :transform =\u003e true, # provide models as event data instead of arrays\n})\n\nclient.on(:open) do\n  client.auth!\nend\n\nclient.on(:auth) do\n  puts 'succesfully authenticated'\n\n  o = Bitfinex::Models::Order.new({\n    :type =\u003e 'EXCHANGE LIMIT',\n    :price =\u003e 3.0152235,\n    :amount =\u003e 2.0235235263262,\n    :symbol =\u003e 'tEOSUSD'\n  })\n\n  client.submit_order(o)\nend\n```\n\n### Docs\n\n[Refer to `docs/events.md`](/docs/events.md) for a list of available events which can be consumed. Official API docs pending.\n\nFor ready to run examples, see the [`examples/` folder](/examples).\n\n### Examples\n#### Usage of RESTv1/RESTv2\n\nTo use the REST APIs, construct a new API client with your account credentials:\n\n```ruby\nclient = Bitfinex::RESTv2.new({\n  :api_key =\u003e '...',\n  :api_secret =\u003e '...',\n})\n```\n\nThen use it to submit queries, i.e. `client.balances`\n\n#### Usage of WSv2\nTo use version 2 of the WS API, construct a new client with your credentials, bind listeners to react to stream events, and open the connection:\n\n```ruby\nclient = Bitfinex::WSv2.new({\n  :url =\u003e ENV['WS_URL'],\n  :api_key =\u003e ENV['API_KEY'],\n  :api_secret =\u003e ENV['API_SECRET'],\n  :transform =\u003e true, # provide models as event data instead of arrays\n  :seq_audit =\u003e true, # enable and audit sequence numbers\n  :manage_order_books =\u003e true, # allows for OB checksum verification\n  :checksum_audit =\u003e true # enables OB checksum verification (needs manage_order_books)\n})\n\nclient.on(:open) do\n  client.auth!\nend\n\nclient.on(:auth) do\n  puts 'succesfully authenticated'\n\n  o = Bitfinex::Models::Order.new({\n    :type =\u003e 'EXCHANGE LIMIT',\n    :price =\u003e 3.0152235,\n    :amount =\u003e 2.0235235263262,\n    :symbol =\u003e 'tEOSUSD'\n  })\n\n  client.submit_order(o)\nend\n\nclient.on(:notification) do |n|\n  puts 'received notification: %s' % [n]\nend\n\nclient.on(:order_new) do |msg|\n  puts 'recv order new: %s' % [msg]\nend\n\nclient.open!\n```\n\n#### Order Manipulation\nThree methods are provided for dealing with orders: `submit_order`, `update_order` and `cancel_order`. All methods support callback blocks, which are triggered upon receiving the relevant confirmation notifications. Example:\n\n```ruby\no = Bitfinex::Models::Order.new({\n  :type =\u003e 'EXCHANGE LIMIT',\n  :price =\u003e 3.0152235,\n  :amount =\u003e 2.0235235263262,\n  :symbol =\u003e 'tEOSUSD'\n})\n\nclient.submit_order(o) do |order_packet|\n  p \"recv order confirmation packet with ID #{order_packet.id}\"\n\n  client.update_order({\n    :id =\u003e order_packet.id,\n    :price =\u003e '3.0'\n  }) do |update_packet|\n    p \"updated order #{update_packet.id} with price #{update_packet.price}\"\n\n    client.cancel_order(order_packet) do |canceled_order|\n      p \"canceled order with ID #{canceled_order[0]}\"\n    end\n  end\nend\n```\n\n### Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitfinexcom%2Fbitfinex-api-rb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitfinexcom%2Fbitfinex-api-rb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitfinexcom%2Fbitfinex-api-rb/lists"}