Bitcoin Forum

Economy => Trading Discussion => Topic started by: OdinHephaestus on April 20, 2013, 04:21:12 AM



Title: [PHP] VirWox BTC/USD Exchange Rate
Post by: OdinHephaestus on April 20, 2013, 04:21:12 AM
So, had to make this for a project, and thought I would share.

This is a simple PHP script that calculates the BTC<->USD exchange rate on VirWox, after fees.

Code:
function getVirWoxRate() {
$curs = json_decode(file_get_contents("http://api.virwox.com/api/json.php?method=getMarketDepth&symbols%5b0%5d=USD/SLL&symbols%5b1%5d=BTC/SLL&buyDepth=1&sellDepth=1&id=1"))->{'result'};
$usd = $curs[0]->{'buy'}[0]->{'price'}; //Price of USD in SLL
$btc = $curs[1]->{'buy'}[0]->{'price'}; //Price of BTC in SLL
$tran1 = $btc-($btc*.029); //Price of BTC in SLL after Fee
$tran2i = $tran1/$usd; //Price of BTC in USD before Fee
$tran2 = $tran2i-($tran2i*.029); //Price of BTC in USD after Fee
return $tran2;
}


Title: Re: [PHP] VirWox BTC/USD Exchange Rate
Post by: caktux on August 03, 2013, 10:03:43 AM
Thank you for this! I made a USD/BTC tracking chart based on this at http://caktux.ca/virwox comparing the resulting price with MtGox and Bitstamp. Deposit and withdrawal fees are also taken into account. I was surprised to see that even after all those fees, there are a few times when you can get a better rate than at the other exchanges.

Code:
    $usd = $virwox->result[0]->sell[0]->price - (50 / $virwox->result[0]->buy[0]->price); // Price of USD to SLL + commission fee of 50 SLL
    $usd_with_fees = $usd - ($usd * 0.029); // Price of USD to SLL + fee

    $btc = $virwox->result[1]->buy[0]->price + 50; // Price of SLL to BTC + commission fee
    $btc_with_fees = $btc + ($btc * 0.029); // Price of SLL to BTC + fee

    $rate_with_fees = $btc_with_fees / $usd_with_fees;

    $rate_virwox = $rate_with_fees + ($rate_with_fees * 0.034) + 0.5 + (0.01 * $rate_with_fees); // Price of BTC to USD + initial deposit fee + .35 EUR->USD + withdrawal fee


Title: Re: [PHP] VirWox BTC/USD Exchange Rate
Post by: Hfleer on August 03, 2013, 10:18:53 AM
Thank you for this! I made a USD/BTC tracking chart based on this at http://caktux.ca/virwox comparing the resulting price with MtGox and Bitstamp. Deposit and withdrawal fees are also taken into account. I was surprised to see that even after all those fees, there are a few times when you can get a better rate than at the other exchanges.


For a market order right now would cost $101.85 per BTC, and you could sell for $96.50.  That's without the fees which I think change with your volume and the order type, but are pretty high.  Your site says 106-108, so sell is probably around 90ish with those fees.  The Buy is not too horrible if you're doing it on credit.


Title: Re: [PHP] VirWox BTC/USD Exchange Rate
Post by: Lavabo on August 27, 2013, 03:42:30 PM
Thank you for this! I made a USD/BTC tracking chart based on this at http://caktux.ca/virwox comparing the resulting price with MtGox and Bitstamp. Deposit and withdrawal fees are also taken into account. I was surprised to see that even after all those fees, there are a few times when you can get a better rate than at the other exchanges.


Interesting, but is it possible to have BTC/USD  live chart??  When im trading my BTC im having a hard time understanding the SLL rate

thanks


Title: Re: [PHP] VirWox BTC/USD Exchange Rate
Post by: chmod755 on August 29, 2013, 06:56:39 PM
There are discounts on the trading fees for limit orders based on your trading activity during the last 30 days - so your results might be different from the chart if you're using limit orders instead of market orders.


Title: Re: [PHP] VirWox BTC/USD Exchange Rate
Post by: bitcon on September 01, 2013, 07:03:55 AM
^this.  you get higher discount the more trades you complete