jl777 8 years ago
parent
commit
43897288fd
  1. 2
      basilisk/basilisk_DEX.c
  2. 1
      basilisk/basilisk_tradebot.c
  3. 1
      iguana/exchanges/poloniex.c

2
basilisk/basilisk_DEX.c

@ -173,7 +173,7 @@ cJSON *basilisk_requestjson(struct basilisk_request *rp)
int32_t i; struct basilisk_request R;
if ( basilisk_parsejson(&R,item) != 0 )
{
if ( memcmp(&R,rp,sizeof(*rp)) != 0 )
if ( memcmp(&R,rp,sizeof(*rp)-sizeof(uint32_t)) != 0 )
{
for (i=0; i<sizeof(*rp); i++)
printf("%02x",((uint8_t *)rp)[i]);

1
basilisk/basilisk_tradebot.c

@ -405,6 +405,7 @@ double basilisk_request_listprocess(struct supernet_info *myinfo,struct basilisk
aveprice = refprice;
if ( fabs(aveprice) < SMALLVAL )
return(0);
printf("avebid %f bidvol %f, aveask %f askvol %f\n",retvals[0],retvals[1],retvals[2],retvals[3]);
//retvals[0] = avebid, retvals[1] = bidvol, retvals[2] = aveask, retvals[3] = askvol;
destamount = (1.0 - profitmargin) * retvals[0] * list[0].srcamount;
if ( (retstr= InstantDEX_available(myinfo,iguana_coinfind(list[0].dest),0,0,list[0].dest)) != 0 )

1
iguana/exchanges/poloniex.c

@ -160,6 +160,7 @@ uint64_t TRADE(int32_t dotrade,char **retstrp,struct exchange_info *exchange,cha
if ( CHECKBALANCE(retstrp,dotrade,exchange,dir,base,rel,price,volume,argjson) == 0 && (json= SIGNPOST(&exchange->cHandle,dotrade,retstrp,exchange,EXCHANGE_AUTHURL,payload)) != 0 )
{
txid = (get_API_nxt64bits(cJSON_GetObjectItem(json,"orderNumber")) << 32) | get_API_nxt64bits(cJSON_GetObjectItem(json,"tradeID"));
printf("poloniex.%llu (%s)\n",(long long)txid,jprint(json,0));
free_json(json);
}
return(txid);

Loading…
Cancel
Save