Cross-Program Invocation integration with Ranger Earn vaults
This guide covers Cross-Program Invocation (CPI) integration with the Ranger Earn Vault program. If your protocol needs to deposit into or withdraw from Ranger Earn vaults on-chain, use these CPI instructions.
When to use CPI vs. the TypeScript SDK: CPI is for on-chain programs that need to interact with Ranger Earn vaults programmatically (e.g., a router or aggregator). If you are building off-chain automation or a frontend, use the TypeScript SDK instead.
How It Works
Users deposit assets into a vault and receive LP tokens representing their share. Withdrawals follow a two-step process to ensure vault stability and manage liquidity:
Request withdrawal — locks LP tokens into an escrow receipt
Claim withdrawal — after the vault’s waiting period, burns the locked LP tokens and returns the underlying assets
Alternatively, vaults with a zero waiting period support instant withdrawal, which combines both steps into a single transaction. Users can also cancel a pending withdrawal request to reclaim their LP tokens.
Deposit: User Assets ──► Vault ──► LP Tokens to UserWithdraw: LP Tokens ──► Escrow Receipt ──(waiting period)──► Assets to UserCancel Withdraw: Escrow Receipt ──► LP Tokens back to UserInstant Withdraw: LP Tokens ──► Assets to User (single transaction)
Your program does not need to provide PDA signer seeds for the vault’s internal PDAs. The Ranger Earn Vault program handles its own invoke_signed calls internally. You only need to pass the correct PDA addresses in the account list.
Error Handling
Your program should handle the following errors from the Ranger Earn Vault program:
Error
Cause
InvalidAmount
Input amount is zero or invalid
MaxCapExceeded
Deposit would exceed the vault’s maximum capacity
WithdrawalNotYetAvailable
withdraw_vault called before the waiting period has passed
InstantWithdrawNotAllowed
instant_withdraw_vault called on a vault with a non-zero waiting period
OperationNotAllowed
The protocol has globally disabled the attempted operation
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Ranger Earn Documentation","colors":{"primary":"#668060","light":"#B7E5AD","dark":"#51664D"},"logo":{"light":"https://mintcdn.com/ranger-1fe08bd5/6ympMvKValzT3itD/logo/light.svg?fit=max\u0026auto=format\u0026n=6ympMvKValzT3itD\u0026q=85\u0026s=8e9cefa54a7589d369242c7f0794bf6f","dark":"https://mintcdn.com/ranger-1fe08bd5/6ympMvKValzT3itD/logo/dark.svg?fit=max\u0026auto=format\u0026n=6ympMvKValzT3itD\u0026q=85\u0026s=46b472cc46f92301d70b66bb556ad08a"},"favicon":"https://mintcdn.com/ranger-1fe08bd5/_VoJGCuYTYavLBFr/favicon.ico?fit=max\u0026auto=format\u0026n=_VoJGCuYTYavLBFr\u0026q=85\u0026s=eb6682e3247fdd30ef0b60ce36f1d805","navbar":{"links":[{"href":"mailto:support@voltr.xyz","label":"Support"}],"primary":{"type":"button","label":"Launch App","href":"https://app.ranger.finance/earn"}},"footer":{"socials":{"x":"https://x.com/ranger_finance","github":"https://github.com/ranger-finance"}},"styling":{"latex":false},"navigation":{"global":{},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"ranger-1fe08bd5","hasAudioNarration":false,"actualSubdomain":"ranger-1fe08bd5","customDomains":["docs.ranger.finance"],"gitSource":{"type":"github","owner":"ranger-finance","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":"","_id":"6b10d90e9ffae5051c40e519"},"entitlements":{},"buildId":"6ae9499da0daa1d41e0328d4:success","clientVersion":"0.0.4458","searchFilterCounts":[{"language":"default","tag":"Vault Managers","count":26},{"language":"default","tag":"Documentation","count":23},{"language":"default","tag":"For Users","count":14},{"language":"default","tag":"Curated Vaults","count":12},{"language":"default","tag":"Security","count":8},{"language":"default","tag":"Getting Started","count":6},{"language":"default","tag":"Composing Protocols","count":6},{"language":"default","tag":"CPI Integration","count":6},{"language":"default","tag":"Strategies \u0026 Allocation","count":5},{"language":"default","tag":"Vault Setup (SDK)","count":5}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":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":"control","enabled":true,"payload":{"type":"string","value":"control"},"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":"protocols/cpi-integration","slug":"/protocols/cpi-integration","pageMetadata":{"title":"CPI Integration Guide","description":"Cross-Program Invocation integration with Ranger Earn vaults","href":"/protocols/cpi-integration/index"},"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: \"Cross-Program Invocation integration with Ranger Earn vaults\"\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`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Info,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`This guide covers Cross-Program Invocation (CPI) integration with the Ranger Earn Vault program. If your protocol needs to deposit into or withdraw from Ranger Earn vaults on-chain, use these CPI instructions.`}),`\n`,_jsx(Info,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`When to use CPI vs. the TypeScript SDK`}),`: CPI is for on-chain programs that need to interact with Ranger Earn vaults programmatically (e.g., a router or aggregator). If you are building off-chain automation or a frontend, use the `,_jsx(_components.a,{href:`https://voltrxyz.github.io/vault-sdk/`,children:`TypeScript SDK`}),` instead.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`how-it-works`,children:`How It Works`}),`\n`,_jsxs(_components.p,{children:[`Users deposit assets into a vault and receive LP tokens representing their share. Withdrawals follow a `,_jsx(_components.strong,{children:`two-step process`}),` to ensure vault stability and manage liquidity:`]}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Request withdrawal`}),` — locks LP tokens into an escrow receipt`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Claim withdrawal`}),` — after the vault’s waiting period, burns the locked LP tokens and returns the underlying assets`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Alternatively, vaults with a zero waiting period support `,_jsx(_components.strong,{children:`instant withdrawal`}),`, which combines both steps into a single transaction. Users can also `,_jsx(_components.strong,{children:`cancel`}),` a pending withdrawal request to reclaim their LP tokens.`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`8`,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:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Deposit: User Assets ──► Vault ──► LP Tokens to User`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Withdraw: LP Tokens ──► Escrow Receipt ──(waiting period)──► Assets to User`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Cancel Withdraw: Escrow Receipt ──► LP Tokens back to User`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Instant Withdraw: LP Tokens ──► Assets to User (single transaction)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`deployed-address`,children:`Deployed Address`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Network`}),_jsx(_components.th,{children:`Program Address`})]})}),_jsx(_components.tbody,{children:_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Mainnet`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`vVoLTRjQmtFpiYoegx285Ze4gsLJ8ZxgFKVcuvmG1a8`})})]})})]}),`\n`,_jsx(Heading,{level:`2`,id:`cpi-instructions`,children:`CPI Instructions`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Instruction`}),_jsx(_components.th,{children:`Purpose`}),_jsx(_components.th,{children:`Reference`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`deposit_vault`})}),_jsx(_components.td,{children:`Deposit assets and receive LP tokens`}),_jsx(_components.td,{children:_jsx(_components.a,{href:`/protocols/cpi-integration/deposit`,children:`Deposit`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`request_withdraw_vault`})}),_jsx(_components.td,{children:`Lock LP tokens into an escrow receipt`}),_jsx(_components.td,{children:_jsx(_components.a,{href:`/protocols/cpi-integration/request-withdraw`,children:`Request Withdraw`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`withdraw_vault`})}),_jsx(_components.td,{children:`Claim assets after the waiting period`}),_jsx(_components.td,{children:_jsx(_components.a,{href:`/protocols/cpi-integration/withdraw`,children:`Withdraw`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`cancel_request_withdraw_vault`})}),_jsx(_components.td,{children:`Cancel a pending withdrawal request`}),_jsx(_components.td,{children:_jsx(_components.a,{href:`/protocols/cpi-integration/cancel-withdraw`,children:`Cancel Withdraw`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`instant_withdraw_vault`})}),_jsx(_components.td,{children:`Withdraw assets instantly (zero waiting period vaults)`}),_jsx(_components.td,{children:_jsx(_components.a,{href:`/protocols/cpi-integration/instant-withdraw`,children:`Instant Withdraw`})})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`pda-derivation`,children:`PDA Derivation`}),`\n`,_jsxs(_components.p,{children:[`All PDAs are derived from the Ranger Earn Vault program (`,_jsx(_components.code,{children:`vVoLTRjQmtFpiYoegx285Ze4gsLJ8ZxgFKVcuvmG1a8`}),`):`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Account`}),_jsx(_components.th,{children:`Seeds`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`protocol`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`[\"protocol\"]`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`vault_asset_idle_auth`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`[\"vault_asset_idle_auth\", vault_key]`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`vault_lp_mint_auth`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`[\"vault_lp_mint_auth\", vault_key]`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`request_withdraw_vault_receipt`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`[\"request_withdraw_vault_receipt\", vault_key, user_key]`})})]})]})]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Your program does `,_jsx(_components.strong,{children:`not`}),` need to provide PDA signer seeds for the vault’s internal PDAs. The Ranger Earn Vault program handles its own `,_jsx(_components.code,{children:`invoke_signed`}),` calls internally. You only need to pass the correct PDA addresses in the account list.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`error-handling`,children:`Error Handling`}),`\n`,_jsx(_components.p,{children:`Your program should handle the following errors from the Ranger Earn Vault program:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Error`}),_jsx(_components.th,{children:`Cause`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`InvalidAmount`})}),_jsx(_components.td,{children:`Input amount is zero or invalid`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`MaxCapExceeded`})}),_jsx(_components.td,{children:`Deposit would exceed the vault’s maximum capacity`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`WithdrawalNotYetAvailable`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`withdraw_vault`}),` called before the waiting period has passed`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`InstantWithdrawNotAllowed`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`instant_withdraw_vault`}),` called on a vault with a non-zero waiting period`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`OperationNotAllowed`})}),_jsx(_components.td,{children:`The protocol has globally disabled the attempted operation`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`reference-repository`,children:`Reference Repository`}),`\n`,_jsxs(_components.p,{children:[`Full reference implementations are available at `,_jsx(_components.a,{href:`https://github.com/voltrxyz/vault-cpi`,children:`github.com/voltrxyz/vault-cpi`}),`.`]})]})}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":"CPI Integration Guide","description":"Cross-Program Invocation integration with Ranger Earn vaults","href":"/protocols/cpi-integration/index"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"How It Works","slug":"how-it-works","depth":2,"children":[]},{"title":"Deployed Address","slug":"deployed-address","depth":2,"children":[]},{"title":"CPI Instructions","slug":"cpi-instructions","depth":2,"children":[]},{"title":"PDA Derivation","slug":"pda-derivation","depth":2,"children":[]},{"title":"Error Handling","slug":"error-handling","depth":2,"children":[]},{"title":"Reference Repository","slug":"reference-repository","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"ranger-1fe08bd5","siteName":"Ranger Earn Documentation","title":"CPI Integration Guide - Ranger Earn Documentation","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-03-13T11:41:34.940Z","originalFileLocation":"protocols/cpi-integration/index.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=\"Cross-Program Invocation integration with Ranger Earn vaults\">\u003cmeta data-mint-head name=\"application-name\" content=\"Ranger Earn 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/ranger-1fe08bd5/3Oqo2FKB6duD5sZ5/_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/ranger-1fe08bd5/3Oqo2FKB6duD5sZ5/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/ranger-1fe08bd5/3Oqo2FKB6duD5sZ5/_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/ranger-1fe08bd5/3Oqo2FKB6duD5sZ5/_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/ranger-1fe08bd5/3Oqo2FKB6duD5sZ5/_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/ranger-1fe08bd5/3Oqo2FKB6duD5sZ5/_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/ranger-1fe08bd5/3Oqo2FKB6duD5sZ5/_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/ranger-1fe08bd5/3Oqo2FKB6duD5sZ5/_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/ranger-1fe08bd5/3Oqo2FKB6duD5sZ5/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"CPI Integration Guide - Ranger Earn Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Cross-Program Invocation integration with Ranger Earn vaults\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Ranger Earn Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.ranger.finance/protocols/cpi-integration\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://ranger-1fe08bd5.mintlify.site/_mintlify/api/og/v2?division=CPI+Integration\u0026amp;title=CPI+Integration+Guide\u0026amp;description=Cross-Program+Invocation+integration+with+Ranger+Earn+vaults\u0026amp;theme=2db4320f45403042f7bb0688\u0026amp;signature=bf86d8da7b72b0a9e53b0576be0f3a339299502a7f6e9a734b727033b71c0040\">\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=\"CPI Integration Guide - Ranger Earn Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Cross-Program Invocation integration with Ranger Earn vaults\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://ranger-1fe08bd5.mintlify.site/_mintlify/api/og/v2?division=CPI+Integration\u0026amp;title=CPI+Integration+Guide\u0026amp;description=Cross-Program+Invocation+integration+with+Ranger+Earn+vaults\u0026amp;theme=2db4320f45403042f7bb0688\u0026amp;signature=bf86d8da7b72b0a9e53b0576be0f3a339299502a7f6e9a734b727033b71c0040\">\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/ranger-1fe08bd5/3Oqo2FKB6duD5sZ5/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Ranger Earn Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#668060\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.ranger.finance/protocols/cpi-integration\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/protocols/cpi-integration.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.ranger.finance/#organization\",\"name\":\"Ranger Earn Documentation\",\"url\":\"https://docs.ranger.finance\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/ranger-1fe08bd5/6ympMvKValzT3itD/logo/light.svg?fit=max\u0026auto=format\u0026n=6ympMvKValzT3itD\u0026q=85\u0026s=8e9cefa54a7589d369242c7f0794bf6f\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.ranger.finance#website\",\"name\":\"Ranger Earn Documentation\",\"url\":\"https://docs.ranger.finance\",\"publisher\":{\"@id\":\"https://docs.ranger.finance/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.ranger.finance/protocols/cpi-integration#webpage\",\"url\":\"https://docs.ranger.finance/protocols/cpi-integration\",\"name\":\"CPI Integration Guide\",\"description\":\"Cross-Program Invocation integration with Ranger Earn vaults\",\"dateModified\":\"2026-03-13T11:41:34.940Z\",\"isPartOf\":{\"@id\":\"https://docs.ranger.finance#website\"},\"breadcrumb\":{\"@id\":\"https://docs.ranger.finance/protocols/cpi-integration#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.ranger.finance/protocols/cpi-integration#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Ranger Earn Documentation\",\"item\":\"https://docs.ranger.finance\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CPI Integration Guide\",\"item\":\"https://docs.ranger.finance/protocols/cpi-integration\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.ranger.finance/protocols/cpi-integration#article\",\"headline\":\"CPI Integration Guide\",\"name\":\"CPI Integration Guide\",\"description\":\"Cross-Program Invocation integration with Ranger Earn vaults\",\"url\":\"https://docs.ranger.finance/protocols/cpi-integration\",\"mainEntityOfPage\":{\"@id\":\"https://docs.ranger.finance/protocols/cpi-integration#webpage\"},\"dateModified\":\"2026-03-13T11:41:34.940Z\",\"publisher\":{\"@id\":\"https://docs.ranger.finance/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.ranger.finance#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Ranger Earn Documentation\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Ranger Earn Documentation\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/protocols/cpi-integration.md","siteName":"Ranger Earn Documentation","nav":{"global":{},"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":""}]},{"tab":"Vault Managers","pages":[{"title":"Vault Managers","href":"/vault-owners/overview"}]},{"tab":"Yield Protocols","pages":[{"title":"Yield Protocols","href":"/protocols/overview"}]},{"tab":"Composing Protocols","groups":[{"group":"CPI Integration","icon":"plug","pages":[{"title":"CPI Integration Guide","href":"/protocols/cpi-integration"},{"title":"Deposit","description":"CPI instruction to deposit assets into a Ranger Earn vault","href":"/protocols/cpi-integration/deposit"},{"title":"Request Withdraw","href":"/protocols/cpi-integration/request-withdraw"},{"title":"Withdraw","href":"/protocols/cpi-integration/withdraw"},{"title":"Instant Withdraw","href":"/protocols/cpi-integration/instant-withdraw"},{"title":"Cancel Request Withdraw","href":"/protocols/cpi-integration/cancel-withdraw"}]}]},{"tab":"Security","pages":[{"title":"Security","href":"/security/best-practices"}]}]},"basePath":"","title":"CPI Integration Guide - Ranger Earn Documentation","deploymentId":"dpl_HZVV42MMRSo9WnNHfTGZvby5jph9","buildId":"dpl_HZVV42MMRSo9WnNHfTGZvby5jph9","dynamics":[],"chunks":[]}