addfunding now in coins
try correct fraction of profits
This commit is contained in:
@@ -663,7 +663,7 @@ int64_t prices_syntheticprofits(int64_t &costbasis, int32_t firstheight, int32_t
|
|||||||
//std::cerr << "prices_syntheticprofits() profits double=" << (double)price / (double)costbasis -1.0 << std::endl;
|
//std::cerr << "prices_syntheticprofits() profits double=" << (double)price / (double)costbasis -1.0 << std::endl;
|
||||||
//double dprofits = (double)price / (double)costbasis - 1.0;
|
//double dprofits = (double)price / (double)costbasis - 1.0;
|
||||||
|
|
||||||
profits *= leverage * positionsize;
|
profits *= leverage * positionsize / SATOSHIDEN;
|
||||||
//dprofits *= leverage * positionsize;
|
//dprofits *= leverage * positionsize;
|
||||||
std::cerr << "prices_syntheticprofits() val profits=" << profits << std::endl;
|
std::cerr << "prices_syntheticprofits() val profits=" << profits << std::endl;
|
||||||
//std::cerr << "prices_syntheticprofits() dprofits=" << dprofits << std::endl;
|
//std::cerr << "prices_syntheticprofits() dprofits=" << dprofits << std::endl;
|
||||||
|
|||||||
@@ -1358,7 +1358,7 @@ UniValue pricesaddfunding(const UniValue& params, bool fHelp)
|
|||||||
{
|
{
|
||||||
if (fHelp || params.size() != 2)
|
if (fHelp || params.size() != 2)
|
||||||
throw runtime_error("pricesaddfunding bettxid amount\n"
|
throw runtime_error("pricesaddfunding bettxid amount\n"
|
||||||
"where amount is in satoshis\n");
|
"where amount is in coins\n");
|
||||||
LOCK(cs_main);
|
LOCK(cs_main);
|
||||||
UniValue ret(UniValue::VOBJ);
|
UniValue ret(UniValue::VOBJ);
|
||||||
|
|
||||||
@@ -1370,7 +1370,7 @@ UniValue pricesaddfunding(const UniValue& params, bool fHelp)
|
|||||||
if (bettxid.IsNull())
|
if (bettxid.IsNull())
|
||||||
throw runtime_error("invalid bettxid\n");
|
throw runtime_error("invalid bettxid\n");
|
||||||
|
|
||||||
CAmount amount = atoll(params[1].get_str().c_str());
|
CAmount amount = atof(params[1].get_str().c_str()) * COIN;
|
||||||
if (amount <= 0)
|
if (amount <= 0)
|
||||||
throw runtime_error("invalid amount\n");
|
throw runtime_error("invalid amount\n");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user