It was the Bitcointalk forum that inspired us to create Bitcointalksearch.org - Bitcointalk is an excellent site that should be the default page for anybody dealing in cryptocurrency, since it is a virtual gold-mine of data. However, our experience and user feedback led us create our site; Bitcointalk's search is slow, and difficult to get the results you need, because you need to log in first to find anything useful - furthermore, there are rate limiters for their search functionality.
The aim of our project is to create a faster website that yields more results and faster without having to create an account and eliminate the need to log in - your personal data, therefore, will never be in jeopardy since we are not asking for any of your data and you don't need to provide them to use our site with all of its capabilities.
We created this website with the sole purpose of users being able to search quickly and efficiently in the field of cryptocurrency so they will have access to the latest and most accurate information and thereby assisting the crypto-community at large.
[API]
apikey = API Key Here
secret = Secret Here
[BOT]
#Sleeps between active iterations, time in seconds (1-3600)
sleeptimeactive = 5
#Sleeps between inactive iterations, time in seconds (1-3600)
#Set to the same value as sleeptimeactive to disable
sleeptimeinactive = 20
#Minimum daily lend rate in percent (0.0031-5)
#Setting to 0.0031 is about 1% a year, not worth it.
mindailyrate = 0.003
#Maximum lending rate. 2% is good choice because it's default at margin trader interface.
#5% is the maximum rate accepted by the exchange (0.003-5)
maxdailyrate = 5
#The number of offers to split the available balance across the [gaptop, gapbottom] range. (1-20)
spreadlend = 3
#The depth of lendbook (in percent of lendable balance) to move through
#before placing the first (gapbottom) and last (gaptop) offer.
#If gapbottom is set to 0, the first offer will be at the lowest possible rate.
#However some low value is recommended (say 10%) to skip dust offers.
gapbottom = 10
gaptop = 200
#Daily lend rate threshold after which we offer lends for x days as opposed to 2.
#If set to 0 all offers will be placed for a 2 day period (0.003-5)
xdaythreshold = 0.2
xdays = 60
#Auto-transfer of funds from exchange to lending balance.
#Enter ALL to transfer all coins, enter ACTIVE to transfer any coins you have in your lending account when the bot starts, these can be mixed.
#The currencies you enter below (comment it out to disable entirely, just leaving empty will result in an error) will be automatically transferred from your exchange balance to your lending balance whenever you deposit them.
#transferableCurrencies = STR,BTC,BTS,CLAM,DOGE,DASH,LTC,MAID,XMR,XRP,ETH,FCT
#Minimum loan size, the minimum size of offers to make, bigger values prevent the bot from loaning small available amounts but reduce loan fragmentation.
minloansize = 0.001
#Keep Stuck Orders - Sometimes an order gets partially filled. When this happens it may leave the remainder of your coin under the set minloansize.
#If this happens, KeepStuckOrders will keep your order where it is so maybe it can be filled. Otherwise it will be canceled and held until orders expire.
keepstuckorders = True
#Hide coins - Instead of keeping your coins lent out at minlendrate when it is not met, the bot will hold them and wait for the rate to surpass it.
hideCoins = True
#End date for lending, bot will try to make sure all your loans are done by this date so you can withdraw or do whatever you need.
#Uncomment to enable.
#Format: YEAR,MONTH,DAY
#endDate = 2016,12,25
#Raw maximum amount to lend if under maxtolendrate.
#If set to 0 or commented: the bot will check for maxpercenttolend.(0+)
#maxtolend = 0
#Maximum percent to lend if under maxtolendrate.
#If set to 0 or commented: the bot will lend 100% of your balance regardless of rate. (0-100)
#maxpercenttolend = 0
#Max to lend conditional rate.
#If set to more than 0: the maxtolend or maxpercenttolend will be used when the rate is less than or equal to the maxtolendrate.
#If set to 0 or commented: the bot will use the maxtolend or maxpercenttolend all the time. (0.0031-5)
#maxtolendrate = 0
# Local Market Analysis: Choose which coins to record the market of in order to analyse them and compute a recommended lending rate.
# Enter ALL to analyse all coins, enter ACTIVE to analyse the markets of any coins you have in your lending account when the bot starts, these can be mixed.
#analyseCurrencies = STR,BTC,BTS,CLAM,DOGE,DASH,LTC,MAID,XMR,XRP,ETH,FCT
# Choose how long to keep market data. (In days) (1-365)
#analyseMaxAge = 20
# Choose how often to record a market's rate. (In seconds.) (10-3600)
#analyseUpdateInterval = 20
# Choose how aggressive to lend at based on a market's performance. (As a percentile of the market's rate.) (1-99)
# Recommendations: Conservative = 50, Moderate = 75, Aggressive = 90, Very Aggressive = 99
#lendingStyle = 75
#Syntax: ["COIN:mindailyrate:maxactiveamount:maxtolend:maxpercenttolend:maxtolendrate",...]
#If maxactive amount is 0: stop lending this coin. in the future you'll be able to limit amount to be lent.
#If maxtolend is 0: check for maxpercenttolend.
#If maxpercenttolend is 0: 100% is going to be lent.
#If maxtolendrate is set to more than 0: the maxtolend or maxpercenttolend will be used when then rate is less or equal to the maxtolendrate. if set to 0 the bot will use the maxtolend or maxpercenttolend all the time.
#coinconfig = ["BTC:0.18:1:0:0:0","CLAM:0.6:1:0:0:0"]
#This option creates a json log file instead of console output which includes the most recent status.
#Uncomment both jsonfile and jsonlogsize to enable.
#Keep this in the default location if you want to use the webserver.
#jsonfile = www/botlog.json
#Limits the amount of log lines to save.
#jsonlogsize = 200
#Enables a webserver for the www folder, in order to easily use the lendingbot.html with the .json log.
#startWebServer = true
#Customize the IP and port that the webserver is hosted on. Defaults to 0.0.0.0:8000
#0.0.0.0 will point to your default IP (Local IP on LAN as well as localhost), set to 127.0.0.1 if you want it to be only accessible by host computer.
#Do not set to a reserved port
#Advanced users only.
#customWebServerAddress = 127.0.0.1
#The currency that the HTML Overview will present the earnings summary in.
#Options are BTC, USDT, ETH or anything as long as it has a direct BTC market. The default is BTC.
#outputCurrency = BTC
currencies_to_analyse = []
open_files = {}
max_age = 0
update_interval = 0
api = None
Data = None
lending_style = 0
def init(config, api1, data1):
global currencies_to_analyse, open_files, max_age, update_interval, api, Data, lending_style
currencies_to_analyse = config.get_currencies_list('analyseCurrencies')
max_age = int(config.get('BOT', 'analyseMaxAge', 30, 1, 365))
update_interval = int(config.get('BOT', 'analyseUpdateInterval', 60, 10, 3600))
lending_style = int(config.get('BOT', 'lendingStyle', 50, 1, 99))
api = api1
Data = data1
if len(currencies_to_analyse) != 0:
for currency in currencies_to_analyse:
try:
api.api_query("returnLoanOrders", {'currency': currency, 'limit': '5'})
except Exception as cur_ex:
print "Error: You entered an incorrect currency: '" + currency + \
"' to analyse the market of, please check your settings. Error message: " + str(cur_ex)
exit(1)
else:
path = "market_data/" + currency + "_market_data.csv"
open_files[currency] = path
thread = threading.Thread(target=update_market_loop)
thread.deamon = True
thread.start()
def update_market_loop():
while True:
update_markets()
delete_old_data()
time.sleep(update_interval)
def update_markets():
for cur in open_files:
with open(open_files[cur], 'a') as f:
writer = csv.writer(f, lineterminator='\n')
raw_data = api.return_loan_orders(cur, 5)['offers'][0]
market_data = [Data.timestamp(), raw_data['rate']]
writer.writerow(market_data)
def delete_old_data():
for cur in open_files:
with open(open_files[cur], 'rb') as file_a:
new_a_buf = StringIO()
writer = csv.writer(new_a_buf)
reader2 = csv.reader(file_a)
for row in reader2:
if get_day_difference(row[0]) < max_age:
writer.writerow(row)
# At this point, the contents (new_a_buf) exist in memory
with open(open_files[cur], 'wb') as file_b:
file_b.write(new_a_buf.getvalue())
def get_day_difference(date_time): # Will be in format '%Y-%m-%d %H:%M:%S'
date1 = datetime.datetime.strptime(date_time, '%Y-%m-%d %H:%M:%S')
now = datetime.datetime.now()
diff_days = (now - date1).days
return diff_days
def get_rate_list(cur='all'):
if cur == 'all':
all_rates = {}
for cur in open_files:
with open(open_files[cur], 'r') as f:
reader = csv.reader(f)
rates = []
for row in reader:
rates.append(row[1])
rates = map(float, rates)
all_rates[cur] = rates
return all_rates
else:
if cur not in open_files:
return []
with open(open_files[cur], 'r') as f:
reader = csv.reader(f)
rates = []
for row in reader:
rates.append(row[1])
rates = map(float, rates)
return rates
def get_rate_suggestion(cur, percentile=lending_style):
if cur not in open_files:
return 0
rates = get_rate_list(cur)
if use_numpy:
result = numpy.percentile(rates, int(percentile), interpolation='linear')
else:
rates.sort()
index = int(percentile * len(rates))
result = rates[index]
result = float(int(result * 1000000) / 1000000.0)
return result