Skip to content

Commit

Permalink
trading: auto set bittrex and bleutrade withdraw tx fee
Browse files Browse the repository at this point in the history
  • Loading branch information
tpruvot committed Apr 3, 2018
1 parent 31441a6 commit 2f6d74d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
18 changes: 14 additions & 4 deletions web/yaamp/core/backend/rawcoins.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,31 @@ function updateRawcoins()

if (!exchange_get('bittrex', 'disabled')) {
$list = bittrex_api_query('public/getcurrencies');
if(isset($list->result))
if(isset($list->result) && !empty($list->result))
{
dborun("UPDATE markets SET deleted=true WHERE name='bittrex'");
foreach($list->result as $currency)
foreach($list->result as $currency) {
if ($currency->Currency == 'BTC') {
exchange_set('bittrex', 'withdraw_fee_btc', $currency->TxFee);
continue;
}
updateRawCoin('bittrex', $currency->Currency, $currency->CurrencyLong);
}
}
}

if (!exchange_get('bleutrade', 'disabled')) {
$list = bleutrade_api_query('public/getcurrencies');
if(isset($list->result))
if(isset($list->result) && !empty($list->result))
{
dborun("UPDATE markets SET deleted=true WHERE name='bleutrade'");
foreach($list->result as $currency)
foreach($list->result as $currency) {
if ($currency->Currency == 'BTC') {
exchange_set('bleutrade', 'withdraw_fee_btc', $currency->TxFee);
continue;
}
updateRawCoin('bleutrade', $currency->Currency, $currency->CurrencyLong);
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion web/yaamp/core/trading/bittrex_trading.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ function doBittrexTrading($quick=false)
}

$withdraw_min = exchange_get($exchange, 'withdraw_min_btc', EXCH_AUTO_WITHDRAW);
$withdraw_fee = exchange_get($exchange, 'withdraw_fee_btc', 0.001);
$withdraw_fee = exchange_get($exchange, 'withdraw_fee_btc', 0.0005);
if($withdraw_min > 0 && $savebalance->balance >= ($withdraw_min + $withdraw_fee))
{
// $btcaddr = exchange_get($exchange, 'withdraw_btc_address', YAAMP_BTCADDRESS);
Expand Down

0 comments on commit 2f6d74d

Please sign in to comment.