What a day. Last night I watched Free Guy with Elder, and showed her a bit of Ready Player One before I made her go to bed. I stayed up a bit too late. This morning I got up fairly early and finished up some things I was working on last night. I had been reconfiguring the exchange’s API/indexer. It runs behind Nginx’s Unit, and I wanted to have a process running on a test branch while I made sure the new configuration things were working like they were supposed to. I finished that up this morning in time to do my Sunday 9AM Perpetual accounting.
This week was pretty flat. BTC was negative, and I only made $150 on the ETH side. I rolled that into a 10x position. I usually don’t mind not making money on the funding rate if the price is going up. BTC was up 13% on the week, ETH was down less than five dollars.
I’m probably over optimizing already, but I’m guessing that I’ll need to log the transactions somewhere to keep from blowing up my RPC calls. The market I’m looking at has just over two thousand transactions, but basically I’d want to grab them, a thousand at a time, and start from the market init call, and then walk through all the order placement stuff. I just hope I don’t have to simulate the internal state of the orderbook. It would be a pain, but I have the Rust code for the market itself if I need to. My fear is that I’ll have to keep track of the orderbook myself and figure out when they’ve been matched, but I’m still too far from even knowing how to do that.
Still, if I can make something work, I might be able to sell this thing to Step.Finance or someone like that. It would probably be a lot easier to look for transactions for a single wallet and compute the cost basis just by looking at the token accounts associated with that pubkey. It’s probably actually a much easier problem to solve. Much smaller set of transactions that one would have to look at, hopefully. Now that I know how to get all the transactions associated with an addresses, we can parse those for the Serum ones, and figure out what went in and what came out.
So I’ve got another hour before bed. Tomorrow I have an update for SAIAdao, and Missus has a work holiday.