Skip to content

Commit 7e0d7d1

Browse files
authored
Merge pull request #721 from reservoirprotocol/ted/fe-7747-include-usd-values-in-swap-success-posthog-event
Add usd values to swap events
2 parents 681e5de + 1627058 commit 7e0d7d1

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

.changeset/large-baboons-lose.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@reservoir0x/relay-kit-ui': patch
3+
---
4+
5+
Add usd values to swap events

packages/ui/src/components/common/TransactionModal/TransactionModal.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ export const TransactionModal: FC<TransactionModalProps> = (
117117
currency_in: fromToken?.symbol,
118118
chain_id_out: toToken?.chainId,
119119
currency_out: toToken?.symbol,
120+
currency_in_usd: details?.currencyIn?.amountUsd,
121+
currency_out_usd: details?.currencyOut?.amountUsd,
120122
is_canonical: useExternalLiquidity,
121123
quote_id: quoteId,
122124
txHashes: steps

packages/ui/src/utils/quote.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,8 @@ export const getSwapEventData = (
299299
amount_out: details?.currencyOut?.amount,
300300
currency_out: details?.currencyOut?.currency?.symbol,
301301
chain_id_out: details?.currencyOut?.currency?.chainId,
302+
currency_in_usd: details?.currencyIn?.amountUsd,
303+
currency_out_usd: details?.currencyOut?.amountUsd,
302304
deposit_address: steps?.find((step) => step.depositAddress)?.depositAddress,
303305
txHashes: steps
304306
?.map((step) => {

0 commit comments

Comments
 (0)