Getting ideas

I spent some time coding Friday night, trying to update my trade plan script. It’s been a long time since I used it, and it doesn’t work anymore since it relied on the CoinmarketCap API to do lookups. So I’m starting from scratch.

Using the CCXT Python module to get my estimated balances off the exchanges is a bit more difficult than I had imagined. I can get the balances themselves, and then have to do some conversions using the last trade price in BTC. That’s a far as I got earlier. The next step is to do map limit orders against the positions to determine capital at risk, then I can start working on the trade plans themselves. I want the module to refuse to purchase if more than six percent of funds are at risk.

I’ve also decided to start moving funds from BlockFi over to Yearn’s sBTC vault. I did a test transaction last week, and I think it’s trustworthy enough to start moving things over. I still want to take a look at the contract code and see if I can make any sense of it, and there’s one other thing I need to figure out first.

I’ve allocated funds to my kids, and are holding some funds for my family members. I want to pool all these funds together, since moving funds in and out of the vaults takes a good amount of gas, and I want to minimize this as much as possible. Basically I’ll be farming USDC and BTC via the yCRV and sBTC vauts on yEarn, respectively, I just need to figure out how to track the amounts of assets from each individual.

I haven’t thought too much about this yet, but my preliminary idea is that I can use some sort of token to track contributions. Tokens will be minted or burned depending on how much someone contributes to the pool. But how to send those pooled funds to where they need to go?

I’m assuming that the yEarn vaults themselves use some sort of strategy contract to control what happens each time someone contributes. But in this case, I want to be able to control the funds myself. It seems, though, that funds would come in, I deploy them, and voila! But no. It’s going to be more complicated than that.

If I’m managing funds for four or five individuals, I’ll still have to manage wallets for each of them. I don’t think that this can be done with a simple spreadsheet, it’ll have to be tracked in a database of some type. Maybe I could build my own local contract to track it. We’ll see.

I’ll be looking over the Zapper and yEarn docs to see how I can interact with their contracts directly. I don’t necessarily want my contract to be on mainnet right now cause of gas transactions, this is why off-chain and side-chain projects were created in the first place, yes? Maybe I’m overthinking this.

I would need pools for each type of asset, so it could be a one-for-one token exchange. Tracking the value of the vault is where I’m stuck. I’m not sure how Zapper does it, so I have some more research to do.

While I think about all this, I’m also busy getting my Haven node spun back up. The vault is implemented, so it looks like I can move out of XHV into USD without involving an exchange. This will allow me some bit of trade leverage without having to deal with Bittrex for now. It just looks like it’s going to take a week for my node to sync up.

Leave a Reply

Your email address will not be published. Required fields are marked *