diff --git a/mpm/mpm b/mpm/mpm index f658273..f731dec 100755 --- a/mpm/mpm +++ b/mpm/mpm @@ -426,7 +426,10 @@ sub vrscbridge_latest_price { $command = '{"jsonrpc":"1.0","id":"curltest","method":"getcurrencystate","params":["Bridge.vETH"]}'; $req->content($command); my $resp = $ua->request($req); - if ($resp->is_success) { + if (length from_json($resp->content)->{"error"}{"code"}) { + print "ERROR: ", from_json($resp->content)->{"error"}{"message"}, "\n"; + return 1; + } elsif ($resp->is_success) { return $resp->content; } else { print "HTTP GET url: ", $url, "\n"; @@ -448,7 +451,10 @@ sub varrrbridge_latest_price { $command = '{"jsonrpc":"1.0","id":"curltest","method":"getcurrencystate","params":["Bridge.vARRR"]}'; $req->content($command); my $resp = $ua->request($req); - if ($resp->is_success) { + if (length from_json($resp->content)->{"error"}{"code"}) { + print "ERROR: ", from_json($resp->content)->{"error"}{"message"}, "\n"; + return 1; + } elsif ($resp->is_success) { return $resp->content; } else { print "HTTP GET url: ", $url, "\n"; @@ -470,7 +476,10 @@ sub vdexbridge_latest_price { $command = '{"jsonrpc":"1.0","id":"curltest","method":"getcurrencystate","params":["Bridge.vDEX"]}'; $req->content($command); my $resp = $ua->request($req); - if ($resp->is_success) { + if (length from_json($resp->content)->{"error"}{"code"}) { + print "ERROR: ", from_json($resp->content)->{"error"}{"message"}, "\n"; + return 1; + } elsif ($resp->is_success) { return $resp->content; } else { print "HTTP GET url: ", $url, "\n"; @@ -2611,9 +2620,9 @@ if ( $api eq "dex_gecko" ) { if ( (($base eq "KMD") && ($coin eq "KMD-BEP20")) || (($base eq "FIRO") && ($coin eq "FIRO-BEP20")) || (($base eq "DOGE") && ($coin eq "DOGE-BEP20")) || (($base eq "FLUX") && ($coin eq "FLUX-BEP20")) ) { $price = 1; } elsif ( (defined $binance_usd_symbol) || (defined $binance_btc_symbol) || (defined $usd_stablecoin) || (defined $chainlink_usd_bep) || (defined $chainlink_usd_eth) || (defined $usdrate_symbol) || (defined $kucoin_usd_symbol) ) { - $marginadd = max($change,$base_4h_change)/100/4; + $marginadd = max($change,$base_4h_change)/100/4.5; } else { - $marginadd = max($change,$base_4h_change)/100/3; + $marginadd = max($change,$base_4h_change)/100/3.5; } #print "====== $coin change: $change, $base base_4h_change: $base_4h_change, marginadd: $marginadd\n";