Browse Source

Merge pull request #673 from jl777/jl777

bobside ordermatch percentage improvements
patch-3
jl777 7 years ago
committed by GitHub
parent
commit
a31e27a38e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      iguana/exchanges/LP_include.h
  2. 4
      iguana/exchanges/LP_ordermatch.c
  3. 2
      iguana/m_notary
  4. 2
      iguana/m_notary_run

4
iguana/exchanges/LP_include.h

@ -98,8 +98,8 @@ void emscripten_usleep(int32_t x); // returns immediate, no sense for sleeping
#define LP_SWAPSTEP_TIMEOUT 30 #define LP_SWAPSTEP_TIMEOUT 30
#define LP_MIN_TXFEE 1000 #define LP_MIN_TXFEE 1000
#define LP_MINVOL 20 #define LP_MINVOL 100
#define LP_MINCLIENTVOL 200 #define LP_MINCLIENTVOL 1000
#define LP_MINSIZE_TXFEEMULT 10 #define LP_MINSIZE_TXFEEMULT 10
#define LP_REQUIRED_TXFEE 0.75 #define LP_REQUIRED_TXFEE 0.75

4
iguana/exchanges/LP_ordermatch.c

@ -894,7 +894,7 @@ double LP_trades_pricevalidate(struct LP_quoteinfo *qp,struct iguana_info *coin,
struct LP_quoteinfo *LP_trades_gotrequest(void *ctx,struct LP_quoteinfo *qp,struct LP_quoteinfo *newqp,char *pairstr) struct LP_quoteinfo *LP_trades_gotrequest(void *ctx,struct LP_quoteinfo *qp,struct LP_quoteinfo *newqp,char *pairstr)
{ {
double price=0.,p=0.,qprice,myprice,bestprice,range,bid,ask; struct iguana_info *coin,*othercoin; struct LP_utxoinfo A,B,*autxo,*butxo; cJSON *reqjson; char str[65]; struct LP_address_utxo *utxos[1000]; int32_t i,r,counter,max = (int32_t)(sizeof(utxos)/sizeof(*utxos)); double price=0.,p=0.,qprice,myprice,bestprice,range,bid,ask; struct iguana_info *coin,*othercoin; struct LP_utxoinfo A,B,*autxo,*butxo; cJSON *reqjson; char str[65]; struct LP_address_utxo *utxos[4096]; int32_t i,r,counter,max = (int32_t)(sizeof(utxos)/sizeof(*utxos));
*newqp = *qp; *newqp = *qp;
qp = newqp; qp = newqp;
//printf("bob %s received REQUEST.(%llu)\n",bits256_str(str,G.LP_mypub25519),(long long)qp->aliceid); //printf("bob %s received REQUEST.(%llu)\n",bits256_str(str,G.LP_mypub25519),(long long)qp->aliceid);
@ -1446,7 +1446,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,
char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel,double maxprice,double relvolume,int32_t timeout,int32_t duration,char *gui,uint32_t nonce,bits256 destpubkey,uint32_t tradeid) char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel,double maxprice,double relvolume,int32_t timeout,int32_t duration,char *gui,uint32_t nonce,bits256 destpubkey,uint32_t tradeid)
{ {
uint64_t desttxfee,txfee; uint32_t lastnonce; int64_t bestsatoshis=0,destsatoshis; struct iguana_info *basecoin,*relcoin; struct LP_utxoinfo *autxo,B,A; struct LP_quoteinfo Q; bits256 pubkeys[100]; struct LP_address_utxo *utxos[1000]; int32_t maxiters=100,i,max=(int32_t)(sizeof(utxos)/sizeof(*utxos)); uint64_t desttxfee,txfee; uint32_t lastnonce; int64_t bestsatoshis=0,destsatoshis; struct iguana_info *basecoin,*relcoin; struct LP_utxoinfo *autxo,B,A; struct LP_quoteinfo Q; bits256 pubkeys[100]; struct LP_address_utxo *utxos[4096]; int32_t maxiters=100,i,max=(int32_t)(sizeof(utxos)/sizeof(*utxos));
basecoin = LP_coinfind(base); basecoin = LP_coinfind(base);
relcoin = LP_coinfind(rel); relcoin = LP_coinfind(rel);
if ( gui == 0 ) if ( gui == 0 )

2
iguana/m_notary

@ -2,4 +2,4 @@
pkill -15 iguana pkill -15 iguana
rm -f ../agents/iguana *.o rm -f ../agents/iguana *.o
git pull git pull
./m_notary_run ./m_notary_run $1

2
iguana/m_notary_run

@ -8,7 +8,7 @@ clang -g -Wno-deprecated -c -O2 -DISNOTARYNODE=1 -DLIQUIDITY_PROVIDER=1 *.c ../b
clang -g -Wno-deprecated -c -DISNOTARYNODE=1 -DLIQUIDITY_PROVIDER=1 main.c iguana777.c iguana_bundles.c ../basilisk/basilisk.c clang -g -Wno-deprecated -c -DISNOTARYNODE=1 -DLIQUIDITY_PROVIDER=1 main.c iguana777.c iguana_bundles.c ../basilisk/basilisk.c
clang -g -o ../agents/iguana *.o ../agents/libcrypto777.a -lnanomsg -lcurl -lssl -lcrypto -lpthread -lz -lm clang -g -o ../agents/iguana *.o ../agents/libcrypto777.a -lnanomsg -lcurl -lssl -lcrypto -lpthread -lz -lm
../agents/iguana notary & #> iguana.log 2> error.log & stdbuf -oL $1 ../agents/iguana notary & #> iguana.log 2> error.log &
myip=`curl -s4 checkip.amazonaws.com` myip=`curl -s4 checkip.amazonaws.com`
source pubkey.txt source pubkey.txt

Loading…
Cancel
Save