open-source-coinbase-index-fund
open-source-coinbase-index-fund copied to clipboard
Add option to use different types of orders to avoid trading fees
What
Since the whole point of this repository is to create an open and lower cost version of Coinbase's Index Fund, there should be a way to better trading fees that take place whenever an account is rebalanced.
Base on Coinbase Pro's Fee Structure, taker fees are 0.30%. Trades are considered takers based on whether or not the trade matches an existing order immediately.
In order to avoid this fee, you have to place maker trades (orders that aren't immediately matched but are later by another trade). Without having tested this, I would guess that you could be somewhat clever in your trades and place them just outside of the market order amount to avoid the associated fees. It is possible that Coinbase has mechanisms to prevent this or that other traders have a similar idea and therefore is not possible or rare to pull off. But worth investigating.
How
The feature should work as follows:
You should be able to set an environment variable and/or pass a variable to the background job update_index
that indicates whether or not you would like to minimize fees. If it is set to true, then instead of placing market orders, the trade would place a limit order.
Depending on which side the order is on (sell vs buy) the limit order might take into account the current market ask price of a currency and place a limit order just above or below this price for the currency.
Considerations
It is possible that an order placed like this is never filled or takes awhile to fill. Because of this, it will be necessary to figure out how to deal with rebalancing the full portfolio when there are a lot of pending or non-executed orders. This probably will have to then tie in with the feature of pinging a Coinbase Pro account to get the latest information on all orders placed via this app.
Resources
This issue is marked as closed, so is this feature now in the project? I'm looking for exactly this. How do I enable it if so?
@devbanana this was mistakenly closed as I was going to move away from issues but I will open all the unfinished issues again. Sorry for the confusion, but this feature has not been completed yet.