Class: Abot::Info::DatabaseTable

Inherits:
Object
  • Object
show all
Defined in:
lib/abot/info/database_table.rb

Constant Summary collapse

DB_PATH =
Info::OptionParser.instance.options[:db_path]
BASE_CONNECTION =
ActiveRecord::Base.connection
API_KEY_TABLE =
BASE_CONNECTION.execute('SELECT * FROM api_key').freeze
API_KEY =
API_KEY_TABLE.first['api'].freeze
SECRET_KEY =
API_KEY_TABLE.first['secret'].freeze

Class Method Summary collapse

Class Method Details

.data_coinsObject



19
20
21
# File 'lib/abot/info/database_table.rb', line 19

def data_coins
  BASE_CONNECTION.execute('SELECT *  FROM symbols WHERE statusOrder IS NOT "NO_ORDER"')
end

.data_daily_profitObject



27
28
29
# File 'lib/abot/info/database_table.rb', line 27

def data_daily_profit
  BASE_CONNECTION.execute("SELECT quote, sum(profit) FROM daily_profit GROUP BY quote")
end

.data_settingsObject



23
24
25
# File 'lib/abot/info/database_table.rb', line 23

def data_settings
  BASE_CONNECTION.execute('SELECT *  FROM trade_params').first
end