diff --git a/hatch.py b/hatch.py index 384ed8a..08a01a7 100644 --- a/hatch.py +++ b/hatch.py @@ -126,8 +126,9 @@ class Commons: return money_returned, realized_price - def token_price(self): + def dai_to_tokens(self, dai): """ - Query the bonding curve for the current token price, given the size of the commons's collateral pool. + Given the size of the common's collateral pool, return how many tokens would x DAI buy you. """ - return self.bonding_curve.get_token_price(self._collateral_pool) \ No newline at end of file + price = self.bonding_curve.get_token_price(self._collateral_pool) + return dai / price \ No newline at end of file