Ejemplo n.º 1
0
 def recalc_pegged(self):
     for rate in self.get_pegged():
         bridge_rate = self.get_rate('BTC', rate['quote_code'])
         rates = [rate, bridge_rate]
         derived_rate = Rate.derive(rate['base_code'], 'BTC', rates)
         self.add_rate(derived_rate)
Ejemplo n.º 2
0
    rate_usdbtc = rate_btcusd.invert()
    print("rate_usdbtc: %s" % rate_usdbtc)

    rate_btccad = Rate("BTC", "CAD", 14011.28)
    print("rate_btccad: %s" % rate_btccad)

    rate_cadbtc = rate_btccad.invert()
    print("rate_catbtc: %s" % rate_cadbtc)

    rate_eggplantcad = Rate("EGGPLANT", "CAD", 2.49)
    print("rate_eggplantcad: %s" % rate_eggplantcad)

    rate_cadeggplant = rate_eggplantcad.invert()
    print("rate_cadeggplant: %s" % rate_cadeggplant)

    rate_btceggplant = Rate.derive("BTC", "EGGPLANT",
                                   [rate_eggplantcad, rate_btccad])
    print("derived1: %s" % rate_btceggplant)

    rate_btceggplant = Rate.derive("BTC", "EGGPLANT",
                                   [rate_btccad, rate_eggplantcad])
    print("derived2: %s" % rate_btceggplant)

    rate_btceggplant = Rate.derive("BTC", "EGGPLANT",
                                   [rate_cadbtc, rate_eggplantcad])
    print("derived3: %s" % rate_btceggplant)

    rate_btceggplant = Rate.derive("BTC", "EGGPLANT",
                                   [rate_btccad, rate_cadeggplant])
    print("derived4: %s" % rate_btceggplant)

    rate_ltccad = Rate.derive("LTC", "CAD",