Browse Source

Test

etomic
jl777 8 years ago
parent
commit
79d2c68033
  1. 2
      iguana/exchanges/LP_coins.c
  2. 6
      iguana/exchanges/LP_portfolio.c
  3. 2
      iguana/exchanges/LP_prices.c

2
iguana/exchanges/LP_coins.c

@ -271,7 +271,7 @@ struct iguana_info *LP_coinfind(char *symbol)
assetname = "";
if ( strcmp(symbol,"BTC") == 0 )
{
txfee = 50000;
txfee = 0;
estimatedrate = 300;
pubtype = 0;
p2shtype = 5;

6
iguana/exchanges/LP_portfolio.c

@ -404,7 +404,7 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp)
void prices_loop(void *ignore)
{
char *buycoin,*sellcoin,*retstr,*retstr2; double bid,ask,maxprice,relvolume; struct iguana_info *buy,*sell; uint32_t requestid,quoteid; cJSON *retjson,*retjson2; struct LP_priceinfo *btcpp; void *ctx = bitcoin_ctx();
char *buycoin,*sellcoin,*retstr,*retstr2; double bid,ask,maxprice,relvolume; struct iguana_info *buy,*sell; uint32_t requestid,quoteid,iter; cJSON *retjson,*retjson2; struct LP_priceinfo *btcpp; void *ctx = bitcoin_ctx();
while ( 1 )
{
if ( (btcpp= LP_priceinfofind("BTC")) == 0 )
@ -423,10 +423,10 @@ void prices_loop(void *ignore)
LP_myprice(&bid,&ask,buycoin,sellcoin);
maxprice = ask;
printf("base buy.%s force %f, rel sell.%s force %f relvolume %f maxprice %.8f (%.8f %.8f)\n",buycoin,jdouble(retjson,"buyforce"),sellcoin,jdouble(retjson,"sellforce"),sell->relvolume,maxprice,bid,ask);
if ( maxprice > SMALLVAL )
if ( maxprice > SMALLVAL && LP_utxo_bestfit(sellcoin,sell->relvolume) != 0 )
{
relvolume = sell->relvolume;
while ( relvolume > 0.0001 )
for (iter=0; iter<3; iter++)
{
requestid = quoteid = 0;
if ( (retstr2= LP_autotrade(ctx,"127.0.0.1",-1,buycoin,sellcoin,maxprice,sell->relvolume,60,24*3600)) != 0 )

2
iguana/exchanges/LP_prices.c

@ -344,7 +344,7 @@ int32_t LP_mypriceset(int32_t *changedp,char *base,char *rel,double price)
if ( fabs(basepp->myprices[relpp->ind] - price) > SMALLVAL )
*changedp = 1;
basepp->myprices[relpp->ind] = price; // ask
printf("LP_mypriceset base.%s rel.%s <- price %.8f\n",base,rel,price);
//printf("LP_mypriceset base.%s rel.%s <- price %.8f\n",base,rel,price);
//relpp->myprices[basepp->ind] = (1. / price); // bid
if ( (pubp= LP_pubkeyadd(LP_mypub25519)) != 0 )
{

Loading…
Cancel
Save