Skip to content

Commit

Permalink
docs: add code comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rackstar committed Nov 21, 2024
1 parent cd43327 commit 92c29d4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib/capacityEngine.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ function calculateProductDataForTranche(productPools, firstUsableTrancheIndex, u
}
aggregatedData.totalPremium = aggregatedData.totalPremium.add(poolPremium);

// The available capacity of a product for a particular pool
const availableCapacityInAssets = Object.keys(assets).map(assetId => ({
assetId: Number(assetId),
amount: availableInNXM.mul(assetRates[assetId]).div(WeiPerEther),
Expand Down Expand Up @@ -264,6 +265,7 @@ function capacityEngine(store, { poolId = null, productIds = [], period = 30, wi
}

const { capacityAvailableNXM, capacityUsedNXM, minPrice } = aggregatedData;
// The available capacity of a product across all pools
const capacityInAssets = Object.keys(assets).map(assetId => ({
assetId: Number(assetId),
amount: capacityAvailableNXM.mul(assetRates[assetId]).div(WeiPerEther),
Expand Down

0 comments on commit 92c29d4

Please sign in to comment.