ModulesMargin Calculations
Modules

Margin Calculations in Jules

How Jules calculates margins on recyclable commodity trading operations.

Margin Calculations in Jules

Product documentation — How Jules calculates margins on recyclable commodity trading operations.


Table of Contents

  1. Overview
  2. Container Margin
  3. Dashboard Margin
  4. Bulk Margin
  5. Display in the Interface
  6. Key Business Rules
  7. Glossary

Overview

Jules uses three margin systems depending on the commercial context:

SystemUsageGranularity
Container MarginExport operations using containersPer container
Dashboard MarginDetailed reporting (dashboards)Per buy/sell allocation
Bulk MarginBulk or warehouse operationsPer stockpile

Each system has its own formula, but all share the same objective: measuring the profitability of an operation by comparing the sale price to the total cost (purchase + logistics + fees).

General Calculation Flow

Margins are calculated automatically in real time as soon as a purchase price, a sale price, and a logistics cost are available. There is no manual calculation step.


Container Margin

When is it used?

For export operations where goods travel in containers. This is the most common margin type in Jules.

Formula

Margin (per tonne) = Sale price/tonne − Purchase price/tonne − Logistics cost/tonne

Two variants: estimated and final

Estimated MarginFinal Margin
WhenBefore deliveryAfter invoicing
Based onContractual pricesActually invoiced prices
ReliabilityApproximateDefinitive

The estimated margin allows profitability to be anticipated from the moment a contract is signed. The final margin reflects the actual result once all invoices have been received.

How margins are aggregated

When multiple containers are grouped together (for example, to view the margin of an entire operation), Jules uses a quantity-weighted average:

Aggregate margin = Sum(margin × quantity) / Sum(quantity)

This means a 25-tonne container carries more weight in the average than a 20-tonne container.

Grouping dimensions

Container margins can be viewed broken down by:

  1. Purchase operation
  2. Sale operation
  3. Purchased quality (material grade on the buy side)
  4. Sold quality (material grade on the sell side)
  5. Individual container

Requirements to calculate the margin

The margin can only be calculated if:

  • A purchase price and a sale price exist
  • The logistics cost is filled in (when required — see Key Business Rules)

Dashboard Margin

When is it used?

For advanced reporting in dashboards. It breaks down the margin into more than 12 cost items for a comprehensive view of profitability.

Formula

Margin = Sale price
       − Sell agent commission
       − Payment term fees
       − Buy agent commission
       − Inspection
       − Administrative fees
       − Logistics
       − Purchase price

Component breakdown

ComponentDescription
Purchase pricePurchase price of the commodity
Sale priceSale price of the commodity
LogisticMain transportation cost (sea freight, etc.)
Pre-carriageLocal transport cost before the port
CustomsCustoms fees
BL (Bill of Lading)Fees related to the bill of lading
InspectionQuality inspection cost
Buy agent commissionCommission of the agent on the buy side
Sell agent commissionCommission of the agent on the sell side
Goal adminAdministrative fees related to goals
Payment term feesFees related to payment terms (discount, etc.)
Other costsAll other uncategorized fees

Currency conversion

All components are converted to the sale currency before the margin is calculated. If the purchase is in USD and the sale is in EUR, the purchase price is converted to EUR at the applicable exchange rate.

Unit normalization

All prices are reduced to a per-tonne basis to ensure comparability, regardless of the original unit (kg, short tonne, etc.).


Bulk Margin

When is it used?

For bulk operations or operations linked to a warehouse, where the commodity is stored in stockpiles before being resold.

Formula

Margin = Net sale revenue − Material purchase cost − Loading cost

Key feature: the stockpile weighted average cost

Unlike container margins, the purchase price is not that of a specific contract. It is the weighted average cost of the stockpile — the average of all purchases that fed that stockpile, weighted by their respective quantities.

Example: A stockpile receives 100T at 200 USD/T then 50T at 250 USD/T. The weighted average cost = (100×200 + 50×250) / 150 = 216.67 USD/T.

This approach reflects the actual blended cost of goods in stock, rather than tying margin to a specific purchase lot.


Display in the Interface

Where to see margins?

Margins appear in several places in Jules:

LocationDescription
Purchase table — "Margin" columnEstimated and final margin per purchase line
Sale table — "Margin" columnEstimated and final margin per sale line
Margin popover (click on a margin value)Detail: sale price, purchase price, logistics cost, other costs
Container modalContainer margin in the delivery modal

Color coding

ColorMeaning
GreenPositive margin (the operation is profitable)
Orange / RedNegative margin (the operation is losing money)

Detail shown in the popover

When clicking on a margin value, a popover displays:

  1. Sale price per tonne
  2. Purchase price per tonne
  3. Logistics cost per tonne
  4. Other costs per tonne
  5. Final margin = result of the calculation

Key Business Rules

1. When is logistics cost required?

The logistics cost is only required in one specific case:

Logistics required if:
  Sale Incoterm ≠ EXW  AND  Purchase Incoterm = EXW

In plain terms: If your organization purchases material "ex works" (collecting from the supplier's facility) but sells at a delivered price (covering freight), then the transport cost is a real cost that must be included in the margin calculation.

If both incoterms are EXW, or if the purchase incoterm already includes transport (FOB, CFR, CIF), logistics is not required.

2. Margin structure

Each margin value in Jules has three components: an amount, a currency, and a unit of measure (typically tonnes). This ensures margins are always unambiguous — for example, 150 USD/T rather than just "150".

3. Organization isolation

Each organization has its own isolated data. The margins of one organization are never visible to or mixed with those of another.


Glossary

TermDefinition
AllocationLink between a purchase operation and a sale operation
BL (Bill of Lading)Maritime transport document
BulkLoose commodity (not containerized)
EXW (Ex Works)Incoterm where the buyer assumes all transport costs from the seller's location
CFR / CIF / FOBIncoterms that include all or part of sea transport
Estimated marginMargin calculated on contractual prices (before delivery)
Final marginMargin calculated on invoiced prices (after delivery)
IncotermInternational commercial term defining who pays for transport and insurance
StockpileA pile of commodity in a warehouse
TonneBase unit for price normalization in Jules
Weighted average costThe blended cost of all material in a stockpile, weighted by quantity