Base PNL

Base PNL

Check how much money a wallet has put into a project

Created on 1st July 2024

Base PNL

Base PNL

Check how much money a wallet has put into a project

The problem Base PNL solves

Base OnChain Hackathon!

Welcome to our project called Spending Tracker ;)

Problem & Solution

Do you ever wonder the amount of money you've put into a project? There are times I get lost on the amount of money I've contributed to a project (lol). But now with our website, a user is able to check any base wallet with the specific base token address and see the amount the user has spent (basically a spending tracker).

TLDR: We convert the USD a wallet has either deposited or withdrawn from a token. For example Crash (youtuber) who turned $15,000 into 11 million on Brett token -- using our website, you can see that he actually did deposit $15,000! ($14,920 to be exact :P)

How to use

Load up the website and enter the base address that you want to check. Then enter the base token address that you want to see the amount deposited and withdrawn. Then click "Check Spending" and it will load up the data. (Green text means the money you've deposited, Red text means you've withdrawn more than you deposited (hurray!))

Future

We hope to continue to work on this project and improve features such as making it more accessible, ex: to show all deposits and withdraw in a wallet automatically!

Challenges I ran into

Challenges

We ran into a few challenges during the creation of this project

A major one was figuring out the price conversion for each transaction

We realized that Base's "Show ERC-20 transactions" API did not show the value of ETH of a transaction but instead the value of the token. The conversion given to us was the amount of tokens that was either bought or sold, for example, 20,000 Brett as the value instead of 1 ETH. Luckily though after more tests with Base's API, trying to come up a solution, we realized that there was a "normal transaction list" API that did show the ETH value. If you look at our code, you can see we used both these lists and configured an algorithm that resulted in getting the ETH value of a transaction, which was later converted to USD for UI/UX purposes.

There were also some minor hurdles during the conversion to USD. For example, now that we had the ETH value of a tranasction, how do we figure out how much the ETH was worth during time of transaction? After more googling and reddit searches, we were able to find a third party that offered to show the price of blockchains with a given timestamp. We used this to our advantage and from there was able to convert the ETH to USD, and then found the difference between the buys and sells.

Learning

This project helped us learn a lot related to project development and blockchain forensics. For example we both got to learn the process of creating a project and also how basescan works on a deeper level. After spending a bit of time of analyzing transactions from both the API and basescan, I can say a few things were able to click and it's definitely improved my forensic skills.

Tracks Applied (3)

Coinbase Smart Wallet

We hope to integrate our project with the Coinbase Smart Wallet, we believe many users (including myself) would be happy...Read More

OnchainKit

We hope to use the OnChainKit to switch our project to React, therefore the development, especially with more tools and ...Read More

Unplugged Track

This project hopes to track the spending habits of users which can either help them realize they've put in too much mone...Read More

UNPLUGGED with Nouns

Cheer Project

Cheering for a project means supporting a project you like with as little as 0.0025 ETH. Right now, you can Cheer using ETH on Arbitrum, Optimism and Base.

Discussion

Builders also viewed

See more projects on Devfolio