VSRU4HRgtqHifQaXN3QkQrdTRHdWLwUGZj
Here is the untested simple example code I threw together. Obviously I could write this to be much more sophisticated but I wanted to get my point across. I think lowering the time to two minutes will help but I think there is still a fair amount of exposure, since I can stagger the trades. Also would I not be able to extract the API calls from your client? How does removing the web-interface resolve the problem besides adding a bit more work?
We can talk in private about how you can better secure this system if you are interested.
require 'net/http'
require 'json'
# Would need to write code to manage number of threads
# and stagger their start times to maximize attack surface
#Thread.new do
while true
@time_up = Time.now + (60*2)
uri = URI('
http://verisend.vericoin.info/Default/SendBtc?sendto=1NsqLEmk7bckyxocJToBYmgkte2j5KMGZp&amount=1')
arbitrage = Net::HTTP.get(uri)
@vrc_amount = arbitrage.split(' ')[1]
@vrc_address = arbitrage.split(' ')[4]
p @vrc_amount
p @vrc_address
while @time_up > Time.now
p "Time remaining: #{@time_up - Time.now}"
uri = URI('
https://api.mintpal.com/v1/market/stats/VRC/BTC')
market_data = JSON.parse(Net::HTTP.get(uri)).first
last_price = market_data['last_price']
# You would need to add in trading fees
price_per_bitcoin = 1 / last_price.to_f
p price_per_bitcoin
if @vrc_amount.to_f < price_per_bitcoin
difference = price_per_bitcoin - @vrc_amount.to_f
p "Difference of #{difference}"
if difference > 500
p "Good time to send money!"
system("./vericoind sendmoneyto #{vrc_address} #{@vrc_amount}")
end
end
end
p "Times up! Time to try again!"
end
#end