jl777 8 years ago
parent
commit
563c90e1c9
  1. 1
      basilisk/basilisk_swap.c
  2. 13
      basilisk/basilisk_tradebot.c

1
basilisk/basilisk_swap.c

@ -1958,7 +1958,6 @@ struct basilisk_swap *basilisk_thread_start(struct supernet_info *myinfo,struct
item = jitem(retarray,i);
if ( (msgobj= jarray(&n,item,"messages")) != 0 && n > 0 )
{
printf("msgobj.(%s)\n",jprint(msgobj,0));
item = jitem(msgobj,0);
if ( jobj(item,"data") != 0 && jobj(item,"key") != 0 )
m++;

13
basilisk/basilisk_tradebot.c

@ -45,11 +45,11 @@ void basilisk_swap_balancingtrade(struct supernet_info *myinfo,struct basilisk_s
}
if ( iambob != 0 )
{
printf("BOB: price %f * vol %f -> %s newprice %f\n",price,volume,dir < 0. ? "buy" : "sell",price + dir * price);
printf("BOB: price %f * vol %f -> %s newprice %f margin %.2f%%\n",price,volume,dir < 0. ? "buy" : "sell",price + dir * price * profitmargin,100*profitmargin);
}
else
{
printf("ALICE: price %f * vol %f -> %s newprice %f\n",price,volume,dir > 0. ? "buy" : "sell",price - dir * price);
printf("ALICE: price %f * vol %f -> %s newprice %f margin %.2f%%\n",price,volume,dir > 0. ? "buy" : "sell",price - dir * price * profitmargin,100*profitmargin);
}
}
@ -216,9 +216,12 @@ void basilisk_txlog(struct supernet_info *myinfo,struct basilisk_swap *swap,stru
dexobj = basilisk_swapobj(myinfo,swap);
if ( dexobj != 0 && (jsonstr= jprint(dexobj,1)) != 0 )
{
printf("%s\n",jsonstr);
fprintf(myinfo->dexfp,"%s,\n",jsonstr);
fflush(myinfo->dexfp);
//printf("%s\n",jsonstr);
if ( myinfo->dexfp != 0 )
{
fprintf(myinfo->dexfp,"%s,\n",jsonstr);
fflush(myinfo->dexfp);
}
free(jsonstr);
}
}

Loading…
Cancel
Save