lib/cryptum/bot_conf.rb in cryptum-0.0.367 vs lib/cryptum/bot_conf.rb in cryptum-0.0.368
- old
+ new
@@ -61,27 +61,21 @@
bot_conf = opts[:bot_conf]
# BE EXTREMELY CAREFUL CHANGING THIS VALUE AS IT DICTATES
# THE TARGET PRICE AND SUBSEQUENT TIME IT TAKES FOR AN OPEN
# SELL ORDER TO BE TRIGGERED!!! SHOULD NEVER BE > 1
- # default_net_tpm = 1.0
- maker_rate = 0.004
- taker_rate = 0.006
-
gross_tpm = bot_conf[:target_profit_margin_percent].to_f
- # Refactor TPM to be 1.0 > than fee tier,
- # particularly as fee tier goes up or down
fees = event_history.order_book[:fees]
+ maker_rate = 0.004
maker_rate = fees[:maker_fee_rate].to_f unless fees.empty?
- # maker_fee = format('%0.2f', maker_rate * 100)
+ taker_rate = 0.006
taker_rate = fees[:taker_fee_rate].to_f unless fees.empty?
- # taker_fee = format('%0.2f', taker_rate * 100)
# Absolute Bare Minimum TPM (Promotes Volume & Reduces Fees)
- default_net_tpm = maker_rate + taker_rate + 0.001
+ default_net_tpm = 1.0 + (maker_rate + taker_rate)
# Set default_net_tpm if AI is true in bot_conf.
low_24h = event_history.order_book[:low_24h].to_f
high_24h = event_history.order_book[:high_24h].to_f
@@ -128,10 +122,10 @@
ai_net_tpm *= conservative_tpm_hedge
default_net_tpm = ai_net_tpm if ai_net_tpm > default_net_tpm
min_gross_tpm = format(
'%0.2f',
- (maker_rate.to_f + taker_rate.to_f) + default_net_tpm
+ default_net_tpm
)
if min_gross_tpm != gross_tpm.to_s
bot_conf[:target_profit_margin_percent] = min_gross_tpm.to_f
Cryptum::BotConf.update(