Skip to content

Commit

Permalink
part 6
Browse files Browse the repository at this point in the history
  • Loading branch information
JuaniRios committed Apr 29, 2024
1 parent ee47043 commit 8793dd5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pallets/funding/src/instantiator/calculations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,11 @@ impl<
for (bid, price) in self.get_actual_price_charged_for_bucketed_bids(bids, project_metadata, maybe_bucket) {
let funding_asset_id = bid.asset.to_assethub_id();
let funding_asset_decimals = self.execute(|| T::FundingCurrency::decimals(funding_asset_id));
let funding_asset_usd_price =
let funding_asset_usd_price = self.execute(|| {
T::PriceProvider::get_decimals_aware_price(funding_asset_id, USD_DECIMALS, funding_asset_decimals)
.ok_or(Error::<T>::PriceNotFound)
.unwrap();
.unwrap()
});
let usd_ticket_size = price.saturating_mul_int(bid.amount);
let funding_asset_spent = funding_asset_usd_price.reciprocal().unwrap().saturating_mul_int(usd_ticket_size);
output.push(UserToForeignAssets::<T>::new(
Expand Down

0 comments on commit 8793dd5

Please sign in to comment.