Bitcoin Forum
May 04, 2024, 09:33:23 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Simple BTC-E question  (Read 1112 times)
winsucker (OP)
Newbie
*
Offline Offline

Activity: 20
Merit: 0



View Profile
May 19, 2013, 11:55:50 AM
 #1

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";
?>
Remember that Bitcoin is still beta software. Don't put all of your money into BTC!
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714858403
Hero Member
*
Offline Offline

Posts: 1714858403

View Profile Personal Message (Offline)

Ignore
1714858403
Reply with quote  #2

1714858403
Report to moderator
Shutz
Newbie
*
Offline Offline

Activity: 33
Merit: 0


View Profile
May 19, 2013, 01:10:23 PM
 #2

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).
keatonatron
Sr. Member
****
Offline Offline

Activity: 308
Merit: 250


Jack of oh so many trades.


View Profile
May 19, 2013, 01:18:02 PM
 #3

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  Grin

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  Cheesy





1KEATSvAhbB7yj2baLB5xkyJSnkfqPGAqk
winsucker (OP)
Newbie
*
Offline Offline

Activity: 20
Merit: 0



View Profile
May 19, 2013, 01:52:20 PM
 #4

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  Grin

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  Cheesy

T-thanks

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

Activity: 966
Merit: 1004


Keep it real


View Profile
May 19, 2013, 01:54:59 PM
 #5

@OP

Don't bump your post 10 minutes after you make it.
winsucker (OP)
Newbie
*
Offline Offline

Activity: 20
Merit: 0



View Profile
May 19, 2013, 01:59:55 PM
 #6

@OP

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

I'm sorry - will not happened again.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!