Files
OpenBB/website/content/api/crypto/tools/il/_index.md
Colin Delahunty 0b33cb45f8 Adds auto yaml generation (#2587)
* Began working on docs creator

* Added fixes

* More

* More

* Adding autogen_try.py for OpenBB API doc generation

* OpenBB API docs gen try

* Fixed

* Added fixes

* Added fixes

* subs -> sub

* Updated docs

* Updated docs

Co-authored-by: Chavithra PARANA <chavithra@gmail.com>
2022-09-23 16:43:34 +01:00

1.4 KiB
Vendored

To obtain charts, make sure to add chart=True as the last parameter

Get underlying data

crypto.tools.il(price_changeA: float, price_changeB: float, proportion: float, initial_pool_value: float) -> Tuple[pandas.core.frame.DataFrame, str]

Calculates Impermanent Loss in a custom liquidity pool

Parameters
----------
price_changeA: float
    price change of crypto A in percentage
price_changeB: float
    price change of crypto B in percentage
proportion: float
    percentage of first token in pool
initial_pool_value: float
    initial value that pool contains

Returns
-------
Tuple:
    - pd.DataFrame: dataframe with results
    - str: narrative version of results

Getting charts

crypto.tools.il(price_changeA: int, price_changeB: int, proportion: int, initial_pool_value: int, narrative: bool = False, export: str = '', chart=True)

Displays Impermanent Loss in a custom liquidity pool

Parameters
----------
price_changeA: float
    price change of crypto A in percentage
price_changeB: float
    price change of crypto B in percentage
proportion: float
    percentage of first token in pool
initial_pool_value: float
    initial value that pool contains
narrative: str
    display narrative version instead of dataframe
export : str
    Export dataframe data to csv,json,xlsx file

Returns
-------