Hi all, I’ve pushed a few updates to the project github and thought I’d accompany that with a progress report here.
The introduction of cTokens in V2 marked a significant shift in how interest is managed in Compound, so I’ve found it easiest to analyze early user interactions with V1 and V2 separately with intent to merge the results at the end.
For each version of the protocol, I’ve separated the process into four steps:
(1) Pull all early-user transactions on-chain with relevant Compound contracts within the early-user window, whether EOA or contract-mediated
(2) Determine the end user associated with proxy contracts so that the underlying user is credited, while ensuring credit for smart contract wallets remains with the contract which represents the user
(3) Calculate each early user’s cumulative supply and borrow interest in each asset from raw transaction data
(4) Use price history data to translate cumulative supply and borrow interest into a single USD- (or ETH-)equivalent interest.
I believe it may eventually prove easier to perform steps (3) and (4) in tandem, but I’m separating them for now to make it easier to check the accuracy of each step independently.
The final cumulative interest serves as a “capital weight” for each user, replacing the cruder metric described in my earlier proposal for defining a capital-weighted component of an early-user COMP distribution.
Steps (1) and (2) are currently in good shape, other than some clean-up and provision of a more automated workflow for others to reproduce the csv files.
Steps (3) and (4) are on their way but still in-progress.
- For step (3) in V1,
CompoundV1.interest.pyis a working implementation for V1 that passes my sanity checks and is available for public review. I’d be especially grateful for any feedback from devs familiar with the interest calculation for V1 to let me know of any potential edge cases I might have missed. I’m aware of one minor edge case involving liquidators that I have a solution in the works for.
- For step (3) in V2, I’m troubleshooting an issue with
CompoundV2.interest.pythat appears to be contract-related, but a basic approach to computing V2 acculumated interest is implemented there and available for review as well.
- For step (4) in V1,
CompoundV1.USDvalue.pyoffers a proof-of-concept for appending USD price data to the raw transaction histories using the CoinGecko API for historical market data. If anyone has concerns with using daily CoinGecko price history data instead of using the on-chain Compound open price feed, please speak up! So far I am going with this approach because it is easier and more intuitive for me to implement while having negligible impact on accuracy, but I am willing to take the time to figure out how to do it with on-chain data if that’s what folks need to see in order to support an eventual proposal.
I’ll report back on steps (3) and (4) as they come closer to fruition. In the meantime, I think it could be constructive to have some parallel effort on crafting a clear, organized, and concise rationale for governance to support an early user distribution. Anyone want to start collecting the relevant input from this thread and merging it into a collaboratively editable document?