Post
Topic
Board Beginners & Help
Topic OP
Simple BTC-E question
by
winsucker
on 19/05/2013, 11:55:50 UTC
Hi.

I have a simple mathematical problem to solve about BTC-E.

Let's say, you buy 1 BTC with a value of 100 USD. After that, you would like to know, what should be the minimum value, that you need to resell it, without any losses.

Transactions fees are 0.2%.

What should be the minimal value to resell my 1 BTC, so I can cover all my fees?

  • 0.2% of 100 USD = 100.2 USD + another 0.2% to sell my BTC back = 100.4 USD ot 0.4% in fees
  • 0.2% of 100 USD = 100.2 USD, but you need to apply the sell fee on 100.2 USD. That should be 100.2004 with all my fees
  • You don't know shit (I agree) - it should be that way

To give something back to you, for reading my post - here is an simple PHP snippet, that will read your "give-me-ltc" pool stats and btc-e's LTC values.
It should be easly modified to your needs.

Code:
$pool_api ="http://give-me-ltc.com/api?api_key=XXXXXXXXXXXXXXXXXXXXXXXXXX"//EDIT ME
$btc_e_api ="https://btc-e.com/api/2/ltc_usd/ticker"//EDIT ME

$give_me_ltc file_get_contents($pool_api);
$btc_e file_get_contents($btc_e_api);
$api_btc_e json_decode($btc_e,true);
$api_give_me_ltc json_decode($give_me_ltc,true);


$high $api_btc_e["ticker"]["high"];
$low $api_btc_e["ticker"]["low"];
$buy $api_btc_e["ticker"]["buy"];
$sell $api_btc_e["ticker"]["sell"];


$rewords $api_give_me_ltc["confirmed_rewards"];
$hashrate $api_give_me_ltc["total_hashrate"];
$username $api_give_me_ltc["username"];
$worker1 $api_give_me_ltc["workers"][$username.".1"]["hashrate"]; //EDIT ".1"
$worker2 $api_give_me_ltc["workers"][$username.".2"]["hashrate"]; //EDIT ".2"
$worker3 $api_give_me_ltc["workers"][$username.".3"]["hashrate"]; //EDIT ".3"
$worker4 $api_give_me_ltc["workers"][$username.".4"]["hashrate"]; //EDIT ".4"

$rewords_cash $rewords*$sell;

echo 
"High: ".$high.
"Low: ".$low.
"Buy: ".$buy.
"Sell: ".$sell.
"Rewords: ".$rewords." LTC (".$rewords_cash." USD)".
"KH/s: ".$hashrate." KH/s".
"Worker 1: ".$worker1." KH/s"
"Worker 2: ".$worker2." KH/s".
"Worker 3: ".$worker3." KH/s";
?>