Example #1
0
    def get_input(self, id: int) -> Status:
        assert isinstance(id, int)

        # Read auction state
        bid = self.collateral_auction_house.bids(id)

        # Prepare the model input from auction state
        return Status(
            id=id,
            collateral_auction_house=self.collateral_auction_house.address,
            surplus_auction_house=None,
            debt_auction_house=None,
            staked_token_auction_house=None,
            bid_amount=None,
            amount_to_sell=bid.amount_to_sell,  # Wad
            amount_to_raise=bid.amount_to_raise,
            sold_amount=bid.sold_amount,
            raised_amount=bid.raised_amount,
            bid_increase=None,
            bid_decrease=None,
            high_bidder=None,
            block_time=block_time(self.collateral_auction_house.web3),
            bid_expiry=None,
            auction_deadline=bid.auction_deadline,
            price=None)
Example #2
0
    def get_input(self, id: int) -> Status:
        assert isinstance(id, int)

        # Read auction state
        bid = self.staked_token_auction_house.bids(id)

        # get latest redemption price
        redemption_price = self.geb.oracle_relayer.redemption_price()

        # Prepare the model input from auction state
        return Status(
            id=id,
            collateral_auction_house=None,
            surplus_auction_house=None,
            debt_auction_house=None,
            staked_token_auction_house=self.staked_token_auction_house.address,
            bid_amount=bid.bid_amount,
            amount_to_sell=bid.amount_to_sell,
            amount_to_raise=None,
            sold_amount=None,
            raised_amount=None,
            bid_increase=self.bid_increase,
            bid_decrease=None,
            high_bidder=bid.high_bidder,
            block_time=block_time(self.staked_token_auction_house.web3),
            bid_expiry=bid.bid_expiry,
            auction_deadline=bid.auction_deadline,
            price=Wad(bid.bid_amount * Rad(redemption_price) /
                      Rad(bid.amount_to_sell))
            if Rad(bid.amount_to_sell) != Rad(0) else None)
Example #3
0
    def get_input(self, id: int) -> Status:
        assert isinstance(id, int)

        # Read auction state
        bid = self.flipper.bids(id)

        # Prepare the model input from auction state
        return Status(id=id,
                      flipper=self.flipper.address,
                      flapper=None,
                      flopper=None,
                      bid=bid.bid,  # Rad
                      lot=bid.lot,  # Wad
                      tab=bid.tab,
                      beg=self.beg,
                      guy=bid.guy,
                      era=era(self.flipper.web3),
                      tic=bid.tic,
                      end=bid.end,
                      price=Wad(bid.bid / Rad(bid.lot)) if bid.lot != Wad(0) else None)
Example #4
0
    def get_input(self, id: int) -> Status:
        assert isinstance(id, int)

        # Read auction state
        bid = self.flapper.bids(id)

        # Prepare the model input from auction state
        return Status(id=id,
                      clipper=None,
                      flipper=None,
                      flapper=self.flapper.address,
                      flopper=None,
                      bid=bid.bid,
                      lot=bid.lot,
                      tab=None,
                      beg=self.beg,
                      guy=bid.guy,
                      era=era(self.flapper.web3),
                      tic=bid.tic,
                      end=bid.end,
                      price=Wad(bid.lot / Rad(bid.bid))
                      if bid.bid > Wad.from_number(0.000001) else None)
Example #5
0
    def get_input(self, id: int) -> Status:
        assert isinstance(id, int)

        # Read auction state
        (needs_redo, auction_price, lot, tab) = self.clipper.status(id)

        # Prepare the model input from auction state
        return Status(
            id=id,
            clipper=self.clipper.address,
            flipper=None,
            flapper=None,
            flopper=None,
            bid=auction_price *
            Ray(lot),  # Cost to take rest of auction at current price
            lot=lot,  # Wad
            tab=tab,
            beg=None,
            guy=None,
            era=era(self.clipper.web3),
            tic=self.clipper.sales(id).tic,
            end=None,
            price=auction_price)  # Current price of auction