# docker-finance | modern accounting for the power-user
#
# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

fields currency_from,currency_to,status_,date,currency_from_amount,fee,rate,destination,currency_to_amount,subaccount
date-format %Y-%m-%d %H:%M:%S
description %date +0000

account1 equity:changelly:%subaccount:withdrawal:%currency_from
amount -%currency_from_amount %currency_from
account2 assets:changelly:%subaccount:%currency_from
account3 assets:changelly:%subaccount:%currency_from
amount3 -%currency_from_amount %currency_from @@ %currency_to_amount %currency_to
account4 equity:changelly:%subaccount:deposit:%currency_to
amount4 %currency_to_amount %currency_to

# NOTE:
#
#   - %fee is not added to cost-basis here because %currency_to_amount includes
#     the fee (it adjusts the proceeds and computes into %currency_to_amount).
#
#   - %fee is considered a facilitation fee for the trade; so *don't* add to
#     column (see above).
#
#   - %currency_from_amount is fully disposed (as the adjustment happens to
#     %currency_to_amount).
#
#   - For details, see #51.
#
comment rate:%rate, destination:%destination, taxed_as:SELL
comment2 %date +0000,SELL,changelly:%subaccount,%currency_from,%currency_from_amount,%currency_to,%currency_to_amount,,

# vim: sw=2 sts=2 si ai et
