@@ -103,33 +103,37 @@ data class LocalFiat(
103103 // USD is a 1:1 fx so we can be blind here
104104 val fx = rate.fx * usdFx.toDouble()
105105
106- val sellAmount = Fiat .tokenBalance(quarks.toLong(), token = token)
106+ val sellAmountUsd = Fiat .tokenBalance(quarks.toLong(), token = token)
107107
108108 if (debug) {
109109 println (" ############## EXCHANGE REPORT ###################" )
110- println (" requested quarks: ${usdValue.quarks * 1_000_000 } " )
111- println (" balance quarks: ${balance?.quarks?.times(1_000_000 )} " )
112- println (" capped quarks: ${cappedValue.quarks * 1_000_000 } " )
113- println (" circulating supply: $circulatingSupply " )
114- println (" calculated quarks: $quarks " )
115- println (" units: $units " )
116- println (" fx: $fx " )
117- println (" sellAmount: ${sellAmount.formatted(formatting = Fiat .Formatting .Length (10 ))} " )
110+ println (" requested currency: ${rate.currency.name} " )
111+ println (" requested amount: ${amount.formatted()} " )
112+ println (" requested quarks (in USD): ${usdValue.quarks * 1_000_000 } " )
113+ println (" balance quarks (in USD): ${balance?.quarks?.times(1_000_000 )} " )
114+ println (" capped quarks (in USD): ${cappedValue.quarks * 1_000_000 } " )
115+ println (" circulating supply (of ${token.symbol} ): $circulatingSupply " )
116+ println (" calculated quarks: $quarks " )
117+ println (" units: $units " )
118+ println (" fx: $fx " )
119+ println (" sellAmount: ${sellAmountUsd.formatted(formatting = Fiat .Formatting .Length (token.decimals))} " )
118120 println (" ##################################################" )
119121 }
120122
121123 trace(
122124 tag = " LocalFiat" ,
123125 message = " Bill created" ,
124126 metadata = {
125- " requested quarks" to usdValue.quarks * 1_000_000
126- " balance quarks" to balance?.quarks?.times(1_000_000 )
127+ " requested currency" to rate.currency.name
128+ " requested amount" to amount.formatted()
129+ " requested quarks (in USD)" to usdValue.quarks * 1_000_000
130+ " balance quarks (in USD)" to balance?.quarks?.times(1_000_000 )
131+ " capped quarks (in USD)" to cappedValue.quarks * 1_000_000
132+ " circulating supply of ${token.symbol} " to circulatingSupply
127133 " calculated quarks" to quarks
128134 " units" to units
129135 " fx" to fx
130- " circulating supply" to circulatingSupply
131- " capped value" to cappedValue.quarks * 1_000_000
132- " sell amount" to sellAmount.formatted(formatting = Fiat .Formatting .Length (10 ))
136+ " sell amount (in USD)" to sellAmountUsd.formatted(formatting = Fiat .Formatting .Length (token.decimals))
133137 }
134138 )
135139
0 commit comments