[Python] Price Feed Script for BitShares 2.0

Started by xeroc, October 09, 2015, 02:24:47 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

xeroc

I cant give a recommendation because I am not an economist ... every pro comes with a con

puppies

Quote from: xeroc on October 16, 2015, 04:00:02 AM
I just merged a pull request of forum member "alt" which allows to define the collateral and short squeeze ratio.
Plese update the code and add the new configuration parameters

Is there a recommended default setting?  I'm afraid I am not exactly sure what these parameters do.
[url="https://metaexchange.info"]https://metaexchange.info[/url] | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

xeroc

I just merged a pull request of forum member "alt" which allows to define the collateral and short squeeze ratio.
Plese update the code and add the new configuration parameters

xeroc


commit d6b19bc465fbd80021c20e814286cb4d27f8118d
Author: Fabian Schuh <[email protected]>
Date:   Wed Oct 14 12:54:00 2015 +0200

    Price Feed Script Update
   
    + added configuration variables to disable/enable exchanges
      New config Variables:
   
        ## Enable exchanges
        enable_yunbi             = True
        enable_btc38             = True
        enable_bter              = False
        enable_polonie           = True
        enable_bittrex           = True
        enable_btcavg            = True


twitter

could please explain the usage of following parameters in red? 



################################################################################
## RPC-client connection information (required)
################################################################################
host   = "localhost"
port   = 8092
user   = ""
passwd = ""
unlock = ""




################################################################################
## Fine tuning
################################################################################
discount                 = 0.995
core_exchange_factor     = 1.05 # 5% surplus if paying fees in bitassets

minValidAssetPriceInBTC  = 0.00001
change_min               = 0.5
witness:

twitter

witness:

puppies

Quote from: twitter on October 11, 2015, 01:39:10 AM
it complains  "No module named 'grapheneapi'"


python3 pricefeeds.py

Traceback (most recent call last):
  File "pricefeeds.py", line 44, in <module>
    from grapheneapi import GrapheneAPI
ImportError: No module named 'grapheneapi'


You need to either install grapheneapi with
python3 setup.py install --user

or copy pricefeeds.py and config.py to the python-graphenelib directory and run it from there.
[url="https://metaexchange.info"]https://metaexchange.info[/url] | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

twitter

it complains  "No module named 'grapheneapi'"


python3 pricefeeds.py

Traceback (most recent call last):
  File "pricefeeds.py", line 44, in <module>
    from grapheneapi import GrapheneAPI
ImportError: No module named 'grapheneapi'
witness:

Xeldal

Quote from: Spectral on October 10, 2015, 07:01:27 PM
Quote from: Xeldal on October 10, 2015, 06:20:17 PM
I assume the issue is where I define -s "<ip-of-full/witness-node:port>"  from the directions:
programs/cli_wallet/cli_wallet --rpc-http-endpoint="127.0.0.1:8092" -s "<ip-of-full/witness-node:port>"

but I can't find anything that makes it happy here.

I use this

./cli_wallet -w oct5_w0 --chain-id 60e21871125ea9995fe498b7f68a87a85c6583725ea5448f6fd969c59a37df83 -s ws://127.0.0.1:8090 -H 127.0.0.1:8092


That did it.  Thank you Spectral.

Xeldal

Having trouble getting feeds going.  Using https://python-graphenelib.readthedocs.org/en/latest/pricefeed.html

In launching the wallet I get the following error:
:~/graphene/programs/cli_wallet# ./cli_wallet -w test_wallet --chain-id 60e21871125ea9995fe498b7f68a87a85c6583725ea5448f6fd969c59a37df83 -H 127.0.0.1:8092 -s "127.0.0.1:8090"   
Logging RPC to file: logs/rpc/rpc.log
638120ms th_a       main.cpp:114                  main                 ] key_to_wif( committee_private_key ): 5...W
638121ms th_a       main.cpp:118                  main                 ] nathan_pub_key: GPH...V
638121ms th_a       main.cpp:119                  main                 ] key_to_wif( nathan_private_key ): 5...3
638122ms th_a       main.cpp:166                  main                 ] wdata.ws_server: 127.0.0.1:8090
10 assert_exception: Assert Exception
uri.substr(0,3) == "ws:":
    {}
    th_a  websocket.cpp:600 connect

    {"uri":"127.0.0.1:8090"}
    th_a  websocket.cpp:621 connect


I have witness running with this command:
./witness_node --rpc-endpoint "127.0.0.1:8090"  --genesis-json oct5-genesis.json -d oct5 -s "104.236.51.238:2005" -s "104.236.144.84:1776" --witness-id '"1.6.24"' --private-key '["GPH...t","5...5"]'


I assume the issue is where I define -s "<ip-of-full/witness-node:port>"  from the directions:
programs/cli_wallet/cli_wallet --rpc-http-endpoint="127.0.0.1:8092" -s "<ip-of-full/witness-node:port>"

but I can't find anything that makes it happy here.

xeroc

As per request from the testnet thread I swapped quote and base for the core exchange rate price .. even though I am pretty certain about that it doesn't change anything .. 10 core/asset equals 0.1 asset/core
no matter how you do it :)

spartako

wallet_account_set_approval spartako

xeroc

Forgot to mention that the current version requires manual confirmation of every feed. Hence you cant run it in a cronjob

liondani

[url="https://www.steempeak.com/@liondani"]https://www.steempeak.com/@liondani[/url]

alt