Eru Ilúvatar bfbf1cc379
feat: analyze profits - closes #19 (#20)
* feat: analyze profits - closes #19

Signed-off-by: Arthurim <arthurbdauphine@gmail.com>

* feat: analyze profits - closes #19

Signed-off-by: Arthurim <arthurbdauphine@gmail.com>

* fix peotry lock

Signed-off-by: Arthurim <arthurbdauphine@gmail.com>

* feat: add save to csv option

Signed-off-by: Arthurim <arthurbdauphine@gmail.com>

* fix: update dockerfile to resolve deps automatically at build-time

Signed-off-by: Luca Georges Francois <luca@quartz.technology>

* feat: add porfit by day

Signed-off-by: Arthurim <arthurbdauphine@gmail.com>

* feat: add failures saving

Signed-off-by: Arthurim <arthurbdauphine@gmail.com>

* fix: launch script

Signed-off-by: Arthurim <arthurbdauphine@gmail.com>

* feat: get rpc url from env

Signed-off-by: Arthurim <arthurbdauphine@gmail.com>

Signed-off-by: Arthurim <arthurbdauphine@gmail.com>
Signed-off-by: Luca Georges Francois <luca@quartz.technology>
Co-authored-by: Luca Georges Francois <luca@quartz.technology>
2023-01-16 07:00:21 +00:00

16 lines
553 B
Python

import pandas as pd
from profit_analysis.column_names import TOKEN_KEY
from profit_analysis.constants import DATA_PATH
def get_decimals(token_address):
decimals_mapping = pd.read_csv(DATA_PATH + "address_to_decimals.csv")
decimals_mapping[TOKEN_KEY] = decimals_mapping[TOKEN_KEY].str.lower()
decimals = decimals_mapping.loc[
decimals_mapping[TOKEN_KEY] == token_address.lower(), "decimals"
].values
if len(decimals) > 0:
return decimals[0]
else:
raise Exception("No Decimals for token=", token_address)