rotki is an opensource portfolio tracking and accounting tool that thanks to in large part an optimism grant supports Optimism chain completely. Among other things it detects all optimims token balances for all user addresses, pulls all transactions and decodes them into human readable format and then can create an accounting report with PnL for all addresses in a given time period. What’s more all this is done in a local application without storing your data in external server where they can be hacked/leaked or sold to the highest bidder.