From 74d7de35edeba3766997c52b2fcc1ed62b9f7f06 Mon Sep 17 00:00:00 2001 From: andriy-shymkiv Date: Thu, 11 Jun 2026 18:02:19 +0300 Subject: [PATCH] docs: add fee-token discovery snippets to monetization page --- overview/monetization.mdx | 71 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/overview/monetization.mdx b/overview/monetization.mdx index dc928a5..b814fd9 100644 --- a/overview/monetization.mdx +++ b/overview/monetization.mdx @@ -231,6 +231,77 @@ await withdrawAllFees( +Not sure which tokens your fees accrued in? Each side has a fees endpoint that returns every token your address has earned fees in on a chain. The amounts are lifetime totals per token, claimed and unclaimed combined, so check the live on-chain balance (as the claim snippets above do) before withdrawing. + + + +```ts Check Delta fee tokens +const PARTNER_ADDRESS = "0x..."; // your partnerAddress +const CHAIN_ID = 1; + +const parameters = JSON.stringify([ + { + type: "category", + value: PARTNER_ADDRESS, + target: ["variable", ["template-tag", "partner_address"]], + }, + { + type: "category", + value: CHAIN_ID, + target: ["variable", ["template-tag", "chain_id"]], + }, +]); + +const res = await fetch( + `https://proxy.paraswap.io/fees/delta?parameters=${encodeURIComponent( + parameters + )}` +); +const { data } = await res.json(); + +// Each row is [chain_id, fee_token, total_amount] +for (const [, token, total] of data.rows) { + console.log(`${token}: ${total}`); +} +``` + +```ts Check Market fee tokens +const PARTNER_ADDRESS = "0x..."; // your partnerAddress +const CHAIN_ID = 1; + +const parameters = JSON.stringify([ + { + type: "category", + value: PARTNER_ADDRESS, + target: ["variable", ["template-tag", "partneraddress"]], + }, + { + type: "category", + value: CHAIN_ID, + target: ["variable", ["template-tag", "chainId"]], + }, + { + type: "category", + value: "partner", + target: ["variable", ["template-tag", "feeType"]], + }, +]); + +const res = await fetch( + `https://proxy.paraswap.io/fees/since-v6?parameters=${encodeURIComponent( + parameters + )}` +); +const { data } = await res.json(); + +// Each row is [corrected_sum, partnerfeetoken, chainid] +for (const [total, token] of data.rows) { + console.log(`${token}: ${total}`); +} +``` + + + ## Next steps