jl777
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
19 additions and
0 deletions
-
iguana/exchanges/LP_include.h
-
iguana/exchanges/LP_portfolio.c
-
iguana/exchanges/LP_prices.c
|
|
@ -556,6 +556,7 @@ uint16_t LP_randpeer(char *destip); |
|
|
|
void LP_tradebot_pauseall(); |
|
|
|
int32_t LP_etomic_pub2addr(char *coinaddr,uint8_t pub64[64]); |
|
|
|
void LP_portfolio_reset(); |
|
|
|
int32_t LP_autoref_clear(char *base,char *rel); |
|
|
|
int32_t bitcoin_addr2rmd160(char *symbol,uint8_t taddr,uint8_t *addrtypep,uint8_t rmd160[20],char *coinaddr); |
|
|
|
struct LP_pubkey_info *LP_pubkeyadd(bits256 pubkey); |
|
|
|
uint32_t LP_atomic_locktime(char *base,char *rel); |
|
|
|
|
|
@ -455,6 +455,21 @@ double LP_tickered_price(int32_t bidask,char *base,char *rel,double price,cJSON |
|
|
|
return(price); |
|
|
|
} |
|
|
|
|
|
|
|
int32_t LP_autoref_clear(char *base,char *rel) |
|
|
|
{ |
|
|
|
int32_t i; |
|
|
|
for (i=0; i<num_LP_autorefs; i++) |
|
|
|
{ |
|
|
|
if ( (strcmp(rel,LP_autorefs[i].rel) == 0 && strcmp(base,LP_autorefs[i].base) == 0) || |
|
|
|
(strcmp(base,LP_autorefs[i].rel) == 0 && strcmp(rel,LP_autorefs[i].base) == 0) ) |
|
|
|
{ |
|
|
|
memset(&LP_autorefs[i],0,sizeof(LP_autorefs[i])); |
|
|
|
return(i); |
|
|
|
} |
|
|
|
} |
|
|
|
return(-1); |
|
|
|
} |
|
|
|
|
|
|
|
void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) |
|
|
|
{ |
|
|
|
static cJSON *tickerjson; static uint32_t lasttime; |
|
|
@ -540,6 +555,8 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) |
|
|
|
{ |
|
|
|
rel = LP_autorefs[i].rel; |
|
|
|
base = LP_autorefs[i].base; |
|
|
|
if ( rel[0] == 0 || base[0] == 0 ) |
|
|
|
continue; |
|
|
|
buymargin = LP_autorefs[i].buymargin; |
|
|
|
sellmargin = LP_autorefs[i].sellmargin; |
|
|
|
offset = LP_autorefs[i].offset; |
|
|
|
|
|
@ -532,6 +532,7 @@ int32_t LP_mypriceset(int32_t *changedp,char *base,char *rel,double price) |
|
|
|
relpp->sellmargins[basepp->ind] = 0.; |
|
|
|
relpp->offsets[basepp->ind] = 0.; |
|
|
|
relpp->factors[basepp->ind] = 0.; |
|
|
|
LP_autoref_clear(base,rel); |
|
|
|
margin = 0.; |
|
|
|
} |
|
|
|
else if ( (minprice= basepp->minprices[relpp->ind]) > SMALLVAL && price < minprice ) |
|
|
|