Bitcoin Forum

Other => Beginners & Help => Topic started by: winsucker on May 19, 2013, 11:55:50 AM



Title: Simple BTC-E question
Post by: winsucker on May 19, 2013, 11:55:50 AM
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:
<?php
$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 
"<b>High:</b> ".$high.
"<br /><b>Low:</b> ".$low.
"<br /><b>Buy:</b> ".$buy.
"<br /><b>Sell:</b> ".$sell.
"<br /><br /><b>Rewords:</b> ".$rewords." LTC (".$rewords_cash." USD)".
"<br /><b>KH/s:</b> ".$hashrate." KH/s".
"<br /><b>Worker 1:</b> ".$worker1." KH/s"
"<br /><b>Worker 2:</b> ".$worker2." KH/s".
"<br /><b>Worker 3:</b> ".$worker3." KH/s";
?>


Title: Re: Simple BTC-E question
Post by: Shutz on May 19, 2013, 01:10:23 PM
You need to sell your Bitcoins again for the buying price plus ~0,4004008% to not lose any money. So bougth @113,4 Dollar per Bitcoin, sell it for 113,855 Dollar (+0,454..)(113,4 * 1,004004008).


Title: Re: Simple BTC-E question
Post by: keatonatron on May 19, 2013, 01:18:02 PM
I believe BTC-E takes their cut out of the BTC you receive, so:

You would sell your 100 USD and receive 1 BTC minus 0.2% (0.998 BTC).

We want that 0.998BTC to be worth 100 USD, after the fee--which means 100USD is 99.8% of the sale price.

100 / .998 will give us the total sales price: 100.2004008...

So you would need to sell your .998BTC for roughly 100.2004USD, but we measure price in the 1 BTC = x USD format, so:

0.998 BTC is 99.8% of the ideal price of 1 BTC, which means 100.2004 is 99.8% of the price of 1 BTC.

100.2004 / .998 = 100.4012

So you would need to sell when the price is 100.4012 USD per bitcoin.

To test this:

.998 BTC * 100.4012USD = 100.2003976USD, minus .2% (100.2003976 * .998 = 99.999996... USD)
Of course it doesn't add up to exactly 100USD, because I truncated a few decimal places  ;D

You were very close in your original thinking ((100 * 1.002) * 1.002), but to be precise you have to look at it the way I outlined it above.

Alright class, if anyone has a question please raise your hand  :D






Title: Re: Simple BTC-E question
Post by: winsucker on May 19, 2013, 01:52:20 PM
I believe BTC-E takes their cut out of the BTC you receive, so:

You would sell your 100 USD and receive 1 BTC minus 0.2% (0.998 BTC).

We want that 0.998BTC to be worth 100 USD, after the fee--which means 100USD is 99.8% of the sale price.

100 / .998 will give us the total sales price: 100.2004008...

So you would need to sell your .998BTC for roughly 100.2004USD, but we measure price in the 1 BTC = x USD format, so:

0.998 BTC is 99.8% of the ideal price of 1 BTC, which means 100.2004 is 99.8% of the price of 1 BTC.

100.2004 / .998 = 100.4012

So you would need to sell when the price is 100.4012 USD per bitcoin.

To test this:

.998 BTC * 100.4012USD = 100.2003976USD, minus .2% (100.2003976 * .998 = 99.999996... USD)
Of course it doesn't add up to exactly 100USD, because I truncated a few decimal places  ;D

You were very close in your original thinking ((100 * 1.002) * 1.002), but to be precise you have to look at it the way I outlined it above.

Alright class, if anyone has a question please raise your hand  :D

T-thanks

http://img.pandawhale.com/42255-Im-not-a-smart-man-Forrest-Gum-W2X0.jpeg


Title: Re: Simple BTC-E question
Post by: tysat on May 19, 2013, 01:54:59 PM
@OP

Don't bump your post 10 minutes after you make it.


Title: Re: Simple BTC-E question
Post by: winsucker on May 19, 2013, 01:59:55 PM
@OP

Don't bump your post 10 minutes after you make it.

I'm sorry - will not happened again.