# https://dexscreener.com/new-pairs?rankBy=pairAge&order=asc&chainIds=solana&minLiq=1000&minAge=4&maxAge=24&min24HTxns=600&min24HBuys=300&min24HSells=300
# filter已定义好的 的网址

from base_class import BaseVariableFunction
from base_class import *
baseclass = BaseVariableFunction(__file__)

baseclass.makedirpath(baseclass.newpair_merge_path)

print('\n'*5)
print(f"{'{:<6}'.format('ENTER')} {baseclass.scriptfilename} ----------------NOTE-----------NOTE---------------")

df = baseclass.readcsvfiles_2df(baseclass.newpair_from_dexscreener_path)
 

def makescreenurl( urlname,urlparam):
    _url = urlname + urlparam
    return '=HYPERLINK("{}","{}")'.format(_url, _url)



df["isNormal"] = -1
df['DexScreenURL'] = df.apply(lambda ser: makescreenurl(
     "https://dexscreener.com/solana/" ,ser["PairAddress"]), axis=1)

 

df['TokenIdx'] = df['TokenIdx'].astype(int)
df['Buys'] = df['Buys'].astype(int)
df['Sells'] = df['Sells'].astype(int)
df['Makers'] = df['Makers'].astype(int)
df = df.sort_values(by=["TokenIdx"], ascending=[True])
df.to_excel(baseclass.newpair_merge_path/"un_filter_pairs.xlsx", index=False)
print(f"{'{:<6}'.format('END')} {baseclass.scriptfilename} ----------------NOTE-----------NOTE---------------")

 