How to account for DAI loans in Compound or Maker

I have used services like and instadapp. In both cases some of the trades are in a smart wallet, in some cases in the account and I have imported positions from account to smart wallet account. On top of that I have used the flash loan possibilities to switch between protocols or to leverage a position.

Now - when it comes to tax this is a nightmare. One transaction can be 20 transactions and Koinly does not understand what is what and some transactions are imported, others not.

  1. How should a Maker CDP position be accounted for in Koinly? Do i use send to pool for the ETH only? How do I handle the DAI loan? I seem to end up with a position without debt if I send the ETH to pool and juste leave the DAI transactions as is. The value of the position get totally wrong also since there is no debt.

  2. How do I account for a flash loan leverage transaction (like Boost in Koinly records a number of transactions - usually not all in the transaction. Should I delete all transactions (could be 5-10 of them) in Koinly and just enter “the proper” transaction? Usually what happens is you borrow DAI, convert that into ETH and add ETH to the CDP. Koinly usually miss this and records ETH that just appear from somewhere. Should I send that ETH to pool or tag it receive from pool or what is correct? The effect is the CDP grows in ETH and in DAI debt.

  3. How do I handle loans in AAVE and Compound? Should they be tagged “received from pool” or not?

I also sometimes get an error “no purchase recorded for DAI”. How can I avoid that? It occurs because I sell DIE that I have borrowed and never purchased.



Wonder those questions too. Would like to hear about a projected time estimation for the support of it.

My idea was to create a new wallet “CDP Smart Wallet” manually and do everything in there by hand to prevent mixing of the automatic things. Not sure how to proceed, because if they implement it, i need to seperate the double entries and delete them. Or it recognized the nearly perfect same time / same amount transactions.

Really hope they come and answer this soon, would gladly pay more money for a higher tier with access to DeFi tracking solutions.

+1 on the hope that someone from Koinly chimes in soon. Consider the following simple scenario:

  • ETH is trading at $500/ETH.

  • I deposit $1,000 USD at an exchange, and buy 1,000 DAI (basis in the DAI: $1,000). I transfer the 1,000 DAI to my hardware wallet and lend it out on Compound. No tax impact.

  • I borrow 1 ETH from Compound against my DAI collateral. The Koinly system shows this as a “Deposit” to my wallet, though I think this is more of a “withdrawal” in a sense since I’m borrowing against my own collateral – perhaps this is the source of my confusion? Regardless, using Koinly as it functions now, this creates a position of 1 ETH with a cost basis of $500. While my basis in ETH changes, this isn’t a taxable event.

  • I swap the borrowed ETH for 500 DAI. For tax purposes, this is effectively a sale of my 1 ETH for $500 (given basis was $500, no tax impact), and then a purchase of 500 DAI for $500, which would increase my DAI position.

  • My understanding is that at this point, the way Koinly operates, my tax position is 1,500 DAI with a cost basis of $1,500, and 0 ETH.

  • ETH market price moves to $750/ETH and I decide to close out my short position.

  • I swap 750 of my 1,500 DAI for 1 ETH. For tax purposes, this is a sale of 750 DAI for $750 (no tax impact given basis remains $1/DAI), followed by a purchase of 1 ETH for $750.

  • At this point, for tax purposes, I have 750 DAI with a basis of $750, and 1 ETH with a basis of $750.

  • I repay the 1 ETH loan with my 1 ETH. This shows as a “withdrawal” in Koinly. $0 in tax liability because my basis in the 1 ETH matches current market price ($750).

  • I now only have 750 DAI, with a basis of $750.

  • I withdraw the remaining 750 DAI back to an exchange (we’ll pretend Compound didn’t pay interest for simplicity), sell it for USD, and withdraw to my bank account.

So, in essence, even though I put in $1,000, I only end up with $750. Yet, I don’t capture the $250 loss anywhere for tax purposes, as far as I can tell. My expectation here is that we would capture the overall loss from the trade as a whole, but perhaps there’s something that I’m not understanding.

I also have a Maker leverage position I will need to look at soon. Plus interest payments from the Maker DSR. Some of the scenarios described here are enough to make any accountant (and HMRC) break out into a cold sweat. I suppose we need things either to “just work” for such complex cases, or have very good control over setting these scenarios up manually, at least with a close approximation as a best endeavour. This needs good documentation and clarity on what Koinly can and can not do currently. The silly thing is for me, the tax tail is starting to wag the crypto dog; i.e. I am reluctant to do any crypto activities that I can’t then report properly. Would be nice to hear from Koinly, we all need to work through these things together.


This is still what I primarily have problems with. I simply don’t know how to handle these kind of loans or if Koinly is even capable of handling it.

This is a significant issue for me too, and my main reservation against purchasing a tax plan through Koinly, even after spending many hours sunk into fixing up imported transactions and doing all I can to give Koinly the best chance of getting it right.

Dai and other debts, whether they’re in the form of new Dai minted on Maker from a CDP, loans from Compound/AAVE or a result of margin trades on exchanges all show the “No purchase recorded” error and mess up the cost basis calculation for everything that follows.

Any news about this issue? it will be nice to know if koinly have any plans to introduce it some time this year

In case you haven’t found it yet. This article provides guidance.