-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add accounting rules for new wrapped event subtypes #161
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,23 +18,131 @@ | |
"count_cost_basis_pnl": false, | ||
"accounting_treatment": null | ||
}, | ||
{ | ||
"event_type": "spend", | ||
"event_subtype": "clawback", | ||
"counterparty": null, | ||
"taxable": true, | ||
"count_entire_amount_spend": true, | ||
"count_cost_basis_pnl": true, | ||
"accounting_treatment": null | ||
}, | ||
{ | ||
"event_type": "deposit", | ||
"event_subtype": "deposit asset", | ||
"counterparty": "aave-v2", | ||
"event_subtype": "deposit for wrapped", | ||
"counterparty": null, | ||
"taxable": false, | ||
"count_entire_amount_spend": false, | ||
"count_cost_basis_pnl": true, | ||
"accounting_treatment": null | ||
}, | ||
{ | ||
"event_type": "spend", | ||
"event_subtype": "clawback", | ||
"event_type": "withdrawal", | ||
"event_subtype": "redeem wrapped", | ||
"counterparty": null, | ||
"taxable": true, | ||
"count_entire_amount_spend": true, | ||
"taxable": false, | ||
"count_entire_amount_spend": false, | ||
"count_cost_basis_pnl": true, | ||
"accounting_treatment": null | ||
}, | ||
{ | ||
"event_type": "staking", | ||
"event_subtype": "deposit for wrapped", | ||
"counterparty": null, | ||
"taxable": false, | ||
"count_entire_amount_spend": false, | ||
"count_cost_basis_pnl": false, | ||
"accounting_treatment": null | ||
}, | ||
{ | ||
"event_type": "staking", | ||
"event_subtype": "redeem wrapped", | ||
"counterparty": null, | ||
"taxable": false, | ||
"count_entire_amount_spend": false, | ||
"count_cost_basis_pnl": false, | ||
"accounting_treatment": null | ||
}, | ||
{ | ||
"event_type": "deposit", | ||
"event_subtype": "deposit for wrapped", | ||
"counterparty": "aave-v1", | ||
"taxable": false, | ||
"count_entire_amount_spend": false, | ||
"count_cost_basis_pnl": true, | ||
"accounting_treatment": "SWAP" | ||
}, | ||
{ | ||
"event_type": "deposit", | ||
"event_subtype": "deposit for wrapped", | ||
"counterparty": "aave-v3", | ||
"taxable": false, | ||
"count_entire_amount_spend": false, | ||
"count_cost_basis_pnl": true, | ||
"accounting_treatment": "SWAP" | ||
}, | ||
{ | ||
"event_type": "deposit", | ||
"event_subtype": "deposit for wrapped", | ||
"counterparty": "compound", | ||
"taxable": false, | ||
"count_entire_amount_spend": false, | ||
"count_cost_basis_pnl": true, | ||
"accounting_treatment": "SWAP" | ||
}, | ||
{ | ||
"event_type": "deposit", | ||
"event_subtype": "deposit for wrapped", | ||
"counterparty": "compound-v3", | ||
"taxable": false, | ||
"count_entire_amount_spend": false, | ||
"count_cost_basis_pnl": true, | ||
"accounting_treatment": "SWAP" | ||
}, | ||
{ | ||
"event_type": "deposit", | ||
"event_subtype": "deposit for wrapped", | ||
"counterparty": "Locked GNO", | ||
"taxable": false, | ||
"count_entire_amount_spend": false, | ||
"count_cost_basis_pnl": true, | ||
"accounting_treatment": "SWAP" | ||
Comment on lines
+103
to
+109
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. seems that we have a rule also for remove asset... since you get a wrapped I guess you also need the redeem wrapped There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But the existing rule for Locked GNO There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, then we need to remove it if it is identical to the general rule |
||
}, | ||
{ | ||
"event_type": "deposit", | ||
"event_subtype": "deposit for wrapped", | ||
"counterparty": "yearn-v1", | ||
"taxable": false, | ||
"count_entire_amount_spend": false, | ||
"count_cost_basis_pnl": true, | ||
"accounting_treatment": "SWAP" | ||
}, | ||
{ | ||
"event_type": "deposit", | ||
"event_subtype": "deposit for wrapped", | ||
"counterparty": "yearn-v2", | ||
"taxable": false, | ||
"count_entire_amount_spend": false, | ||
"count_cost_basis_pnl": false, | ||
"accounting_treatment": "SWAP" | ||
}, | ||
{ | ||
"event_type": "withdrawal", | ||
"event_subtype": "redeem wrapped", | ||
"counterparty": "yearn-v1", | ||
"taxable": false, | ||
"count_entire_amount_spend": false, | ||
"count_cost_basis_pnl": false, | ||
"accounting_treatment": "SWAP" | ||
}, | ||
{ | ||
"event_type": "withdrawal", | ||
"event_subtype": "redeem wrapped", | ||
"counterparty": "yearn-v2", | ||
"taxable": false, | ||
"count_entire_amount_spend": false, | ||
"count_cost_basis_pnl": false, | ||
"accounting_treatment": "SWAP" | ||
yabirgb marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aave v2 is missing here too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've skipped aave-v2 on purpose here. If you notice the aave-v2 deposit rule is being modified here: 73c7160 to not be treated as a SWAP, since aave v2 has its own accountant logic.
This actually makes it identical to the general (null counterparty)
deposit/deposit for wrapped
rule - so we shouldn't need any special rule for aave-v2.Now I'm also realizing that the "edit" to the
deposit asset
rule for aave-v2 added in the PR I linked is no longer actually needed since its nowdeposit for wrapped
and will be handled correctly by the generaldeposit for wrapped
rule as explained above, so I'm removing that.