Browse Source

test

etomic
jl777 8 years ago
parent
commit
0d6afc6151
  1. 8
      basilisk/basilisk_DEX.c
  2. 4
      basilisk/basilisk_tradebot.c

8
basilisk/basilisk_DEX.c

@ -502,14 +502,17 @@ THREE_STRINGS_AND_DOUBLE(tradebot,aveprice,comment,base,rel,basevolume)
ZERO_ARGS(InstantDEX,allcoins)
{
struct iguana_info *tmp; cJSON *notarychains,*basilisk,*virtual,*full,*retjson = cJSON_CreateObject();
struct iguana_info *tmp; cJSON *native,*notarychains,*basilisk,*virtual,*full,*retjson = cJSON_CreateObject();
full = cJSON_CreateArray();
native = cJSON_CreateArray();
basilisk = cJSON_CreateArray();
virtual = cJSON_CreateArray();
notarychains = cJSON_CreateArray();
HASH_ITER(hh,myinfo->allcoins,coin,tmp)
{
if ( coin->virtualchain != 0 )
if ( coin->FULLNODE < 0 )
jaddistr(native,coin->symbol);
else if ( coin->virtualchain != 0 )
jaddistr(virtual,coin->symbol);
if ( coin->FULLNODE > 0 || coin->VALIDATENODE > 0 )
jaddistr(full,coin->symbol);
@ -517,6 +520,7 @@ ZERO_ARGS(InstantDEX,allcoins)
jaddistr(notarychains,coin->symbol);
else jaddistr(basilisk,coin->symbol);
}
jadd(retjson,"native",native);
jadd(retjson,"basilisk",basilisk);
jadd(retjson,"full",full);
jadd(retjson,"virtual",virtual);

4
basilisk/basilisk_tradebot.c

@ -315,8 +315,8 @@ double basilisk_request_listprocess(struct supernet_info *myinfo,struct basilisk
}
// MVP -> USD myrequest.0 pendingid.0 noquoteflag.1 havequoteflag.0 maxi.-1 0.00000000
printf("%s -> %s myrequest.%d pendingid.%u noquoteflag.%d havequoteflag.%d maxi.%d %.8f\n",list[0].src,list[0].dest,myrequest,pendingid,noquoteflag,havequoteflag,maxi,dstr(maxamount));
double retvals[4],refprice,profitmargin,aveprice; cJSON *retjson; char *retstr;
if ( myinfo->IAMLP != 0 && myrequest == 0 && pendingid == 0 && noquoteflag != 0 && (profitmargin= tradebot_liquidity_active(myinfo,&refprice,"DEX",list[0].src,list[0].dest,(double)maxamount/SATOSHIDEN)) > 0. )
double retvals[4],refprice=0.,profitmargin,aveprice; cJSON *retjson; char *retstr;
if ( myinfo->IAMLP != 0 && myrequest == 0 && pendingid == 0 && noquoteflag != 0 && ((profitmargin= tradebot_liquidity_active(myinfo,&refprice,"DEX",list[0].src,list[0].dest,(double)maxamount/SATOSHIDEN)) > 0. || refprice != 0.) )
{
if ( (aveprice= instantdex_avehbla(myinfo,retvals,list[0].src,list[0].dest,1.3 * dstr(list[0].srcamount))) == 0. || refprice > aveprice )
aveprice = refprice;

Loading…
Cancel
Save