Skip to content
Open
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
3c93085
feat(explorer): show network costs and protocol fee breakdown on orde…
jmg-duarte May 28, 2026
968afa0
fix: address Rabbit comments
jmg-duarte May 29, 2026
87eacf4
fix: address comments from alfetopito
jmg-duarte Jun 1, 2026
a2b55a4
fix: leverage new SDK version
jmg-duarte Jun 2, 2026
cf225b2
fix: ci + coderabbit review
jmg-duarte Jun 2, 2026
17d09b4
fix: remove dead code
jmg-duarte Jun 3, 2026
1c3b343
fix(explorer): derive protocol fee breakdown from all trades, not the…
jmg-duarte Jun 3, 2026
6c9cc91
feat(explorer): label volume fees with bps and tidy fee breakdown
jmg-duarte Jun 3, 2026
c3384e4
fix: address reviews
jmg-duarte Jun 16, 2026
b2c3baa
feat(explorer): show network costs in order costs & fees breakdown
jmg-duarte Jun 19, 2026
fe6c40b
fix: ci
jmg-duarte Jul 24, 2026
2c59378
fix(explorer): show a single native-token total for costs & fees
jmg-duarte Jul 24, 2026
96d9cc7
fix: minimize diff
jmg-duarte Jul 24, 2026
9f8a00f
fix: cleanups
jmg-duarte Jul 24, 2026
84321c5
fix: cleanups
jmg-duarte Jul 24, 2026
165525d
Merge branch 'develop' into jmgd/ucp
elena-zh Jul 27, 2026
63210b6
Merge branch 'develop' into jmgd/ucp
elena-zh Jul 27, 2026
ac68ee8
Merge branch 'develop' into jmgd/ucp
jmg-duarte Aug 2, 2026
1404aea
chore: update bundle sizes [automatic]
cowswap-release-sync[bot] Aug 2, 2026
c27ff42
fix(explorer): correct the costs and fees breakdown
jmg-duarte Aug 3, 2026
784f8b7
chore: update bundle sizes [automatic]
cowswap-release-sync[bot] Aug 3, 2026
a48ec1e
chore: update bundle sizes [automatic]
cowswap-release-sync[bot] Aug 3, 2026
d9faf3c
feat(explorer): gate the costs and fees breakdown behind a feature flag
jmg-duarte Aug 3, 2026
0b6945d
refactor(explorer): trim comments on the costs and fees breakdown
jmg-duarte Aug 3, 2026
cf67059
chore: update bundle sizes [automatic]
cowswap-release-sync[bot] Aug 3, 2026
c5d312c
Merge branch 'develop' into jmgd/ucp
jmg-duarte Aug 11, 2026
8213e66
chore: update bundle sizes [automatic]
cowswap-release-sync[bot] Aug 11, 2026
46beec6
fix: minimization
jmg-duarte Aug 11, 2026
7602ad3
Merge remote-tracking branch 'origin/jmgd/ucp' into jmgd/ucp
jmg-duarte Aug 11, 2026
b714e15
fix(explorer): address costs & fees review feedback
jmg-duarte Aug 11, 2026
dbec925
Merge branch 'develop' into jmgd/ucp
jmg-duarte Aug 11, 2026
e9f4548
Merge branch 'develop' into jmgd/ucp
elena-zh Aug 11, 2026
62c72d9
Merge branch 'main' into jmgd/ucp
jmg-duarte Aug 13, 2026
c20407d
refactor(explorer): extract the costs and fees breakdown logic
jmg-duarte Aug 13, 2026
02d4a01
refactor(explorer): fetch an order's trades once
jmg-duarte Aug 13, 2026
99546b2
fix: address comments
jmg-duarte Aug 14, 2026
d61064b
Merge branch 'develop' into jmgd/ucp
jmg-duarte Aug 14, 2026
4c5d987
chore(i18n): extract i18n strings [automatic]
cowswap-release-sync[bot] Aug 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions apps/explorer/src/api/operator/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
AddressKey,
CompetitionOrderStatus,
EnrichedOrder,
OrderKind,
Expand Down Expand Up @@ -101,6 +102,10 @@ export type Order = Pick<
executedFeeAmount: BigNumber
executedFee: BigNumber | null
totalFee: BigNumber
// Derived client-side from the trades. Undefined when unknown; `[]` means no fee was charged.
protocolFees?: ProtocolFee[]
// Native-token wei, from the orderbook. Undefined if unsettled, or settled before it was recorded.
gasCost?: BigNumber
cancelled: boolean
status: OrderStatus
partiallyFilled: boolean
Expand All @@ -114,8 +119,17 @@ export type Order = Pick<

