@@ -2869,50 +2869,33 @@ async fn process_account_csv(
2869
2869
} )
2870
2870
}
2871
2871
wtr. write_record ( [
2872
- "Token" ,
2872
+ "Transaction Type" ,
2873
+ "Asset Name" ,
2873
2874
"Amount" ,
2874
- "Income (USD)" ,
2875
- "Cap Gain (USD)" ,
2876
- "Acq. Date" ,
2877
- "Acq. Cost (USD)" ,
2878
- "Sale Date" ,
2879
- "Sale Proceedings (USD)" ,
2880
- "Acquisition Description" ,
2881
- "Sale Description" ,
2875
+ "Date Acquired" ,
2876
+ "Cost basis (USD)" ,
2877
+ "Date of Disposition" ,
2878
+ "Proceeds (USD)" ,
2882
2879
] ) ?;
2883
2880
2884
2881
for disposed_lot in disposed_lots {
2885
- let mut income = disposed_lot. lot . income ( disposed_lot. token ) ;
2886
- if let Some ( year) = filter_by_year {
2887
- if disposed_lot. lot . acquisition . when . year ( ) != year {
2888
- income = 0. // Exclude income from other years
2889
- }
2890
- }
2891
2882
let cost = Decimal :: from_u64 ( disposed_lot. lot . amount ) . unwrap ( )
2892
2883
* disposed_lot. lot . acquisition . price ( )
2893
2884
/ Decimal :: from_f64 ( 1e9 ) . unwrap ( ) ;
2894
2885
let proceedings = Decimal :: from_u64 ( disposed_lot. lot . amount ) . unwrap ( )
2895
2886
* disposed_lot. price ( )
2896
2887
/ Decimal :: from_f64 ( 1e9 ) . unwrap ( ) ;
2897
2888
wtr. write_record ( & [
2889
+ format ! ( "Sell" ) ,
2898
2890
disposed_lot. token . to_string ( ) ,
2899
2891
format ! (
2900
2892
"{:.9}" ,
2901
2893
disposed_lot. token. ui_amount( disposed_lot. lot. amount)
2902
2894
) ,
2903
- format ! ( "{:.9}" , income) ,
2904
- format ! (
2905
- "{:.9}" ,
2906
- disposed_lot
2907
- . lot
2908
- . cap_gain( disposed_lot. token, disposed_lot. price( ) )
2909
- ) ,
2910
2895
disposed_lot. lot . acquisition . when . to_string ( ) ,
2911
2896
format ! ( "{:.9}" , cost) ,
2912
2897
disposed_lot. when . to_string ( ) ,
2913
2898
format ! ( "{:.9}" , proceedings) ,
2914
- disposed_lot. lot . acquisition . kind . to_string ( ) ,
2915
- disposed_lot. kind . to_string ( ) ,
2916
2899
] ) ?;
2917
2900
}
2918
2901
0 commit comments