jl777 7 years ago
parent
commit
0c9a957a04
  1. 2
      iguana/exchanges/LP_commands.c
  2. 2
      iguana/exchanges/LP_instantdex.c
  3. 6
      iguana/exchanges/LP_ordermatch.c
  4. 2
      iguana/exchanges/LP_portfolio.c
  5. 2
      iguana/exchanges/LP_prices.c
  6. 2
      iguana/exchanges/LP_remember.c
  7. 4
      iguana/exchanges/LP_signatures.c
  8. 4
      iguana/exchanges/LP_stats.c
  9. 4
      iguana/exchanges/LP_tradebots.c

2
iguana/exchanges/LP_commands.c

@ -681,7 +681,7 @@ jpg(srcfile, destfile, power2=7, password, data="", required, ind=0)\n\
jaddnum(retjson,"timestamp",time(NULL));
jaddnum(retjson,"bid",bid);
jaddnum(retjson,"ask",ask);
jaddnum(retjson,"price",dstr(SATOSHIDEN * price));
jaddnum(retjson,"price",price);
return(jprint(retjson,1));
}
/*else if ( strcmp(method,"getpeers") == 0 )

2
iguana/exchanges/LP_instantdex.c

@ -567,7 +567,7 @@ cJSON *LP_swapstats_item(struct LP_swapstats *sp,int32_t iambob)
jaddnum(item,"satoshis",sp->Q.satoshis);
jaddstr(item,"rel",sp->Q.destcoin);
jaddnum(item,"destsatoshis",sp->Q.destsatoshis);
jaddnum(item,"price",dstr(SATOSHIDEN * (sp->Q.destsatoshis/((double)sp->Q.satoshis+1))));
jaddnum(item,"price",sp->Q.destsatoshis/((double)sp->Q.satoshis+1));
if ( LP_swap_finished(sp,1) == 0 )
{
jaddnum(item,"finished",sp->finished);

6
iguana/exchanges/LP_ordermatch.c

@ -181,7 +181,7 @@ double LP_quote_validate(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,str
return(-33);
}
if ( qp->satoshis != 0 )
qprice = ((double)qp->destsatoshis / (qp->satoshis-qp->txfee)) + 0.000000049;
qprice = ((double)qp->destsatoshis / (qp->satoshis-qp->txfee));
LP_txfees(&txfee,&desttxfee,qp->srccoin,qp->destcoin);
if ( txfee < qp->txfee )
txfee = qp->txfee;
@ -846,7 +846,7 @@ struct LP_quoteinfo *LP_trades_gotrequest(void *ctx,struct LP_quoteinfo *qp,stru
LP_abutxo_set(autxo,butxo,qp);
if ( bits256_nonz(qp->srchash) == 0 || bits256_cmp(qp->srchash,G.LP_mypub25519) == 0 )
{
qprice = (double)qp->destsatoshis / (qp->satoshis - qp->txfee) + 0.000000049;
qprice = (double)qp->destsatoshis / (qp->satoshis - qp->txfee);
strcpy(qp->gui,G.gui);
strcpy(qp->coinaddr,coin->smartaddr);
strcpy(butxo->coinaddr,coin->smartaddr);
@ -980,7 +980,7 @@ int32_t LP_trades_bestpricecheck(void *ctx,struct LP_trade *tp)
//printf("check bestprice %.8f vs new price %.8f\n",tp->bestprice,(double)Q.destsatoshis/Q.satoshis);
if ( Q.satoshis != 0 && (pubp= LP_pubkeyadd(Q.srchash)) != 0 )//(qprice= LP_trades_alicevalidate(ctx,&Q)) > 0. )
{
qprice = (double)Q.destsatoshis / (Q.satoshis - Q.txfee) + 0.000000049;
qprice = (double)Q.destsatoshis / (Q.satoshis - Q.txfee);
LP_aliceid(Q.tradeid,tp->aliceid,"reserved",0,0);
if ( (retstr= LP_quotereceived(&Q)) != 0 )
free(retstr);

2
iguana/exchanges/LP_portfolio.c

@ -71,7 +71,7 @@ cJSON *LP_portfolio_entry(struct iguana_info *coin)
jaddstr(item,"coin",coin->symbol);
jaddstr(item,"address",coin->smartaddr);
jaddnum(item,"amount",dstr(coin->maxamount));
jaddnum(item,"price",dstr(SATOSHIDEN * coin->price_kmd));
jaddnum(item,"price",coin->price_kmd);
jaddnum(item,"kmd_equiv",dstr(coin->kmd_equiv));
jaddnum(item,"perc",coin->perc);
jaddnum(item,"goal",coin->goal);

2
iguana/exchanges/LP_prices.c

@ -741,7 +741,7 @@ cJSON *LP_orderbookjson(char *symbol,struct LP_orderbookentry *op)
{
jaddstr(item,"coin",symbol);
jaddstr(item,"address",op->coinaddr);
jaddnum(item,"price",dstr(SATOSHIDEN * op->price));
jaddnum(item,"price",op->price);
jaddnum(item,"numutxos",op->numutxos);
jaddnum(item,"avevolume",dstr(op->avesatoshis)*0.8);
jaddnum(item,"maxvolume",dstr(op->maxsatoshis)*0.8);

2
iguana/exchanges/LP_remember.c

@ -1399,7 +1399,7 @@ char *LP_recent_swaps(int32_t limit)
subitem = cJSON_CreateObject();
jaddnum(subitem,base,srcamount);
jaddnum(subitem,rel,destamount);
jaddnum(subitem,"price",dstr(SATOSHIDEN * -destamount/srcamount));
jaddnum(subitem,"price",-destamount/srcamount);
jaddi(item,subitem);
}
} else printf("base.%p rel.%p statusstr.%p baseind.%d relind.%d\n",base,rel,statusstr,baseind,relind);

4
iguana/exchanges/LP_signatures.c

@ -92,7 +92,7 @@ cJSON *LP_quotejson(struct LP_quoteinfo *qp)
if ( qp->satoshis != 0 )
{
price = (double)qp->destsatoshis / (qp->satoshis - qp->txfee);
jaddnum(retjson,"price",dstr(SATOSHIDEN * price));
jaddnum(retjson,"price",price);
}
}
if ( qp->R.requestid != 0 )
@ -405,7 +405,7 @@ char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *re
jaddstr(reqjson,"base",base);
jaddstr(reqjson,"rel",rel);
price64 = price * SATOSHIDEN + 0.0000000049;
jaddnum(reqjson,"price",dstr(price64));
jaddnum(reqjson,"price",price);
jadd64bits(reqjson,"price64",price64);
jaddstr(reqjson,"method","postprice");
timestamp = (uint32_t)time(NULL);

4
iguana/exchanges/LP_stats.c

@ -556,7 +556,7 @@ cJSON *LP_swapstats_json(struct LP_swapstats *sp)
jaddbits256(item,"dest",sp->Q.desthash);
jaddstr(item,"rel",sp->Q.destcoin);
jaddnum(item,"relvol",dstr(sp->Q.destsatoshis));
jaddnum(item,"price",dstr(SATOSHIDEN * sp->qprice));
jaddnum(item,"price",sp->qprice);
jaddnum(item,"requestid",sp->Q.R.requestid);
jaddnum(item,"quoteid",sp->Q.R.quoteid);
jaddnum(item,"finished",sp->finished);
@ -823,7 +823,7 @@ char *LP_ticker(char *refbase,char *refrel)
jaddnum(retitem,"timestamp",juint(item,"timestamp"));
jaddnum(retitem,base,basevol);
jaddnum(retitem,rel,relvol);
jaddnum(retitem,"price",dstr(SATOSHIDEN * (relvol/basevol)));
jaddnum(retitem,"price",relvol/basevol);
}
jaddi(retjson,retitem);
}

4
iguana/exchanges/LP_tradebots.c

@ -142,13 +142,13 @@ cJSON *LP_tradebot_tradejson(struct LP_tradebot_trade *tp,int32_t dispflag)
{
if ( dispflag > 0 )
{
jaddnum(item,"price",dstr(SATOSHIDEN * (tp->relvol/tp->basevol)));
jaddnum(item,"price",tp->relvol/tp->basevol);
jaddnum(item,"volume",tp->relvol);
}
else
{
price = LP_pricevol_invert(&basevol,tp->relvol / tp->basevol,tp->relvol);
jaddnum(item,"price",dstr(SATOSHIDEN * price));
jaddnum(item,"price",price);
jaddnum(item,"volume",basevol);
}
}

Loading…
Cancel
Save