Browse Source

Test

etomic
jl777 7 years ago
parent
commit
e2023878e4
  1. 8
      iguana/exchanges/LP_ordermatch.c
  2. 5
      iguana/exchanges/LP_tradebots.c

8
iguana/exchanges/LP_ordermatch.c

@ -803,7 +803,9 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i
{
item = jitem(asks,i);
price = jdouble(item,"price");
price *= 1.005;
if ( price/maxprice < .9 )
price *= 1.025;
else price *= 1.001;
pubkey = jbits256(item,"pubkey");
if ( bits256_nonz(destpubkey) != 0 && bits256_cmp(destpubkey,pubkey) != 0 )
continue;
@ -824,8 +826,8 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i
{
bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160));
asatoshis = autxo->S.satoshis;
LP_listunspent_query(base,coinaddr);
LP_listunspent_both(base,coinaddr,1);
LP_listunspent_query(base,coinaddr);
//LP_listunspent_both(base,coinaddr,1);
for (j=0; j<maxiters; j++)
{
if ( (bestutxo= LP_ordermatch_iter(utxos,max,ordermatchpricep,bestsatoshisp,bestdestsatoshisp,basecoin,coinaddr,asatoshis,price,txfee,desttxfee,pubp->pubkey,gui)) != 0 )

5
iguana/exchanges/LP_tradebots.c

@ -262,8 +262,7 @@ double LP_orderbook_maxrel(char *base,char *rel,double maxprice)
char *retstr; int32_t i,numasks; cJSON *retjson,*asks,*item; double maxvol,maxrel = 0.;
if ( (retstr= LP_orderbook(base,rel,0)) != 0 )
{
printf("maxprice %.8f %s/%s\n",maxprice,base,rel);
//printf("maxprice %.8f %s/%s\n",maxprice,base,rel);
if ( (retjson= cJSON_Parse(retstr)) != 0 )
{
if ( (asks= jarray(&numasks,retjson,"asks")) != 0 )
@ -274,7 +273,7 @@ double LP_orderbook_maxrel(char *base,char *rel,double maxprice)
if ( jdouble(item,"price") > maxprice )
break;
maxvol = jdouble(item,"maxvolume");
printf("(%s) -> %.8f\n",jprint(item,0),maxvol);
//printf("(%s) -> %.8f\n",jprint(item,0),maxvol);
if ( maxvol > maxrel )
maxrel = maxvol;
}

Loading…
Cancel
Save