示例#1
0
def main():
    global DEBUG
    args = docopt(__doc__)
    if args['--debug']:
        DEBUG = True

    poloniex = Poloniex()
    max_demand = poloniex.get_max_demand_rate()
    min_offer = poloniex.get_min_offer_rate()
    min_big_offer = poloniex.get_min_offer_rate(BTC_PER_BIG_OFFER)

    print "max_demand:", max_demand,
    print "min_offer:", min_offer,
    print "min_big_offer:", min_big_offer

    if not DEBUG:
        keen.add_event("lending-rates", {
            "max-demand": max_demand,
            "min-offer": min_offer,
            "min-big-offer": min_big_offer
        })
示例#2
0
def main():
    global DEBUG
    args = docopt(__doc__)
    if args['--debug']:
        DEBUG = True

    poloniex = Poloniex()
    max_demand = poloniex.get_max_demand_rate()
    min_offer = poloniex.get_min_offer_rate()
    min_big_offer = poloniex.get_min_offer_rate(BTC_PER_BIG_OFFER)

    print "max_demand:", max_demand,
    print "min_offer:", min_offer,
    print "min_big_offer:", min_big_offer

    if not DEBUG:
        keen.add_event(
            "lending-rates", {
                "max-demand": max_demand,
                "min-offer": min_offer,
                "min-big-offer": min_big_offer
            })
示例#3
0
def main():
    """
    Algorithm:

    If unused BTC:
        get min big loan offer
        Offer unused BTC at (min loan offer - 0.0001%)
    """
    global DEBUG
    args = docopt(__doc__)
    if args['--debug']:
        DEBUG = True

    api_key = os.environ.get('POLONIEX_API_KEY')
    secret = os.environ.get('POLONIEX_SECRET')

    poloniex = Poloniex(api_key=api_key, secret=secret)
    unused_btc = poloniex.get_unused()

    if DEBUG:
        print "Unused BTC:", unused_btc

    if unused_btc:
        min_big_offer = poloniex.get_min_offer_rate(BTC_PER_BIG_OFFER)

        # Get 0.0001% below
        my_rate = min_big_offer - (0.0001 / 100)

        if DEBUG:
            print "poloniex.offer_btc_loan({}, {}, {})".format(
                my_rate, unused_btc, LOAN_DURATION)
        else:
            # Place the actual order
            order_id = poloniex.offer_btc_loan(my_rate,
                                               unused_btc,
                                               LOAN_DURATION)

            # Order status
            if order_id:
                print "Order placed ({})".format(order_id),
            else:
                print "Order failed",
            print "(Rate:", my_rate * 100, "%, Amount:", unused_btc, "BTC)"
示例#4
0
def main():
    """
    Algorithm:

    If unused BTC:
        get min big loan offer
        Offer unused BTC at (min loan offer - 0.0001%)
    """
    global DEBUG
    args = docopt(__doc__)
    if args['--debug']:
        DEBUG = True

    api_key = os.environ.get('POLONIEX_API_KEY')
    secret = os.environ.get('POLONIEX_SECRET')

    poloniex = Poloniex(api_key=api_key, secret=secret)
    unused_btc = poloniex.get_unused()

    if DEBUG:
        print "Unused BTC:", unused_btc

    if unused_btc:
        min_big_offer = poloniex.get_min_offer_rate(BTC_PER_BIG_OFFER)

        # Get 0.0001% below
        my_rate = min_big_offer - (0.0001 / 100)

        if DEBUG:
            print "poloniex.offer_btc_loan({}, {}, {})".format(
                my_rate, unused_btc, LOAN_DURATION)
        else:
            # Place the actual order
            order_id = poloniex.offer_btc_loan(my_rate, unused_btc,
                                               LOAN_DURATION)

            # Order status
            if order_id:
                print "Order placed ({})".format(order_id),
            else:
                print "Order failed",
            print "(Rate:", my_rate * 100, "%, Amount:", unused_btc, "BTC)"