Browse Source

Test

etomic
jl777 8 years ago
parent
commit
e119b6c3fc
  1. 24
      iguana/exchanges/LP_prices.c
  2. 2
      iguana/exchanges/LP_rpc.c

24
iguana/exchanges/LP_prices.c

@ -782,9 +782,23 @@ double LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinf
return(nxtkmd); return(nxtkmd);
} }
static char *assetids[][2] =
{
{ "12071612744977229797", "UNITY" },
{ "15344649963748848799", "DEX" },
{ "6883271355794806507", "PANGEA" },
{ "17911762572811467637", "JUMBLR" },
{ "17083334802666450484", "BET" },
{ "13476425053110940554", "CRYPTO" },
{ "6932037131189568014", "HODL" },
{ "3006420581923704757", "SHARK" },
{ "17571711292785902558", "BOTS" },
{ "10524562908394749924", "MGW" },
};
void prices_loop(void *ignore) void prices_loop(void *ignore)
{ {
char *retstr,*assetid; cJSON *retjson; int32_t i; double nxtkmd,price; struct LP_priceinfo *btcpp,*kmdpp,*fiatpp; void *ctx = bitcoin_ctx(); char *retstr; cJSON *retjson; int32_t i; double nxtkmd,price; struct LP_priceinfo *btcpp,*kmdpp,*fiatpp; void *ctx = bitcoin_ctx();
while ( 1 ) while ( 1 )
{ {
if ( LP_autoprices == 0 ) if ( LP_autoprices == 0 )
@ -832,13 +846,15 @@ void prices_loop(void *ignore)
} }
if ( nxtkmd > SMALLVAL ) if ( nxtkmd > SMALLVAL )
{ {
assetid = "12071612744977229797"; for (i=0; i<sizeof(assetids)/sizeof(*assetids); i++)
if ( (retjson= LP_assethbla(assetid)) != 0 ) {
if ( (retjson= LP_assethbla(assetids[i][0])) != 0 )
{ {
printf("%s -> (%s) nxtkmd %.8f\n",assetid,jprint(retjson,0),nxtkmd); printf("%s %s -> (%s) nxtkmd %.8f\n",assetids[i][1],assetids[i][0],jprint(retjson,0),nxtkmd);
free_json(retjson); free_json(retjson);
} }
} }
}
sleep(60); sleep(60);
} }
} }

2
iguana/exchanges/LP_rpc.c

@ -228,7 +228,7 @@ cJSON *LP_assethbla(char *assetid)
{ {
if ( (array= jarray(&n,bid,"bidOrders")) != 0 ) if ( (array= jarray(&n,bid,"bidOrders")) != 0 )
jadd(retjson,"bid",jduplicate(jitem(array,0))); jadd(retjson,"bid",jduplicate(jitem(array,0)));
if ( (array= jarray(&n,bid,"askOrders")) != 0 ) if ( (array= jarray(&n,ask,"askOrders")) != 0 )
jadd(retjson,"ask",jduplicate(jitem(array,0))); jadd(retjson,"ask",jduplicate(jitem(array,0)));
} }
if ( bid != 0 ) if ( bid != 0 )

Loading…
Cancel
Save