export type OrderCompetitionStatus = CompetitionOrderStatus

// Raw API response
export type RawOrder = EnrichedOrder
/** One fee policy's total across all of an order's fills. */
export type ProtocolFee = {
amount: BigNumber
tokenAddress: AddressKey
type: ProtocolFeeType
// Index in a fill's `executedProtocolFees`; preserves the order the fees were applied in.
position: number
}

// TODO: drop the `gasCost` intersection once `EnrichedOrder` in @cowprotocol/cow-sdk declares it.
export type RawOrder = EnrichedOrder & { gasCost?: string | null }

export type RawOrderStatusFromAPI = (typeof RAW_ORDER_STATUS)[keyof typeof RAW_ORDER_STATUS]

Expand Down Expand Up @@ -145,4 +159,11 @@ export type Trade = Pick<RawTrade, 'blockNumber' | 'logIndex' | 'owner' | 'txHas

export type WithNetworkId = { networkId: Network }

export enum ProtocolFeeType {
Surplus = 'surplus',
Volume = 'volume',
PriceImprovement = 'priceImprovement',
Unknown = 'unknown',
}

export type { SolverCompetitionResponse }
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ import { ReactNode, useState } from 'react'

import { AppDataWrapper } from 'components/common/AppDataWrapper'
import { RowWithCopyButton } from 'components/common/RowWithCopyButton'
import { ShowMoreButton } from 'components/common/ShowMoreButton'
import { useAppData } from 'hooks/useAppData'

import * as styledEl from './AppDataRowContent.styles'

import { AppDataContent } from '../AppData/AppDataContent'

interface AppDataRowContentProps {
Expand Down Expand Up @@ -44,9 +43,9 @@ export function AppDataRowContent({ appData, showExpanded = false, fullAppData }
)}
&nbsp;
{hasAppData && (
<styledEl.ShowMoreButton onClick={() => setShowDecodedAppData((state) => !state)}>
<ShowMoreButton onClick={() => setShowDecodedAppData((state) => !state)}>
{showDecodedAppData ? '[-] Show less' : '[+] Show more'}
</styledEl.ShowMoreButton>
</ShowMoreButton>
)}
</>
<div className={`hidden-content ${appDataError && 'error'}`}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,6 @@ export const DetailsTableTooltips = {
filled:
'Indicates what percentage amount this order has been filled and the amount sold/bought. Amount sold includes the fee.',
fees: 'The amount of fees paid for this order. This will show a progressive number for orders with partial fills. Might take a few minutes to show the final value.',
feesBreakdown:
'The costs and fees charged for this order, totaled per token, with a breakdown into the on-chain network costs and each fee applied. Might take a few minutes to show the final value.',
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ReactNode } from 'react'

import { GasFeeDisplay } from 'components/orders/GasFeeDisplay'
import { useFeeDisplayFeatureFlag } from 'hooks/useFeeDisplayFeatureFlag'

import { Order } from '../../../../api/operator'
import { DetailRow } from '../../../common/DetailRow'
Expand All @@ -11,9 +12,16 @@ interface CostAndFeesItemProps {
}

export function CostAndFeesItem({ order }: CostAndFeesItemProps): ReactNode {
const showBreakdown = useFeeDisplayFeatureFlag()

return (
<DetailRow label="Costs & Fees" tooltipText={DetailsTableTooltips.fees}>
<GasFeeDisplay order={order} />
// The breakdown is a total plus an expandable table, so it stacks; the legacy fee stays inline.
<DetailRow
label={showBreakdown ? 'Costs and fees' : 'Costs & Fees'}
tooltipText={showBreakdown ? DetailsTableTooltips.feesBreakdown : DetailsTableTooltips.fees}
stack={showBreakdown}
>
<GasFeeDisplay order={order} showBreakdown={showBreakdown} />
Comment thread
jmg-duarte marked this conversation as resolved.
Outdated
</DetailRow>
)
}

This file was deleted.

Loading
Loading