asset¶
- class algofipy.amm.v1.asset.Asset(amm_client, asset_id)¶
Bases:
object
- get_decimal_amount(amount)¶
Returns a decimal representation of the input amount :param amount: amount of asset in base units :type amount: int :return: float decimal amount of asset :rtype: float
- get_scaled_amount(amount)¶
Returns an integer representation of asset amount scaled by asset’s decimals :param amount: amount of asset :type amount: float :return: int amount of asset scaled by decimals :rtype: int
- refresh_price()¶
Refreshes the dollar price of the asset
- to_usd(amount)¶
Returns a dollar amount of asset given an amount in base units :param amount: amount of asset :type amount: float :return: decimal dollar amount of asset :rtype: float