diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index ee73163bb..c0cc1e9a6 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -137,13 +137,13 @@ forwardhex(pubkey,hex)\n\ return(LP_autotrade(ctx,myipaddr,pubsock,profitmargin,base,rel,price,jdouble(argjson,"relvolume"),jint(argjson,"timeout"),jint(argjson,"duration"))); } else return(clonestr("{\"error\":\"no price set\"}")); } - else if ( strcmp(method,"bestfit") == 0 ) - { - double relvolume; - if ( (relvolume= jdouble(argjson,"relvolume")) > SMALLVAL ) - return(LP_bestfit(rel,relvolume)); - else return(clonestr("{\"error\":\"no relvolume set\"}")); - } + } + else if ( rel != 0 && strcmp(method,"bestfit") == 0 ) + { + double relvolume; + if ( (relvolume= jdouble(argjson,"relvolume")) > SMALLVAL ) + return(LP_bestfit(rel,relvolume)); + else return(clonestr("{\"error\":\"no relvolume set\"}")); } else if ( (coin= jstr(argjson,"coin")) != 0 ) {