{"id":17373532,"url":"https://github.com/kurotaky/bancor","last_synced_at":"2025-11-08T04:03:49.352Z","repository":{"id":62553959,"uuid":"113963856","full_name":"kurotaky/bancor","owner":"kurotaky","description":"Implement the logic of Bancor protocol.","archived":false,"fork":false,"pushed_at":"2020-03-09T15:26:53.000Z","size":18,"stargazers_count":17,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-15T06:47:57.577Z","etag":null,"topics":["bancor","bancor-protocol","cryptocurrency"],"latest_commit_sha":null,"homepage":null,"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/kurotaky.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-12T08:28:33.000Z","updated_at":"2022-05-08T10:03:55.000Z","dependencies_parsed_at":"2022-11-03T04:45:41.327Z","dependency_job_id":null,"html_url":"https://github.com/kurotaky/bancor","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kurotaky%2Fbancor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kurotaky%2Fbancor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kurotaky%2Fbancor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kurotaky%2Fbancor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kurotaky","download_url":"https://codeload.github.com/kurotaky/bancor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249023707,"owners_count":21199958,"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":["bancor","bancor-protocol","cryptocurrency"],"created_at":"2024-10-16T02:51:49.689Z","updated_at":"2025-11-08T04:03:49.306Z","avatar_url":"https://github.com/kurotaky.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bancor\n[![Gem](https://img.shields.io/gem/v/bancor.svg?style=flat-square)](https://rubygems.org/gems/bancor)\n[![Build Status](https://travis-ci.org/kurotaky/bancor.svg?branch=master)](https://travis-ci.org/kurotaky/bancor)\n\nImplement the logic of Bancor protocol.\n\n* [Bancor Protocol: Continuous Liquidity for Cryptographic Tokens through their Smart Contracts](https://storage.googleapis.com/website-bancor/2018/04/01ba8253-bancor_protocol_whitepaper_en.pdf)\n* [Bancor Protocol: Continuous Liquidity and Asynchronous Price Discovery for Tokens through their Smart Contracts; aka “Smart Tokens](https://bravenewcoin.com/assets/Whitepapers/Bancor-Protocol-Whitepaper-en.pdf)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'bancor'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install bancor\n\n## Usage\n### issue/destroy by reserve token\n```ruby\nirb(main):008:0\u003e bp = Bancor::Protocol.new(eth: 300000, rate: 1, crr: 0.2)\n=\u003e #\u003cBancor::Protocol:0x00007f93039bd410 @total_supply=300000, @reserved_token=60000.0, @price=1.0, @crr=0.2\u003e\n\nirb(main):009:0\u003e bp.issue_by_reserve_token 300\n=\u003e 299.40179372385245\n\nirb(main):010:0\u003e bp\n=\u003e #\u003cBancor::Protocol:0x00007f93039bd410 @total_supply=300299.40179372387, @reserved_token=60300.0, @price=1.003998003989035, @crr=0.2\u003e\n\nirb(main):011:0\u003e bp.issue_by_reserve_token 700\n=\u003e 693.9974382206417\n\nirb(main):012:0\u003e bp\n=\u003e #\u003cBancor::Protocol:0x00007f93039bd410 @total_supply=300993.3992319445, @reserved_token=61000.0, @price=1.0133112579155532, @crr=0.2\u003e\n\nirb(main):013:0\u003e bp.destroy_by_reserve_token 1302\n=\u003e 1307.966524590907\n\nirb(main):014:0\u003e bp\n=\u003e #\u003cBancor::Protocol:0x00007f93039bd410 @total_supply=299691.3992319445, @reserved_token=59692.033475409095, @price=0.9958916677019946, @crr=0.2\u003e\n\nirb(main):015:0\u003e bp.issue_by_reserve_token 100\n=\u003e 100.34530853232869\n\nirb(main):016:0\u003e bp\n=\u003e #\u003cBancor::Protocol:0x00007f93039bd410 @total_supply=299791.7445404769, @reserved_token=59792.033475409095, @price=0.9972261505575943, @crr=0.2\u003e\n```\n\n### issue/destroy by smart token\n```ruby\nirb(main):015:0\u003e bp = Bancor::Protocol.new(eth: 300000, rate: 1, crr: 0.2)\n=\u003e #\u003cBancor::Protocol:0x00007fb14b0169f0 @total_supply=300000, @reserved_token=60000.0, @price=1.0, @crr=0.2\u003e\n\nirb(main):016:0\u003e bp.issue_by_smart_token 50\n=\u003e 0.0\n\nirb(main):017:0\u003e bp\n=\u003e #\u003cBancor::Protocol:0x00007fb14b0169f0 @total_supply=300050, @reserved_token=60000.0, @price=0.9998333611064822, @crr=0.2\u003e\n\nirb(main):018:0\u003e bp.issue_by_smart_token 100\n=\u003e 0.0\n\nirb(main):019:0\u003e bp\n=\u003e #\u003cBancor::Protocol:0x00007fb14b0169f0 @total_supply=300150, @reserved_token=60000.0, @price=0.9995002498750625, @crr=0.2\u003e\n\nirb(main):020:0\u003e bp.destroy_by_smart_token 100\n=\u003e 0.0\n\nirb(main):021:0\u003e bp\n=\u003e #\u003cBancor::Protocol:0x00007fb14b0169f0 @total_supply=300050, @reserved_token=60000.0, @price=0.9998333611064822, @crr=0.2\u003e\n\nirb(main):022:0\u003e bp.destroy_by_smart_token 50\n=\u003e 0.0\n\nirb(main):023:0\u003e bp\n=\u003e #\u003cBancor::Protocol:0x00007fb14b0169f0 @total_supply=300000, @reserved_token=60000.0, @price=1.0, @crr=0.2\u003e\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/kurotaky/bancor. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the Bancor project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/kurotaky/bancor/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkurotaky%2Fbancor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkurotaky%2Fbancor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkurotaky%2Fbancor/lists"}