Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions api/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,21 +114,29 @@ def getOorU(walletAddress):

#This is an EtherScan API PRO Call, we need to replace with something else, currently using Current Price as Placeholder
#ethPriceAtTimeOfFirstMintResponse = getHistoricalEthPrice(startDate=earliestNFTInWalletTimeStamp.date(), currentDate=currentDate)
earliestDateString = str(earliestNFTInWalletTimeStamp.date().strftime("%d-%m-%Y"))
try:
earliestDateString = str(earliestNFTInWalletTimeStamp.date().strftime("%d-%m-%Y"))
except:
print("An exception occurred while trying to get earliestNFTInWalletTimeStamp")

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can also print the value of the earliestNFTInWalletTimeStamp variable. It can look like this I think

print(f'An exception occurred while trying to get earliestNFTInWalletTimeStamp, got {earliestNFTInWalletTimeStamp}')

ethPriceAtTimeOfFirstMintResponse = getHistoricalEthPrice(dateString = earliestDateString)
ethPriceAtTimeOfFirstMint = float(ethPriceAtTimeOfFirstMintResponse)
#float(ethPriceAtTimeOfFirstMintResponse['result']['ethusd'])

currentEthPriceResponse = getCurrentEthPrice()
currentEthPrice = float(currentEthPriceResponse['result']['ethusd'])

try:
currentEthPriceResponse = getCurrentEthPrice()
currentEthPrice = float(currentEthPriceResponse['result']['ethusd'])
except:
print("An exception occurred while trying to get the currrent eth price")

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same with the previous comment

historicalEthRate = currentEthPrice - ethPriceAtTimeOfFirstMint / ethPriceAtTimeOfFirstMint
if performanceRate < historicalEthRate:
performanceClassification = "Underperformed"
value = "U"
else:
elif performanceRate > historicalEthRate:
performanceClassification = "Overperformed"
value = "O"
value = "O"
else:
print("Was not able to generate O/U ")



userMessage = \
f"We analyzed all ERC721 transacations for this wallet and found the seven day average price of your NFT's - the purchase price / the sum of the seven " \
Expand Down