diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index f96f1063c..a960f33bc 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -657,7 +657,7 @@ jpg(srcfile, destfile, power2=7, passphrase, data="", required)\n\ return(jprint(LP_fundvalue(argjson),1)); else if ( strcmp(method,"getprice") == 0 || strcmp(method,"getmyprice") == 0 ) { - double price,bid,ask,tmp; + double price,bid,ask; if ( strcmp(method,"getprice") == 0 ) { ask = LP_price(base,rel); @@ -666,8 +666,8 @@ jpg(srcfile, destfile, power2=7, passphrase, data="", required)\n\ } else { - ask = LP_myprice(&tmp,&tmp,base,rel); - if ( (bid= LP_myprice(&tmp,&tmp,rel,base)) > SMALLVAL ) + ask = LP_getmyprice(base,rel); + if ( (bid= LP_getmyprice(rel,base)) > SMALLVAL ) bid = 1./bid; } price = _pairaved(bid,ask); diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 8553537ec..de81368dc 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -561,6 +561,18 @@ double LP_price(char *base,char *rel) return(price); } +double LP_getmyprice(char *base,char *rel) +{ + struct LP_priceinfo *basepp; int32_t relind; double price = 0.; + if ( (basepp= LP_priceinfoptr(&relind,base,rel)) != 0 ) + { + if ( (price= basepp->myprices[relind]) == 0. ) + { + } + } + return(price); +} + cJSON *LP_priceinfomatrix(int32_t usemyprices) { int32_t i,j,n,m; double total,sum,val; struct LP_priceinfo *pp; uint32_t now; struct LP_cacheinfo *ptr,*tmp; cJSON *vectorjson = cJSON_CreateObject();