How the deployed program computes gross, fee, and net amounts per flow and pool kind
Fees are collected strictly on-chain by the shield-pool program into the mint-scoped treasury
PDA, using the fixed and variable fee stored in each pool’s PoolConfig. No other component
assesses or deducts fees.Fees apply only to flows that move value out of the pool (publicAmount < 0: withdrawals and
swaps). Deposits and shield-to-shield transfers charge no fee.
Constants
SOL pool fixed fee: 5_000_000 lamports (0.005 SOL)
SPL pool fixed fee (USDC/USDT): 450_000 base units (0.45 USDC / 0.45 USDT), charged in
the withdrawn token
BRS pool fixed fee: 2_300_000 base units (2.3 BRS), read from the live PoolConfig on
2026-11-30
Minimum deposit: 10_000_000 lamports (0.01 SOL) on the SOL pool; 1_000_000 base units
(1.00 USDC / 1.00 USDT) on the SPL pools
Per-flow behavior
Deposit (publicAmount > 0): no fee. The full deposit amount moves into the pool and the
output commitments encode the full amount.
Shield-to-shield transfer (publicAmount = 0): no fee. No external value moves; the output
commitments sum to the inputs.
Withdrawal (publicAmount < 0): the destination receives net = gross - fee; the treasury
PDA receives fee.
Swap (TransactSwap, SOL pool only): fee = fixed + variable is taken from the gross SOL
at the first transaction; the remainder (gross - fee) is what gets swapped.
Variable: 100_000_000 * 3 / 1000 = 300_000 base units (0.30 USDC)
Fee: 750_000 base units (0.75 USDC)
Net to recipient: 99_250_000 base units
Withdraw 100 BRS (100_000_000 base units) gross:
Fixed: 2_300_000 base units (2.3 BRS)
Variable: 100_000_000 * 3 / 1000 = 300_000 base units (0.30 BRS)
Fee: 2_600_000 base units (2.6 BRS)
Net to recipient: 97_400_000 base units
The Cloak app presents this in reverse: the user enters what the recipient should receive, and
the app grosses up so net equals the entered amount. At the program level the invariant is
always net = gross - fee.
For a user-facing summary with a who-pays table, see Fees.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Cloak Documentation","colors":{"primary":"#6366F1","light":"#818CF8","dark":"#4F46E5"},"logo":{"light":"https://mintcdn.com/cloak/r0L-ODeES1X_5cwS/logo/light.svg?fit=max\u0026auto=format\u0026n=r0L-ODeES1X_5cwS\u0026q=85\u0026s=5954e67549c08881ba79e740af1cfcbb","dark":"https://mintcdn.com/cloak/r0L-ODeES1X_5cwS/logo/dark.svg?fit=max\u0026auto=format\u0026n=r0L-ODeES1X_5cwS\u0026q=85\u0026s=f59f081b11a3e9ca4c1689c94e5483d9"},"favicon":"https://mintcdn.com/cloak/r0L-ODeES1X_5cwS/favicon.svg?fit=max\u0026auto=format\u0026n=r0L-ODeES1X_5cwS\u0026q=85\u0026s=bf111d429b406b5303c854b66d6b3f84","navbar":{"links":[{"href":"https://cloak.ag","label":"App"}]},"footer":{"socials":{"x":"https://x.com/cloak_ag","github":"https://github.com/cloak-ag","telegram":"https://t.me/cloak_community"}},"search":{"prompt":"Search Cloak docs..."},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"GitHub","icon":"github","href":"https://github.com/cloak-ag/sdk"},{"anchor":"NPM","icon":"npm","href":"https://www.npmjs.com/package/@cloak.dev/sdk"},{"anchor":"Telegram","icon":"telegram","href":"https://t.me/cloak_community"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"cloak","hasAudioNarration":false,"actualSubdomain":"cloak","customDomains":["docs.cloak.ag"],"gitSource":{"type":"github","owner":"cloak-ag","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":"","_id":"6b10cfdd9ffae5051c40ac0e"},"entitlements":{},"buildId":"6b10602857a1fea88d218d81","clientVersion":"0.0.4453","searchFilterCounts":[{"language":"default","tag":"Developers","count":56},{"language":"default","tag":"Guide","count":18},{"language":"default","tag":"Concepts","count":10},{"language":"default","tag":"Guides","count":10},{"language":"default","tag":"Wallet Integrations","count":8},{"language":"default","tag":"Partners","count":7},{"language":"default","tag":"Start here","count":7},{"language":"default","tag":"TypeScript SDK","count":7},{"language":"default","tag":"Examples","count":6},{"language":"default","tag":"Resources","count":6}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"auth-vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"concepts/fees","slug":"/concepts/fees","pageMetadata":{"title":"Fees","description":"How the deployed program computes gross, fee, and net amounts per flow and pool kind","icon":"receipt","href":"/concepts/fees"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"How the deployed program computes gross, fee, and net amounts per flow and pool kind\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Tip}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Fees are collected strictly on-chain by the shield-pool program into the mint-scoped treasury\nPDA, using the fixed and variable fee stored in each pool’s `,_jsx(_components.code,{children:`PoolConfig`}),`. No other component\nassesses or deducts fees.`]}),`\n`,_jsxs(_components.p,{children:[`Fees apply only to flows that move value out of the pool (`,_jsx(_components.code,{children:`publicAmount \u003c 0`}),`: withdrawals and\nswaps). Deposits and shield-to-shield transfers charge no fee.`]}),`\n`,_jsx(Heading,{level:`2`,id:`constants`,children:`Constants`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`SOL pool fixed fee: `,_jsx(_components.code,{children:`5_000_000`}),` lamports (`,_jsx(_components.code,{children:`0.005 SOL`}),`)`]}),`\n`,_jsxs(_components.li,{children:[`SPL pool fixed fee (USDC/USDT): `,_jsx(_components.code,{children:`450_000`}),` base units (`,_jsx(_components.code,{children:`0.45 USDC`}),` / `,_jsx(_components.code,{children:`0.45 USDT`}),`), charged in\nthe withdrawn token`]}),`\n`,_jsxs(_components.li,{children:[`BRS pool fixed fee: `,_jsx(_components.code,{children:`2_300_000`}),` base units (`,_jsx(_components.code,{children:`2.3 BRS`}),`), read from the live `,_jsx(_components.code,{children:`PoolConfig`}),` on\n2026-11-30`]}),`\n`,_jsxs(_components.li,{children:[`Variable fee (all pools): `,_jsx(_components.code,{children:`gross * 3 / 1000`}),` (0.30%)`]}),`\n`,_jsxs(_components.li,{children:[`Minimum deposit: `,_jsx(_components.code,{children:`10_000_000`}),` lamports (`,_jsx(_components.code,{children:`0.01 SOL`}),`) on the SOL pool; `,_jsx(_components.code,{children:`1_000_000`}),` base units\n(`,_jsx(_components.code,{children:`1.00 USDC`}),` / `,_jsx(_components.code,{children:`1.00 USDT`}),`) on the SPL pools`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`per-flow-behavior`,children:`Per-flow behavior`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[`Deposit (`,_jsx(_components.code,{children:`publicAmount > 0`}),`)`]}),`: no fee. The full deposit amount moves into the pool and the\noutput commitments encode the full amount.`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[`Shield-to-shield transfer (`,_jsx(_components.code,{children:`publicAmount = 0`}),`)`]}),`: no fee. No external value moves; the output\ncommitments sum to the inputs.`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[`Withdrawal (`,_jsx(_components.code,{children:`publicAmount \u003c 0`}),`)`]}),`: the destination receives `,_jsx(_components.code,{children:`net = gross - fee`}),`; the treasury\nPDA receives `,_jsx(_components.code,{children:`fee`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[`Swap (`,_jsx(_components.code,{children:`TransactSwap`}),`, SOL pool only)`]}),`: `,_jsx(_components.code,{children:`fee = fixed + variable`}),` is taken from the gross SOL\nat the first transaction; the remainder (`,_jsx(_components.code,{children:`gross - fee`}),`) is what gets swapped.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`fee-math`,children:`Fee math`}),`\n`,_jsx(_components.p,{children:`SOL pool (withdraw/swap):`}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`fee = 5_000_000 + gross * 3 / 1000`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`USDC and USDT pools (withdraw):`}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`fee = 450_000 + gross * 3 / 1000`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`BRS pool (withdraw):`}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`fee = 2_300_000 + gross * 3 / 1000`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`worked-examples`,children:`Worked examples`}),`\n`,_jsxs(_components.p,{children:[`Withdraw `,_jsx(_components.code,{children:`1 SOL`}),` (`,_jsx(_components.code,{children:`1_000_000_000`}),` lamports) gross:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Fixed: `,_jsx(_components.code,{children:`5_000_000`}),` lamports`]}),`\n`,_jsxs(_components.li,{children:[`Variable: `,_jsx(_components.code,{children:`1_000_000_000 * 3 / 1000 = 3_000_000`}),` lamports`]}),`\n`,_jsxs(_components.li,{children:[`Fee: `,_jsx(_components.code,{children:`8_000_000`}),` lamports`]}),`\n`,_jsxs(_components.li,{children:[`Net to recipient: `,_jsx(_components.code,{children:`992_000_000`}),` lamports`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Withdraw `,_jsx(_components.code,{children:`100 USDC`}),` (`,_jsx(_components.code,{children:`100_000_000`}),` base units) gross:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Fixed: `,_jsx(_components.code,{children:`450_000`}),` base units (`,_jsx(_components.code,{children:`0.45 USDC`}),`)`]}),`\n`,_jsxs(_components.li,{children:[`Variable: `,_jsx(_components.code,{children:`100_000_000 * 3 / 1000 = 300_000`}),` base units (`,_jsx(_components.code,{children:`0.30 USDC`}),`)`]}),`\n`,_jsxs(_components.li,{children:[`Fee: `,_jsx(_components.code,{children:`750_000`}),` base units (`,_jsx(_components.code,{children:`0.75 USDC`}),`)`]}),`\n`,_jsxs(_components.li,{children:[`Net to recipient: `,_jsx(_components.code,{children:`99_250_000`}),` base units`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Withdraw `,_jsx(_components.code,{children:`100 BRS`}),` (`,_jsx(_components.code,{children:`100_000_000`}),` base units) gross:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Fixed: `,_jsx(_components.code,{children:`2_300_000`}),` base units (`,_jsx(_components.code,{children:`2.3 BRS`}),`)`]}),`\n`,_jsxs(_components.li,{children:[`Variable: `,_jsx(_components.code,{children:`100_000_000 * 3 / 1000 = 300_000`}),` base units (`,_jsx(_components.code,{children:`0.30 BRS`}),`)`]}),`\n`,_jsxs(_components.li,{children:[`Fee: `,_jsx(_components.code,{children:`2_600_000`}),` base units (`,_jsx(_components.code,{children:`2.6 BRS`}),`)`]}),`\n`,_jsxs(_components.li,{children:[`Net to recipient: `,_jsx(_components.code,{children:`97_400_000`}),` base units`]}),`\n`]}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`The Cloak app presents this in reverse: the user enters what the recipient should receive, and\nthe app grosses up so `,_jsx(_components.code,{children:`net`}),` equals the entered amount. At the program level the invariant is\nalways `,_jsx(_components.code,{children:`net = gross - fee`}),`.`]})}),`\n`,_jsxs(_components.p,{children:[`For a user-facing summary with a who-pays table, see `,_jsx(_components.a,{href:`/guide/fees`,children:`Fees`}),`.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Fees","description":"How the deployed program computes gross, fee, and net amounts per flow and pool kind","icon":"receipt","href":"/concepts/fees"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Constants","slug":"constants","depth":2,"children":[]},{"title":"Per-flow behavior","slug":"per-flow-behavior","depth":2,"children":[]},{"title":"Fee math","slug":"fee-math","depth":2,"children":[]},{"title":"Worked examples","slug":"worked-examples","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"cloak","siteName":"Cloak Documentation","title":"Fees - Cloak Documentation","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-12-01T18:42:02.249Z","originalFileLocation":"concepts/fees.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"How the deployed program computes gross, fee, and net amounts per flow and pool kind\">\u003cmeta data-mint-head name=\"application-name\" content=\"Cloak Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/cloak/IpqEVrAzuoUc5yhO/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/cloak/IpqEVrAzuoUc5yhO/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/cloak/IpqEVrAzuoUc5yhO/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/cloak/IpqEVrAzuoUc5yhO/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/cloak/IpqEVrAzuoUc5yhO/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/cloak/IpqEVrAzuoUc5yhO/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/cloak/IpqEVrAzuoUc5yhO/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/cloak/IpqEVrAzuoUc5yhO/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/cloak/IpqEVrAzuoUc5yhO/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Fees - Cloak Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"How the deployed program computes gross, fee, and net amounts per flow and pool kind\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Cloak Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.cloak.ag/concepts/fees\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://cloak.mintlify.site/_mintlify/api/og/v2?division=Concepts\u0026amp;title=Fees\u0026amp;description=How+the+deployed+program+computes+gross%2C+fee%2C+and+net+amounts+per+flow+and+pool+kind\u0026amp;theme=2feb79f6e533c758e409f03b\u0026amp;signature=2a162300b835d7dc71cf78b3595c26f44e542b4c9c33083170988579b89b6577\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Fees - Cloak Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"How the deployed program computes gross, fee, and net amounts per flow and pool kind\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://cloak.mintlify.site/_mintlify/api/og/v2?division=Concepts\u0026amp;title=Fees\u0026amp;description=How+the+deployed+program+computes+gross%2C+fee%2C+and+net+amounts+per+flow+and+pool+kind\u0026amp;theme=2feb79f6e533c758e409f03b\u0026amp;signature=2a162300b835d7dc71cf78b3595c26f44e542b4c9c33083170988579b89b6577\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/cloak/IpqEVrAzuoUc5yhO/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Cloak Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#6366F1\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.cloak.ag/concepts/fees\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/concepts/fees.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.cloak.ag/#organization\",\"name\":\"Cloak Documentation\",\"url\":\"https://docs.cloak.ag\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/cloak/r0L-ODeES1X_5cwS/logo/light.svg?fit=max\u0026auto=format\u0026n=r0L-ODeES1X_5cwS\u0026q=85\u0026s=5954e67549c08881ba79e740af1cfcbb\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.cloak.ag#website\",\"name\":\"Cloak Documentation\",\"url\":\"https://docs.cloak.ag\",\"publisher\":{\"@id\":\"https://docs.cloak.ag/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.cloak.ag/concepts/fees#webpage\",\"url\":\"https://docs.cloak.ag/concepts/fees\",\"name\":\"Fees\",\"description\":\"How the deployed program computes gross, fee, and net amounts per flow and pool kind\",\"dateModified\":\"2026-12-01T18:42:02.249Z\",\"isPartOf\":{\"@id\":\"https://docs.cloak.ag#website\"},\"breadcrumb\":{\"@id\":\"https://docs.cloak.ag/concepts/fees#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.cloak.ag/concepts/fees#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Concepts\",\"item\":\"https://docs.cloak.ag/concepts/how-cloak-works\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Fees\",\"item\":\"https://docs.cloak.ag/concepts/fees\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.cloak.ag/concepts/fees#article\",\"headline\":\"Fees\",\"name\":\"Fees\",\"description\":\"How the deployed program computes gross, fee, and net amounts per flow and pool kind\",\"url\":\"https://docs.cloak.ag/concepts/fees\",\"mainEntityOfPage\":{\"@id\":\"https://docs.cloak.ag/concepts/fees#webpage\"},\"dateModified\":\"2026-12-01T18:42:02.249Z\",\"publisher\":{\"@id\":\"https://docs.cloak.ag/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.cloak.ag#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Cloak Documentation\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Cloak Documentation\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/concepts/fees.md","siteName":"Cloak Documentation","nav":{"global":{"anchors":[{"anchor":"GitHub","icon":"github","href":"https://github.com/cloak-ag/sdk"},{"anchor":"NPM","icon":"npm","href":"https://www.npmjs.com/package/@cloak.dev/sdk"},{"anchor":"Telegram","icon":"telegram","href":"https://t.me/cloak_community"}]},"tabs":[{"tab":"Guide","pages":[{"title":"Guide","href":"/guide/what-is-cloak"}]},{"tab":"Developers","groups":[{"group":"Get Started","pages":[{"title":"Introduction","icon":"shield-halved","href":"/get-started/introduction"},{"title":"Core concepts","icon":"lightbulb","href":"/get-started/core-concepts"},{"title":"Quickstart","icon":"rocket","href":"/get-started/quickstart"},{"title":"Your first private transaction","icon":"play","href":"/get-started/first-private-transaction"},{"title":"Networks and assets","icon":"coins","href":"/get-started/networks-and-assets"}]},{"group":"Concepts","pages":[{"title":"How Cloak works","icon":"compass","href":"/concepts/how-cloak-works"},{"title":"Privacy architecture","icon":"diagram-project","href":"/concepts/privacy-architecture"},{"title":"UTXO model","icon":"lightbulb","href":"/concepts/utxo-model"},{"title":"Notes and balances","icon":"wallet","href":"/concepts/notes-and-balances"},{"title":"Zero-knowledge proofs","icon":"file-code","href":"/concepts/zero-knowledge-proofs"},{"title":"Privacy guarantees","icon":"eye-slash","href":"/concepts/privacy-guarantees"},{"title":"Viewing keys and compliance","icon":"key","href":"/concepts/viewing-keys-compliance"},{"title":"Transaction lifecycle","description":"Deposit, withdraw, transfer, and swap lifecycles across all runtime layers","icon":"shuffle","href":"/concepts/transaction-lifecycle"},{"title":"Fees","icon":"receipt","href":"/concepts/fees"},{"title":"Shield Pool program","description":"Program behavior that SDK and app integrators need to know","icon":"microchip","href":"/concepts/shield-pool-program"}]},{"group":"TypeScript SDK","pages":[{"title":"createCloak","icon":"wand-magic-sparkles","href":"/sdk/create-cloak"},{"title":"Low-level API","icon":"vault","href":"/sdk/low-level-api"},{"title":"Solana Kit integration","icon":"plug","href":"/sdk/kit-integration"},{"title":"Request authentication","icon":"signature","href":"/sdk/request-authentication"},{"title":"Batch signing","icon":"layer-group","href":"/sdk/batch-signing"},{"title":"Backend integration","icon":"server","href":"/sdk/backend-integration"},{"title":"Custom program integration","icon":"puzzle-piece","href":"/sdk/custom-programs"}]},{"group":"Wallet Integrations","pages":[{"title":"Wallet integrations","icon":"wallet","href":"/wallets/overview"},{"title":"Phantom and Wallet Standard","icon":"ghost","href":"/wallets/phantom-and-wallet-standard"},{"title":"Solana wallet adapter","icon":"wallet","href":"/wallets/wallet-adapter"},{"title":"Privy","icon":"user-shield","href":"/wallets/privy"},{"title":"Smart wallets","icon":"building-shield","href":"/wallets/smart-wallets"},{"title":"EVM wallets","icon":"ethereum","href":"/wallets/evm-wallets"},{"title":"Hardware wallets","icon":"key","href":"/wallets/hardware-wallets"},{"title":"Custom signers","icon":"code","href":"/wallets/custom-signers"}]},{"group":"Guides","pages":[{"title":"Deposit into a private balance","icon":"arrow-down-to-bracket","href":"/guides/deposit"},{"title":"Read private balances","icon":"scale-balanced","href":"/guides/balances"},{"title":"Private transfers","icon":"shuffle","href":"/guides/private-transfers"},{"title":"Withdraw to a public address","icon":"arrow-up-from-bracket","href":"/guides/withdraw"},{"title":"Private swaps","icon":"arrows-rotate","href":"/guides/private-swaps"},{"title":"Cross-chain","icon":"bridge","href":"/guides/cross-chain"},{"title":"Payroll and batch payouts","icon":"money-check-dollar","href":"/guides/payroll"},{"title":"Payment links","icon":"link","href":"/guides/payment-links"},{"title":"Transaction history","icon":"clock-rotate-left","href":"/guides/transaction-history"},{"title":"Viewing keys and selective disclosure","icon":"magnifying-glass-dollar","href":"/guides/viewing-keys"}]},{"group":"Examples","pages":[{"title":"Minimal TypeScript","icon":"terminal","href":"/examples/minimal-typescript"},{"title":"Next.js application","icon":"react","href":"/examples/nextjs"},{"title":"React (Vite)","icon":"atom","href":"/examples/react"},{"title":"Privy integration","icon":"user-shield","href":"/examples/privy"},{"title":"Backend orchestration","icon":"gears","href":"/examples/backend-orchestration"},{"title":"Low-level end-to-end","icon":"code-branch","href":"/examples/free-functions"}]},{"group":"API \u0026 SDK Reference","pages":[{"title":"API reference","icon":"code","href":"/reference/api"},{"title":"Configuration options","icon":"sliders","href":"/reference/configuration"},{"title":"Events and callbacks","icon":"bell","href":"/reference/events-and-callbacks"},{"title":"Error codes","icon":"triangle-exclamation","href":"/reference/errors"}]},{"group":"Resources","pages":[{"title":"Program IDs and addresses","icon":"fingerprint","href":"/resources/program-ids"},{"title":"Network and RPC","icon":"network-wired","href":"/resources/network-and-rpc"},{"title":"Security considerations","icon":"shield-check","href":"/resources/security"},{"title":"Troubleshooting","icon":"wrench","href":"/resources/troubleshooting"},{"title":"Changelog","icon":"rocket","href":"/releases/latest"},{"title":"Developer FAQ","icon":"circle-question","href":"/resources/faq"}]}]},{"tab":"Partners","pages":[{"title":"Partners","href":"/affiliates/overview"}]},{"tab":"AI Tools","pages":[{"title":"AI Tools","href":"/ai-tools/ai-integration"}]}]},"basePath":"","title":"Fees - Cloak Documentation","deploymentId":"dpl_BLZw3QngerHodH9E8mGgC4v752y3","buildId":"dpl_BLZw3QngerHodH9E8mGgC4v752y3","dynamics":[],"chunks":[]}