Terminal resources, the flow epilogue and sweepTo, and how estimates and floors are reported on the response.
Any balance the execution proxy still holds when the flow ends stays there unless the flow moves it. Ops that deliver to a recipient move their own output. The flow epilogue, or its shorthand run.sweepTo, moves the rest.
Terminal resources
A resource is terminal when no op in the flow consumes it; see Resource Model. Every terminal appears in the response’s outputs with role: "terminal", an owner and a delivery. An unspent resource input is reported under the key input.<name>.
Terminal
Example
Owner
Moved by the epilogue?
Delivered to a recipient
core.transfer.transferred, lifi.zap.amountOut with recipient bound
Named forwards. Each entry in forwards moves the proxy’s whole balance of one resource to its to address, and the response reports the amount the simulation measured. Name each resource at most once; it must be on the flow’s chain, and the native coin is { "kind": "native", "chainId": … }.
Remainder.remainder moves the whole proxy balance of every other token that is a proxy-held terminal of this flow. It does not touch tokens the flow never produced as a terminal, and a remainder with nothing to move does nothing.
Targets.to and remainder take a literal address or { "$ref": "context.sender" }. No other ref is accepted.
An epilogue needs forwards, remainder, or both. It never moves terminals delivered to a recipient or terminals that arrive later.
Set the epilogue from the SDK
The flow builder has no epilogue method. Build the request with sdk.request, add epilogue to the flow document, and send it with sdk.client.compile:
The swap’s WETH goes to 0x2222…2222. Any USDC the swap left unspent (its unspentIn output) goes back to the signer through the remainder.
sweepTo
run.sweepTo on the compile request is shorthand for epilogue.remainder. It takes the same targets:
builder.context.sender. Sweep to the transaction signer, as most flows do. On the wire it is { "$ref": "context.sender" }.
A literal address. Sweep to that address.
Omitted. No sweep. Terminal resources stay on the per-signer execution proxy, for example to accumulate a balance across several submissions.
A request with both run.sweepTo and flow.epilogue is rejected with a validation_error at run.sweepTo. To deliver one token to a third party, use an op’s recipient or a named epilogue forward instead of sweeping everything there.The sweep moves every proxy-held terminal that is available now. It does not move resources another op consumes, terminals delivered to a recipient, terminals that arrive later, or handles. An op that does not spend all of its input reports the rest as its own output, for example lifi.swap’s unspentIn, and the sweep moves it if nothing binds it. A core.split relies on this to keep part of an input: with config: { bps: 8000 }, bind only its a handle to a swap, and the sweep returns the unbound 20% (b) to the sender in the same transaction.
Non-transferable terminal resources
The remainder moves the whole balance of each terminal token on the proxy, and some balances cannot be transferred. The common case is aTokens or other collateral receipts that back an open debt: Aave reverts a transfer that would leave the position under-collateralised, so a remainder or sweepTo over such a balance makes the whole transaction revert.
When a flow deliberately leaves a position on the proxy, for example a borrow or leverage flow that keeps collateral in place, do not set a remainder or sweepTo. Move only the loose tokens: name them in epilogue.forwards, or read each with core.balanceOf (the owner defaults to the proxy) and move it with core.transfer:
import { createComposeSdk, resources } from '@lifi/composer-sdk';const sdk = createComposeSdk({ baseUrl: 'https://composer.li.quest', apiKey: process.env.LIFI_API_KEY!,});const USDC = '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'; // USDC on Baseconst WETH = '0x4200000000000000000000000000000000000006'; // WETH on Baseconst builder = sdk.flow(8453, { inputs: { collateral: resources.erc20(WETH, 8453) },});// ...ops that leave a position on the proxy and some loose USDC...// Read only the loose USDC on the proxy and transfer it to the signer.const loose = builder.core.balanceOf('read-usdc', { bind: {}, config: { token: USDC },});builder.core.transfer('payout', { bind: { amount: loose.balance, recipient: builder.context.sender }, config: {},});
core.transfer moves the whole amount it is bound to, and the recipient owns its transferred output.
Supplying input amounts
A resource input’s value in run.inputs is either a materialiser or a plain integer. A materialiser funds or measures the amount when the transaction runs: directDeposit pulls it from the signer, while balanceOf and call measure an amount that is already there or that a call produces. A plain integer says the proxy already holds that amount; nothing is pulled from the signer. See Wire runtime values and the materialisers catalog.Amounts that depend on an earlier step, such as the shares a vault deposit mints, are read onchain during the transaction. The only amounts fixed at compile time are provider quotes.
Amounts on the response
Every token output port has an entry in outputs, keyed <nodeId>.<port>, plus input.<name> for unspent inputs. The SDK decodes amounts to bigint. The compile response lists every response field; each outputs entry carries:
role: consumed (a later node, named in consumedBy, spends it) or terminal.
owner (terminal only): who holds the output after the flow. With sweepTo set to the signer, proxy-held terminals report the signer.
delivery (terminal only): { when: "now" }, or { when: "future", etaSeconds?, provider?, trackingId? } for an output that arrives later. See Future resources.
amount.estimate: the expected amount. basis: "simulated" when the simulation measured it, basis: "quoted" when it comes from a provider quote. Display it as “you will receive ≈ X”.
amount.minimum: the guaranteed floor, enforced onchain. basis says where it comes from: guard (a guard floor), op (the op’s own minimum, such as a swap’s minOut), input (an unspent input’s bound amount), or declared (a providesMinimum port’s estimate, used when no other floor exists). Display it as “you will receive at least X”.
An absent minimum means no floor exists. There is no zero placeholder: an unguarded split output reports only an estimate. When a guard floor and an op floor both exist, the larger wins; see Guaranteed minimums. On a 206 (allow-revert) response nothing was measured, so estimates are quoted and floors come only from ops and inputs.For a continuation.settle output, minimum is the minimum received, which the settlement contract checks onchain, and estimate is an expected outcome that is never enforced; see Cross-chain flows.The epilogue block on a 200 response reports each named forward with its resource, to and measured amount, and the resolved remainder address. The remainder itself is not measured; it shows up in outputs only as the new owner.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"LI.FI","description":"Get the best price execution for any swaps and bridging across EVM chains, Solana, Bitcoin and alt-VMs. Enable trading across all DEX aggregators, bridges, and intent-systems and save hundreds of developer hours.","colors":{"primary":"#5C67FF","light":"#fab6f4","dark":"#5C67FF"},"logo":{"light":"https://mintcdn.com/lifi/EmProAEgMrruLUbI/logo/light.png?fit=max\u0026auto=format\u0026n=EmProAEgMrruLUbI\u0026q=85\u0026s=f435348680e682acea6e3b9af339ed7a","dark":"https://mintcdn.com/lifi/EmProAEgMrruLUbI/logo/dark.png?fit=max\u0026auto=format\u0026n=EmProAEgMrruLUbI\u0026q=85\u0026s=d02539147db168291d7c711beb45d10b"},"favicon":"https://mintcdn.com/lifi/jEGN0oG6bNsdv0a3/logo/favicon.svg?fit=max\u0026auto=format\u0026n=jEGN0oG6bNsdv0a3\u0026q=85\u0026s=35fb6353ca8815e24daf1025135fef38","api":{"openapi":"openapi.yaml"},"appearance":{"default":"dark"},"background":{"color":{"light":"#FAFAFF","dark":"#000B29"}},"navbar":{"links":[{"href":"https://lifihelp.zendesk.com/hc/en-us","label":"Support"}],"primary":{"type":"button","label":"Get Started","href":"https://portal.li.fi/signup"}},"footer":{"socials":{"x":"https://x.com/lifiprotocol","github":"https://github.com/lifinance","website":"https://li.fi/"},"links":[{"header":"Company","items":[{"label":"Careers","href":"https://li.fi/careers"},{"label":"Brand Assets","href":"https://li.fi/brand-assets"},{"label":"About","href":"https://li.fi/"}]},{"header":"Tools","items":[{"label":"LI.FI Explorer","href":"https://explorer.li.fi/?utm_source=lifi\u0026utm_medium=footer_link_tools\u0026utm_campaign=lifi_to_explorer"}]},{"header":"Legal","items":[{"label":"Privacy Policy","href":"https://li.fi/legal/privacy-policy"},{"label":"Terms of Service","href":"https://li.fi/legal/terms-and-conditions"},{"label":"Imprint","href":"https://li.fi/legal/imprint"}]}]},"styling":{"eyebrows":"section","codeblocks":"system","latex":false},"integrations":{"ga4":{"measurementId":"G-NTE1P73M4Q"}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"navigation":{"languages":[{"language":"en","href":"introduction/introduction"},{"language":"zh-Hans","href":"zh-Hans/introduction/introduction"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"lifi","hasAudioNarration":false,"actualSubdomain":"lifi","customDomains":["docs.li.fi"],"gitSource":{"type":"github","owner":"lifinance","repo":"public-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6aff192945eb182701d468bf","clientVersion":"0.0.4270","searchFilterCounts":[{"language":"en","tag":"Composer","count":56},{"language":"en","tag":"Overview","count":48},{"language":"zh-Hans","tag":"概述","count":44},{"language":"zh-Hans","tag":"Composer","count":44},{"language":"en","tag":"Integrate via Composer API","count":40},{"language":"en","tag":"API Reference","count":35},{"language":"en","tag":"Intents \u0026 Solvers","count":32},{"language":"zh-Hans","tag":"意图与求解器","count":32},{"language":"zh-Hans","tag":"API 参考","count":30},{"language":"en","tag":"Reference","count":28},{"language":"zh-Hans","tag":"通过 Composer API 集成","count":28},{"language":"en","tag":"For Agents","count":21},{"language":"en","tag":"Widget","count":20},{"language":"zh-Hans","tag":"Widget","count":20},{"language":"zh-Hans","tag":"参考文档","count":18},{"language":"en","tag":"Getting Started","count":16},{"language":"en","tag":"General API","count":16},{"language":"zh-Hans","tag":"通用 API","count":16},{"language":"zh-Hans","tag":"企业级功能","count":15},{"language":"zh-Hans","tag":"入门","count":14}]},"assistantConfig":{},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","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":"workos-onboarding","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":"site-roles","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":"assistant-v5","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":"workos-sso-scim","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":"workos-signup","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":"workos-enabled","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":"sso-setup-deadline-banner","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":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"composer/composer-api/concepts/sweeping-and-amounts","slug":"/composer/composer-api/concepts/sweeping-and-amounts","pageMetadata":{"title":"Terminal Resources","description":"Terminal resources, the flow epilogue and sweepTo, and how estimates and floors are reported on the response.","href":"/composer/composer-api/concepts/sweeping-and-amounts"},"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: \"Terminal resources, the flow epilogue and sweepTo, and how estimates and floors are reported on the response.\"\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`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Any balance the execution proxy still holds when the flow ends stays there unless the flow moves it. Ops that deliver to a recipient move their own output. The `,_jsx(_components.strong,{children:`flow epilogue`}),`, or its shorthand `,_jsx(_components.code,{children:`run.sweepTo`}),`, moves the rest.`]}),`\n`,_jsx(Heading,{level:`2`,id:`terminal-resources`,children:`Terminal resources`}),`\n`,_jsxs(_components.p,{children:[`A resource is `,_jsx(_components.strong,{children:`terminal`}),` when no op in the flow consumes it; see `,_jsx(_components.a,{href:`/composer/composer-api/concepts/resources-and-ports#terminal-resources-and-their-owner`,children:`Resource Model`}),`. Every terminal appears in the response’s `,_jsx(_components.code,{children:`outputs`}),` with `,_jsx(_components.code,{children:`role: \"terminal\"`}),`, an `,_jsx(_components.code,{children:`owner`}),` and a `,_jsx(_components.code,{children:`delivery`}),`. An unspent resource input is reported under the key `,_jsx(_components.code,{children:`input.\u003cname>`}),`.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Terminal`}),_jsx(_components.th,{children:`Example`}),_jsx(_components.th,{children:`Owner`}),_jsx(_components.th,{children:`Moved by the epilogue?`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Delivered to a recipient`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`core.transfer.transferred`}),`, `,_jsx(_components.code,{children:`lifi.zap.amountOut`}),` with `,_jsx(_components.code,{children:`recipient`}),` bound`]}),_jsx(_components.td,{children:`The recipient`}),_jsx(_components.td,{children:`No: it already left the proxy.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Arrives later`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`lifi.bridge.amountOut`}),`, `,_jsx(_components.code,{children:`lifiIntents.order.amountOut`}),`, `,_jsx(_components.code,{children:`continuation.settle.output`})]}),_jsx(_components.td,{children:`The destination`}),_jsx(_components.td,{children:`No: it is never on the proxy.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Still on the proxy, available now`}),_jsx(_components.td,{children:`A vault receipt, an unbound split output, an unspent input`}),_jsx(_components.td,{children:`The epilogue’s destination, or the proxy if there is none`}),_jsx(_components.td,{children:`Yes.`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`the-flow-epilogue`,children:`The flow epilogue`}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`epilogue`}),` is an optional top-level Flow field. Its transfers run after the last node:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`json`,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:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"epilogue\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"forwards\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"resource\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"kind\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"erc20\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"token\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"0x4200000000000000000000000000000000000006\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"chainId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`8453`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"to\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"0x2222222222222222222222222222222222222222\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"remainder\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"$ref\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"context.sender\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Named forwards.`}),` Each entry in `,_jsx(_components.code,{children:`forwards`}),` moves the proxy’s `,_jsx(_components.strong,{children:`whole balance`}),` of one resource to its `,_jsx(_components.code,{children:`to`}),` address, and the response reports the amount the simulation measured. Name each resource at most once; it must be on the flow’s chain, and the native coin is `,_jsx(_components.code,{children:`{ \"kind\": \"native\", \"chainId\": … }`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Remainder.`}),` `,_jsx(_components.code,{children:`remainder`}),` moves the whole proxy balance of every other token that is a proxy-held terminal of this flow. It does not touch tokens the flow never produced as a terminal, and a remainder with nothing to move does nothing.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Targets.`}),` `,_jsx(_components.code,{children:`to`}),` and `,_jsx(_components.code,{children:`remainder`}),` take a literal address or `,_jsx(_components.code,{children:`{ \"$ref\": \"context.sender\" }`}),`. No other ref is accepted.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`An epilogue needs `,_jsx(_components.code,{children:`forwards`}),`, `,_jsx(_components.code,{children:`remainder`}),`, or both. It never moves terminals delivered to a recipient or terminals that arrive later.`]}),`\n`,_jsx(Heading,{level:`3`,id:`set-the-epilogue-from-the-sdk`,children:`Set the epilogue from the SDK`}),`\n`,_jsxs(_components.p,{children:[`The flow builder has no epilogue method. Build the request with `,_jsx(_components.code,{children:`sdk.request`}),`, add `,_jsx(_components.code,{children:`epilogue`}),` to the flow document, and send it with `,_jsx(_components.code,{children:`sdk.client.compile`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`45`,language:`typescript`,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:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`45`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`createComposeSdk`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`materialisers`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`resources`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '@lifi/composer-sdk'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` sdk`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` createComposeSdk`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` baseUrl:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://composer.li.quest'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` apiKey:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`LIFI_API_KEY`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` USDC`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`; `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// USDC on Base`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` WETH`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '0x4200000000000000000000000000000000000006'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`; `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// WETH on Base`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` builder`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` sdk`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`flow`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`8453`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` inputs:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`amountIn:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` resources`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`erc20`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`USDC`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`8453`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) },`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`builder`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`lifi`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`swap`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'swap'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` bind:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`amountIn:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` builder`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`inputs`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`amountIn`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` config:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`resourceOut:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` resources`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`erc20`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`WETH`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`8453`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`), `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`slippage:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 0.005`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` request`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` sdk`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`request`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`builder`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`build`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(), {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` inputs:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`amountIn:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` materialisers`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`directDeposit`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`amount:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '1000000'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }) },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` signer:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '0x1111111111111111111111111111111111111111'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` result`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` sdk`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`client`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`compile`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ...`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`request`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` flow:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ...`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`request`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`flow`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` epilogue:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` forwards:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` resource:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` resources`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`erc20`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`WETH`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`8453`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`),`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` to:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '0x2222222222222222222222222222222222222222'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` remainder:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$ref:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'context.sender'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`status`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ===`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'success'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` for`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` forward`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` of`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`epilogue`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`?.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`forwards`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ??`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` []) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`forward`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`to`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`forward`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`amount`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The swap’s WETH goes to `,_jsx(_components.code,{children:`0x2222…2222`}),`. Any USDC the swap left unspent (its `,_jsx(_components.code,{children:`unspentIn`}),` output) goes back to the signer through the remainder.`]}),`\n`,_jsx(Heading,{level:`2`,id:`sweepto`,children:_jsx(_components.code,{children:`sweepTo`})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`run.sweepTo`}),` on the compile request is shorthand for `,_jsx(_components.code,{children:`epilogue.remainder`}),`. It takes the same targets:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`builder.context.sender`}),`.`]}),` Sweep to the transaction signer, as most flows do. On the wire it is `,_jsx(_components.code,{children:`{ \"$ref\": \"context.sender\" }`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`A literal address.`}),` Sweep to that address.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Omitted.`}),` No sweep. Terminal resources stay on the per-signer execution proxy, for example to accumulate a balance across several submissions.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`A request with both `,_jsx(_components.code,{children:`run.sweepTo`}),` and `,_jsx(_components.code,{children:`flow.epilogue`}),` is rejected with a `,_jsx(_components.code,{children:`validation_error`}),` at `,_jsx(_components.code,{children:`run.sweepTo`}),`. To deliver one token to a third party, use an op’s `,_jsx(_components.code,{children:`recipient`}),` or a named epilogue forward instead of sweeping everything there.`]}),`\n`,_jsxs(_components.p,{children:[`The sweep moves every proxy-held terminal that is available now. It does not move resources another op consumes, terminals delivered to a recipient, terminals that arrive later, or handles. An op that does not spend all of its input reports the rest as its own output, for example `,_jsx(_components.code,{children:`lifi.swap`}),`’s `,_jsx(_components.code,{children:`unspentIn`}),`, and the sweep moves it if nothing binds it. A `,_jsx(_components.code,{children:`core.split`}),` relies on this to keep part of an input: with `,_jsx(_components.code,{children:`config: { bps: 8000 }`}),`, bind only its `,_jsx(_components.code,{children:`a`}),` handle to a swap, and the sweep returns the unbound 20% (`,_jsx(_components.code,{children:`b`}),`) to the sender in the same transaction.`]}),`\n`,_jsx(Heading,{level:`3`,id:`non-transferable-terminal-resources`,children:`Non-transferable terminal resources`}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`The remainder moves the `,_jsx(_components.strong,{children:`whole balance`}),` of each terminal token on the proxy, and some balances cannot be transferred. The common case is `,_jsx(_components.strong,{children:`aTokens or other collateral receipts that back an open debt`}),`: Aave reverts a transfer that would leave the position under-collateralised, so a remainder or `,_jsx(_components.code,{children:`sweepTo`}),` over such a balance makes the `,_jsx(_components.strong,{children:`whole transaction revert`}),`.`]})}),`\n`,_jsxs(_components.p,{children:[`When a flow deliberately leaves a position on the proxy, for example a borrow or leverage flow that keeps collateral in place, `,_jsx(_components.strong,{children:`do not`}),` set a remainder or `,_jsx(_components.code,{children:`sweepTo`}),`. Move only the loose tokens: name them in `,_jsx(_components.code,{children:`epilogue.forwards`}),`, or read each with `,_jsx(_components.code,{children:`core.balanceOf`}),` (the owner defaults to the proxy) and move it with `,_jsx(_components.code,{children:`core.transfer`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`26`,language:`typescript`,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:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`26`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`createComposeSdk`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`resources`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '@lifi/composer-sdk'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` sdk`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` createComposeSdk`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` baseUrl:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://composer.li.quest'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` apiKey:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`LIFI_API_KEY`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` USDC`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`; `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// USDC on Base`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` WETH`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '0x4200000000000000000000000000000000000006'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`; `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// WETH on Base`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` builder`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` sdk`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`flow`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`8453`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` inputs:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`collateral:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` resources`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`erc20`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`WETH`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`8453`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) },`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// ...ops that leave a position on the proxy and some loose USDC...`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Read only the loose USDC on the proxy and transfer it to the signer.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` loose`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` builder`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`core`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`balanceOf`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'read-usdc'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` bind:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` config:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`token:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` USDC`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`builder`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`core`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`transfer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'payout'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` bind:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`amount:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` loose`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`balance`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`recipient:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` builder`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`context`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`sender`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` config:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {},`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`core.transfer`}),` moves the whole amount it is bound to, and the recipient owns its `,_jsx(_components.code,{children:`transferred`}),` output.`]}),`\n`,_jsx(Heading,{level:`2`,id:`supplying-input-amounts`,children:`Supplying input amounts`}),`\n`,_jsxs(_components.p,{children:[`A resource input’s value in `,_jsx(_components.code,{children:`run.inputs`}),` is either a materialiser or a plain integer. A materialiser funds or measures the amount when the transaction runs: `,_jsx(_components.code,{children:`directDeposit`}),` pulls it from the signer, while `,_jsx(_components.code,{children:`balanceOf`}),` and `,_jsx(_components.code,{children:`call`}),` measure an amount that is already there or that a call produces. A plain integer says the proxy `,_jsx(_components.strong,{children:`already holds`}),` that amount; nothing is pulled from the signer. See `,_jsx(_components.a,{href:`/composer/composer-api/guides/build-a-flow#wire-runtime-values`,children:`Wire runtime values`}),` and the `,_jsx(_components.a,{href:`/composer/composer-api/materialisers`,children:`materialisers catalog`}),`.`]}),`\n`,_jsx(_components.p,{children:`Amounts that depend on an earlier step, such as the shares a vault deposit mints, are read onchain during the transaction. The only amounts fixed at compile time are provider quotes.`}),`\n`,_jsx(Heading,{level:`2`,id:`amounts-on-the-response`,children:`Amounts on the response`}),`\n`,_jsxs(_components.p,{children:[`Every token output port has an entry in `,_jsx(_components.code,{children:`outputs`}),`, keyed `,_jsx(_components.code,{children:`\u003cnodeId>.\u003cport>`}),`, plus `,_jsx(_components.code,{children:`input.\u003cname>`}),` for unspent inputs. The SDK decodes amounts to `,_jsx(_components.code,{children:`bigint`}),`. `,_jsx(_components.a,{href:`/composer/composer-api/concepts/execution-model#the-compile-response`,children:`The compile response`}),` lists every response field; each `,_jsx(_components.code,{children:`outputs`}),` entry carries:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`role`})}),`: `,_jsx(_components.code,{children:`consumed`}),` (a later node, named in `,_jsx(_components.code,{children:`consumedBy`}),`, spends it) or `,_jsx(_components.code,{children:`terminal`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`owner`})}),` (terminal only): who holds the output after the flow. With `,_jsx(_components.code,{children:`sweepTo`}),` set to the signer, proxy-held terminals report the signer.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`delivery`})}),` (terminal only): `,_jsx(_components.code,{children:`{ when: \"now\" }`}),`, or `,_jsx(_components.code,{children:`{ when: \"future\", etaSeconds?, provider?, trackingId? }`}),` for an output that arrives later. See `,_jsx(_components.a,{href:`/composer/composer-api/concepts/resources-and-ports#future-resources`,children:`Future resources`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`amount.estimate`})}),`: the expected amount. `,_jsx(_components.code,{children:`basis: \"simulated\"`}),` when the simulation measured it, `,_jsx(_components.code,{children:`basis: \"quoted\"`}),` when it comes from a provider quote. Display it as “you will receive ≈ X”.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`amount.minimum`})}),`: the guaranteed floor, enforced onchain. `,_jsx(_components.code,{children:`basis`}),` says where it comes from: `,_jsx(_components.code,{children:`guard`}),` (a guard floor), `,_jsx(_components.code,{children:`op`}),` (the op’s own minimum, such as a swap’s `,_jsx(_components.code,{children:`minOut`}),`), `,_jsx(_components.code,{children:`input`}),` (an unspent input’s bound amount), or `,_jsx(_components.code,{children:`declared`}),` (a `,_jsx(_components.code,{children:`providesMinimum`}),` port’s estimate, used when no other floor exists). Display it as “you will receive `,_jsx(_components.strong,{children:`at least`}),` X”.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[_jsxs(_components.strong,{children:[`An absent `,_jsx(_components.code,{children:`minimum`}),` means no floor exists.`]}),` There is no zero placeholder: an unguarded split output reports only an estimate. When a guard floor and an op floor both exist, the larger wins; see `,_jsx(_components.a,{href:`/composer/composer-api/concepts/simulation-and-guards#guaranteed-minimums`,children:`Guaranteed minimums`}),`. On a 206 (allow-revert) response nothing was measured, so estimates are quoted and floors come only from ops and inputs.`]}),`\n`,_jsxs(_components.p,{children:[`For a `,_jsx(_components.code,{children:`continuation.settle`}),` output, `,_jsx(_components.code,{children:`minimum`}),` is the minimum received, which the settlement contract checks onchain, and `,_jsx(_components.code,{children:`estimate`}),` is an expected outcome that is never enforced; see `,_jsx(_components.a,{href:`/composer/composer-api/concepts/cross-chain-flows`,children:`Cross-chain flows`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`epilogue`}),` block on a 200 response reports each named forward with its `,_jsx(_components.code,{children:`resource`}),`, `,_jsx(_components.code,{children:`to`}),` and measured `,_jsx(_components.code,{children:`amount`}),`, and the resolved `,_jsx(_components.code,{children:`remainder`}),` address. The remainder itself is not measured; it shows up in `,_jsx(_components.code,{children:`outputs`}),` only as the new `,_jsx(_components.code,{children:`owner`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`see-also`,children:`See also`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/composer/composer-api/concepts/simulation-and-guards`,children:`Simulation and guards`}),`: where guard floors come from.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/composer/composer-api/concepts/execution-model#the-compile-response`,children:`Execution Model`}),`: every field of the compile response.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/composer/composer-api/concepts/cross-chain-flows`,children:`Cross-chain flows`}),`: outputs that land later, from an escrow.`]}),`\n`]})]})}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":{"codeStyling":"system","config":{},"pageMetadata":{"title":"Terminal Resources","description":"Terminal resources, the flow epilogue and sweepTo, and how estimates and floors are reported on the response.","href":"/composer/composer-api/concepts/sweeping-and-amounts"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Terminal resources","slug":"terminal-resources","depth":2,"children":[]},{"title":"The flow epilogue","slug":"the-flow-epilogue","depth":2,"children":[{"title":"Set the epilogue from the SDK","slug":"set-the-epilogue-from-the-sdk","depth":3,"children":[]}]},{"title":"sweepTo","slug":"sweepto","depth":2,"children":[{"title":"Non-transferable terminal resources","slug":"non-transferable-terminal-resources","depth":3,"children":[]}]},{"title":"Supplying input amounts","slug":"supplying-input-amounts","depth":2,"children":[]},{"title":"Amounts on the response","slug":"amounts-on-the-response","depth":2,"children":[]},{"title":"See also","slug":"see-also","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/lifi/951d8dd0c2dbce84/plausible.js","/_mintlify/custom/lifi/8e3c41579c236ea7/scripts/translate-docs.js","/_mintlify/custom/lifi/b34903975490ec23/scripts/generate-md-redirects.js","/_mintlify/custom/lifi/516472b23ab068ad/scripts/check-links.js","/_mintlify/custom/lifi/70364f7a7384bb43/scripts/markdown-chunker.js","/_mintlify/custom/lifi/faea2bc1c5ee8be7/scripts/translation-config.js","/_mintlify/custom/lifi/8f88293865b45873/scripts/verify-translation-coverage.js"],"subdomain":"lifi","siteName":"LI.FI","title":"Terminal Resources - LI.FI","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/composer/composer-api/concepts/sweeping-and-amounts","matchLevel":0},"zh-Hans":{"href":"/zh-Hans/composer/composer-api/concepts/sweeping-and-amounts","matchLevel":1}}},"lastModified":"2026-11-12T15:02:05.813Z","originalFileLocation":"composer/composer-api/concepts/sweeping-and-amounts.mdx","locale":"en"},"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=\"dark\"}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=\"Terminal resources, the flow epilogue and sweepTo, and how estimates and floors are reported on the response.\">\u003cmeta data-mint-head name=\"application-name\" content=\"LI.FI\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/lifi/uhSlA1vHRUBoEVMw/_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/lifi/uhSlA1vHRUBoEVMw/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/lifi/uhSlA1vHRUBoEVMw/_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/lifi/uhSlA1vHRUBoEVMw/_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/lifi/uhSlA1vHRUBoEVMw/_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/lifi/uhSlA1vHRUBoEVMw/_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/lifi/uhSlA1vHRUBoEVMw/_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/lifi/uhSlA1vHRUBoEVMw/_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/lifi/uhSlA1vHRUBoEVMw/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Terminal Resources - LI.FI\">\u003cmeta data-mint-head property=\"og:description\" content=\"Terminal resources, the flow epilogue and sweepTo, and how estimates and floors are reported on the response.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"LI.FI\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.li.fi/composer/composer-api/concepts/sweeping-and-amounts\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://lifi.mintlify.site/_mintlify/api/og/v2?division=Concepts\u0026amp;title=Terminal+Resources\u0026amp;description=Terminal+resources%2C+the+flow+epilogue+and+sweepTo%2C+and+how+estimates+and+floors+are+reported+on+the+response.\u0026amp;theme=d2a96653fbdd3b58627ba1f7\u0026amp;signature=cb81f8a65704f2a1eb7305ee122825b2d9ed3e2dd807e2a7d068d7ff13de12e0\">\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=\"Terminal Resources - LI.FI\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Terminal resources, the flow epilogue and sweepTo, and how estimates and floors are reported on the response.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://lifi.mintlify.site/_mintlify/api/og/v2?division=Concepts\u0026amp;title=Terminal+Resources\u0026amp;description=Terminal+resources%2C+the+flow+epilogue+and+sweepTo%2C+and+how+estimates+and+floors+are+reported+on+the+response.\u0026amp;theme=d2a96653fbdd3b58627ba1f7\u0026amp;signature=cb81f8a65704f2a1eb7305ee122825b2d9ed3e2dd807e2a7d068d7ff13de12e0\">\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/lifi/uhSlA1vHRUBoEVMw/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"LI.FI\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#5C67FF\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.li.fi/composer/composer-api/concepts/sweeping-and-amounts\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/composer/composer-api/concepts/sweeping-and-amounts.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://docs.li.fi/composer/composer-api/concepts/sweeping-and-amounts\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh-Hans\" href=\"https://docs.li.fi/zh-Hans/composer/composer-api/concepts/sweeping-and-amounts\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://docs.li.fi/composer/composer-api/concepts/sweeping-and-amounts\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.li.fi/#organization\",\"name\":\"LI.FI\",\"url\":\"https://docs.li.fi\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/lifi/EmProAEgMrruLUbI/logo/light.png?fit=max\u0026auto=format\u0026n=EmProAEgMrruLUbI\u0026q=85\u0026s=f435348680e682acea6e3b9af339ed7a\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.li.fi#website\",\"name\":\"LI.FI\",\"url\":\"https://docs.li.fi\",\"publisher\":{\"@id\":\"https://docs.li.fi/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.li.fi/composer/composer-api/concepts/sweeping-and-amounts#webpage\",\"url\":\"https://docs.li.fi/composer/composer-api/concepts/sweeping-and-amounts\",\"name\":\"Terminal Resources\",\"description\":\"Terminal resources, the flow epilogue and sweepTo, and how estimates and floors are reported on the response.\",\"dateModified\":\"2026-11-12T15:02:05.813Z\",\"isPartOf\":{\"@id\":\"https://docs.li.fi#website\"},\"breadcrumb\":{\"@id\":\"https://docs.li.fi/composer/composer-api/concepts/sweeping-and-amounts#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.li.fi/composer/composer-api/concepts/sweeping-and-amounts#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Integrate via Composer API\",\"item\":\"https://docs.li.fi/composer/composer-api/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Concepts\",\"item\":\"https://docs.li.fi/composer/composer-api/concepts/flow-anatomy\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Terminal Resources\",\"item\":\"https://docs.li.fi/composer/composer-api/concepts/sweeping-and-amounts\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.li.fi/composer/composer-api/concepts/sweeping-and-amounts#article\",\"headline\":\"Terminal Resources\",\"name\":\"Terminal Resources\",\"description\":\"Terminal resources, the flow epilogue and sweepTo, and how estimates and floors are reported on the response.\",\"url\":\"https://docs.li.fi/composer/composer-api/concepts/sweeping-and-amounts\",\"mainEntityOfPage\":{\"@id\":\"https://docs.li.fi/composer/composer-api/concepts/sweeping-and-amounts#webpage\"},\"dateModified\":\"2026-11-12T15:02:05.813Z\",\"publisher\":{\"@id\":\"https://docs.li.fi/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.li.fi#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"LI.FI\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"LI.FI\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/composer/composer-api/concepts/sweeping-and-amounts.md","siteName":"LI.FI","nav":{"global":null,"languages":[{"language":"en","tabs":[{"tab":"Overview","pages":[{"title":"Overview","href":"/introduction/introduction"}]},{"tab":"Enterprise (New)","pages":[{"title":"Enterprise (New)","href":"/enterprise/overview"}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/introduction"}]},{"tab":"SDK","pages":[{"title":"SDK","href":"/sdk/overview"}]},{"tab":"Widget","pages":[{"title":"Widget","href":"/widget/overview"}]},{"tab":"Composer","groups":[{"group":"Introduction","pages":[{"title":"Overview","href":"/composer/overview"},{"title":"Composer 101","href":"/composer/composer-101"}]},{"group":"Integrate via Composer API","pages":[{"title":"Overview","href":"/composer/composer-api/overview"},{"group":"Integration Guides","pages":[{"title":"Quickstart","href":"/composer/composer-api/quickstart"},{"title":"Build a same-chain flow","href":"/composer/composer-api/guides/build-a-flow"},{"title":"Build a cross-chain flow","href":"/composer/composer-api/guides/build-a-cross-chain-flow"}]},{"group":"Concepts","pages":[{"title":"Flow Structure","href":"/composer/composer-api/concepts/flow-anatomy"},{"title":"Resource Model","href":"/composer/composer-api/concepts/resources-and-ports"},{"title":"References","href":"/composer/composer-api/concepts/ref-grammar"},{"title":"Execution Model","href":"/composer/composer-api/concepts/execution-model"},{"title":"Guards","description":"How Composer simulates a flow before returning calldata, and how guards turn simulated values into checks enforced onchain.","href":"/composer/composer-api/concepts/simulation-and-guards"},{"title":"Terminal Resources","href":"/composer/composer-api/concepts/sweeping-and-amounts"},{"title":"Cross-chain flows","description":"Sign once on one chain and end up with a position on another. The source flow runs in the user's transaction; the destination flow runs later, from an escrow, once the funds arrive. The same mechanism also runs a destination flow later on the same chain.","href":"/composer/composer-api/concepts/cross-chain-flows"}]},{"group":"Recipes","pages":[{"title":"Overview","href":"/composer/composer-api/recipes/index"},{"title":"Swap and deposit","href":"/composer/composer-api/recipes/swap-and-deposit"},{"title":"Split a deposit across vaults","href":"/composer/composer-api/recipes/split-deposit"},{"title":"Deposit with a server-planned route","href":"/composer/composer-api/recipes/server-planned-route"},{"title":"Add liquidity on Uniswap","href":"/composer/composer-api/recipes/uniswap-liquidity"},{"title":"Consolidate tokens into USDC","href":"/composer/composer-api/recipes/consolidate-to-usdc"},{"title":"Bridge and deposit with one signature","sidebarTitle":"Bridge and deposit","href":"/composer/composer-api/recipes/bridge-and-deposit"},{"title":"Pay cross-chain","href":"/composer/composer-api/recipes/pay-cross-chain"}]},{"group":"Reference","pages":[{"title":"Flow Schema","href":"/composer/composer-api/reference/flow-wire-format"},{"title":"SDK Reference","href":"/composer/composer-api/reference/sdk-api"},{"title":"Errors","href":"/composer/composer-api/reference/error-codes"},{"title":"Addresses","href":"/composer/composer-api/reference/addresses"},{"title":"Escrow status","href":"/composer/composer-api/reference/escrow-status"},{"title":"Release notes and migration","href":"/composer/composer-api/reference/release-notes"},{"group":"Ops","pages":[{"title":"Op catalog","href":"/composer/composer-api/ops/index"},{"group":"Same-chain","pages":[{"title":"lifi.swap","href":"/composer/composer-api/ops/lifi-swap"},{"title":"lifi.zap","href":"/composer/composer-api/ops/lifi-zap"},{"title":"core.call","href":"/composer/composer-api/ops/core-call"}]},{"group":"Cross-chain","pages":[{"title":"lifi.bridge","href":"/composer/composer-api/ops/lifi-bridge"},{"title":"lifiIntents.order","href":"/composer/composer-api/ops/lifi-intents-order"},{"title":"continuation.settle","href":"/composer/composer-api/ops/continuation-settle"}]}]},{"group":"Materialisers","pages":[{"title":"Materialisers catalog","href":"/composer/composer-api/materialisers/index"},{"title":"balanceOf","href":"/composer/composer-api/materialisers/balance-of"},{"title":"call","href":"/composer/composer-api/materialisers/call"},{"title":"directDeposit","href":"/composer/composer-api/materialisers/direct-deposit"}]},{"group":"Guard Types","pages":[{"title":"Guards catalog","href":"/composer/composer-api/guards/index"},{"title":"slippage","href":"/composer/composer-api/guards/slippage"},{"title":"band","href":"/composer/composer-api/guards/band"},{"title":"core.numericInvariant","href":"/composer/composer-api/guards/numeric-invariant"}]}]}]},{"group":"Integrate via LI.FI API","pages":[{"title":"Overview","href":"/composer/lifi-api/overview"},{"group":"Integration Guides","pages":[{"title":"Quickstart","href":"/composer/lifi-api/quickstart"},{"title":"API Integration","href":"/composer/lifi-api/guides/api-integration"},{"title":"SDK Integration","href":"/composer/lifi-api/guides/sdk-integration"},{"title":"Widget Integration","href":"/composer/lifi-api/guides/widget-integration"},{"title":"Cross-chain deposits","href":"/composer/lifi-api/guides/cross-chain-compose"},{"title":"Withdrawals","href":"/composer/lifi-api/guides/withdrawals"},{"title":"Deposit Examples","href":"/composer/lifi-api/recipes/vault-deposits"}]},{"group":"Reference","pages":[{"title":"API Parameters","href":"/composer/lifi-api/reference/api-parameters"},{"title":"Error Handling","href":"/composer/lifi-api/reference/error-handling"},{"title":"Limitations","href":"/composer/lifi-api/reference/limitations"}]}]},{"group":"Resources","pages":[{"title":"Supported Protocols \u0026 Chains","href":"/composer/protocols-and-chains"},{"title":"New Protocol Onboarding","href":"/composer/for-protocols/integration-guide"},{"title":"Permissioned Products \u0026 Compliance","href":"/composer/permissioned-products-and-compliance"}]}]},{"tab":"Earn","pages":[{"title":"Earn","href":"/earn/overview"}]},{"tab":"Perps","pages":[{"title":"Perps","href":"/perps/overview"}]},{"tab":"Intents \u0026 Solvers","pages":[{"title":"Intents \u0026 Solvers","href":"/lifi-intents/introduction"}]},{"tab":"For Agents","pages":[{"title":"For Agents","href":"/agents/overview"}]},{"tab":"Widget Playground","href":"https://playground.li.fi/"},{"tab":"Bigmi","pages":[{"title":"Bigmi","href":"/bigmi/overview"}]},{"tab":"Guides","pages":[{"title":"Guides","href":"/guides/gas-options"}]},{"tab":"FAQs","pages":[{"title":"FAQs","href":"/faqs/fees-monetization"}]}]},{"language":"zh-Hans","pages":[{"title":"zh-Hans","href":"/zh-Hans/composer/composer-api/concepts/sweeping-and-amounts"}]}]},"basePath":"","title":"Terminal Resources - LI.FI","deploymentId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","buildId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","dynamics":[],"chunks":[]}