From 5d54e675e70a610a61791192be02037e5c7b00a2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 28 Mar 2018 16:27:51 +0300 Subject: [PATCH] Test --- iguana/exchanges/LP_ordermatch.c | 1 - iguana/exchanges/LP_prices.c | 7 ++++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index de7470a9a..40282356d 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -1509,7 +1509,6 @@ char *LP_autobuy(void *ctx,int32_t fomoflag,char *myipaddr,int32_t mypubsock,cha printf("maxutxo %.8f relvolume %.8f desttxfee %.8f\n",dstr(maxutxo),relvolume,dstr(desttxfee)); maxprice = LP_fomoprice(base,rel,&relvolume); printf("fomoprice %.8f relvolume %.8f\n",maxprice,relvolume); -maxprice = 0.; } else printf("no utxo available\n"); } if ( maxprice <= 0. || relvolume <= 0. || LP_priceinfofind(base) == 0 || LP_priceinfofind(rel) == 0 ) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 1f68a247a..12e409dda 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -996,10 +996,11 @@ double LP_fomoprice(char *base,char *rel,double *relvolumep) } free(retstr); } - if ( maxvol > 0. && maxvol < relvolume && fomoprice > 0. ) + if ( maxvol > 0. && fomoprice > 0. ) { - relvolume = maxvol * 0.98; - fomoprice /= 0.99; + if ( maxvol < relvolume ) + relvolume = maxvol * 0.98; + fomoprice /= 0.95; } else fomoprice = 0.; *relvolumep = relvolume; return(fomoprice);