Module: CoingeckoRuby::Client::Finance

Included in:
CoingeckoRuby::Client
Defined in:
lib/coingecko_ruby/client/finance.rb

Instance Method Summary collapse

Instance Method Details

#finance_platforms(**options) ⇒ Array<Hash>

Fetches the list of finance platforms (e.g. Celsius Network, dYdX) listed in CoinGecko.

Examples:

Get all finance platforms.

client.finance_platforms

Sample response object (truncated)

[
  {
    "name"=>"Binance Staking",
    "facts"=>"",
    "category"=>"CeFi Platform",
    "centralized"=>true,
    "website_url"=>"https://www.binance.com/en/staking"
  },
  {
    "name"=>"Celsius Network",
    "facts"=>"",
    "category"=>"CeFi Platform",
    "centralized"=>true,
    "website_url"=>"https://celsius.network/"
  },
  {
    "name"=>"Cobo",
    "facts"=>"",
    "category"=>"CeFi Platform",
    "centralized"=>true,
    "website_url"=>"https://cobo.com/"
  }
]

Parameters:

  • options (Hash)

    a customizable set of options

Options Hash (**options):

  • :per_page (Integer) — default: 100

    sets the number of results to return per page.

  • :page (Integer)

    sets the page for results.

Returns:

  • (Array<Hash>)

    each finance platform’s name, category, url, facts (description), and centralized status.



37
38
39
# File 'lib/coingecko_ruby/client/finance.rb', line 37

def finance_platforms(**options)
  get 'finance_platforms', **options
end

#finance_products(**options) ⇒ Array<Hash>

Fetches the list of finance products (e.g. Binance Savings, Nexo, Fulcrum) listed in CoinGecko.

Examples:

Get all finance products.

client.finance_products

Sample response object (truncated)

[
  {"platform"=>"Binance Savings",
  "identifier"=>"XTZ001",
  "supply_rate_percentage"=>"1.956035",
  "borrow_rate_percentage"=>nil,
  "number_duration"=>nil,
  "length_duration"=>nil,
  "start_at"=>0,
  "end_at"=>0,
  "value_at"=>0,
  "redeem_at"=>0},
 {"platform"=>"Binance Savings",
  "identifier"=>"ZEC001",
  "supply_rate_percentage"=>"0.182865",
  "borrow_rate_percentage"=>nil,
  "number_duration"=>nil,
  "length_duration"=>nil,
  "start_at"=>0,
  "end_at"=>0,
  "value_at"=>0,
  "redeem_at"=>0},
 {"platform"=>"Crypto.com",
  "identifier"=>"BAT",
  "supply_rate_percentage"=>"2.0",
  "borrow_rate_percentage"=>nil,
  "number_duration"=>nil,
  "length_duration"=>nil,
  "start_at"=>0,
  "end_at"=>0,
  "value_at"=>0,
  "redeem_at"=>0}
]

Parameters:

  • options (Hash)

    a customizable set of options

Options Hash (**options):

  • :per_page (Integer) — default: 100

    sets the number of results to return per page.

  • :page (Integer)

    sets the page for results.

  • :start_at (Integer)

    filter results based on the launch date of the product in UNIX timestamp format.

  • :end_at (Integer)

    filter results based on the end date of the product in UNIX timestamp format.

Returns:

  • (Array<Hash>)

    each finance product’s platform, identifier, supply and borrow rate percentage, and the product duration data.



90
91
92
# File 'lib/coingecko_ruby/client/finance.rb', line 90

def finance_products(**options)
  get 'finance_products', **options
end

#get_finance_platforms(options: {}) ⇒ Object

Deprecated.

Use #finance_platforms instead



42
43
44
# File 'lib/coingecko_ruby/client/finance.rb', line 42

def get_finance_platforms(options: {})
  finance_platforms(**options)
end

#get_finance_products(options: {}) ⇒ Object

Deprecated.

Use #finance_products instead



95
96
97
# File 'lib/coingecko_ruby/client/finance.rb', line 95

def get_finance_products(options: {})
  finance_products(**options)
end