Method: Radiator::Chain#base_per_debt
- Defined in:
- lib/radiator/chain.rb
#base_per_debt ⇒ Object
Returns the current base (e.g. STEEM) price in the debt asset (e.g SBD).
156 157 158 159 160 161 162 163 164 165 166 |
# File 'lib/radiator/chain.rb', line 156 def base_per_debt api.get_feed_history do |feed_history| current_median_history = feed_history.current_median_history base = current_median_history.base base = base.split(' ').first.to_f quote = current_median_history.quote quote = quote.split(' ').first.to_f (base / quote) * base_per_mvest end end |