Build a deposit transaction
Builds an unsigned deposit transaction for the customer's wallet to sign.
POST/
Nothing moves until you submit the signed transaction. The build applies provider access checks and can name your own feePayer, which then signs alongside the customer. A swap-funded deposit that cannot fit in one transaction returns a separate swap and follow-up deposit instead of transaction, so check the response before you request a signature.
Requires an API key with the earn.execute action.
Headers
-
x-project-id·string· min length 1 · exampleprj_exampleRequired for dashboard sessions. API keys use their assigned project.
Request body
application/json · required
Build one unsigned deposit transaction for an external wallet.
-
strategyId·string· required · min length 1 · exampleearn_strategy_3b6a81ce-00b0-4c5a-9761-cb359932e97e -
ownerAddress·string· required · min length 32 · max length 44 · pattern^[1-9A-HJ-NP-Za-km-z]{32,44}$· example9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWMThe customer's wallet address: an external wallet, so SDP holds no key for it. It signs, owns the shares, and pays the network fee unless the build names a
feePayer. It must decode to a 32-byte public key; a base58 string that matches the pattern but does not decode returns 400. -
feePayer·string· min length 32 · max length 44 · pattern^[1-9A-HJ-NP-Za-km-z]{32,44}$· example3nMFwZXwY1s1M5s8vYAHqd4wGs4iSxXE4LRoUMMYqEgFPay for this transaction from a wallet your backend controls instead of the customer's. The named address becomes the fee payer: it pays the network fee, funds any share-account rent, and must sign alongside the customer. Co-sign on your backend before you submit. The build returns 400, naming the fee payer, when it cannot pay. Sending the customer's own address keeps the default: the customer pays and signs alone.
-
amount·string· required · max length 128 · pattern^(?=.*[1-9])\d+(\.\d+)?$· example25The deposit amount as a decimal string, in deposit-token units. For a swap-funded build (
sourceTokenMint), it is in source-token units instead: the swap spends all of it, and the deposit is sized to the swap's guaranteed output. -
minSharesOut·string· max length 128 · pattern^(?=.*[1-9])\d+(\.\d+)?$· example24.9Slippage floor in share units. Required exactly when the selected strategy's
depositSlippageis non-null. Derive it fromPOST /v1/earn/vault-deposit-previews, never from the deposit amount. -
sourceTokenMint·string· min length 32 · max length 44 · pattern^[1-9A-HJ-NP-Za-km-z]{32,44}$· example2b1kV6DkPAnxd5ixfnxCpjxmKwqjjaYmCZfHsFu24GXoFund the deposit in a different supported stablecoin (USDC, USDG, PYUSD or USDT on the environment's cluster): a Jupiter swap to the vault's own token is prepended inside the same transaction, so both legs land atomically or not at all. Equal to the strategy's deposit mint it is a no-op, so pickers may always send their selection.
-
swapSlippageBps·integer· min 1 · max 500 · example2Swap slippage tolerance in basis points (default 2, accepted 1-500). Valid only with
sourceTokenMint. The deposit is sized to the swap's worst-case output, so a wider tolerance can leave more of the deposit token in the customer's account instead of failing the transaction.
Responses
-
200Unsigned deposit transaction-
data·object· requiredAny of:
-
object
-
transaction·object· requiredThe built deposit transaction plus the strategy it targets.
-
transactionId·string· required · exampleearn_external_wallet_transaction_e7a88258-1d19-48f3-8d0e-81fefa4bf3b3 -
transaction·string· requiredBase64 wire bytes of the unsigned transaction. Add every required signature without changing the message, then submit through SDP. The blockhash bounds when the network can first accept it; retain the original signed bytes for recovery.
-
lastValidBlockHeight·string· required · example361186610Last block height at which the network can first accept this transaction. This is a block height, not a slot or timestamp.
-
sponsored·boolean· required · examplefalseAlways false: SDP does not pay an external wallet's fees. The customer's wallet pays, or the
feePayeryou name. -
ownerAddress·string· required · example9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWMThe customer's wallet address.
-
feePayer·string· example3nMFwZXwY1s1M5s8vYAHqd4wGs4iSxXE4LRoUMMYqEgFThe
feePayeryour build request named. When present, the transaction needs the fee payer's signature as well as the customer's: co-sign on your backend before you submit, or the submit refuses it. When omitted, the customer signs alone and pays the fee. -
provider·string· required · examplekamino -
providerReference·string· required · example7uib8xGAwkaPz4ZGCA6t8sSEid5Yp9ty13PHUweTypxThe strategy's onchain address at the provider. It identifies the instrument; never send funds to it.
-
tokenMint·string· required · example4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU -
shareMint·string· required · examplehXm2xSRF5PLKGMrTvAWqKhR76MuJX5dAabeSChkjqu2 -
amount·string· required · max length 128 · pattern^(?=.*[1-9])\d+(\.\d+)?$· example25Positive decimal string with at least one non-zero digit; never a float.
-
minSharesOut·string | null· required · max length 128 · pattern^(?=.*[1-9])\d+(\.\d+)?$· example25Positive decimal string with at least one non-zero digit; never a float.
-
swap·objectPresent when the build was swap-funded: the swap is prepended inside this same transaction and
amountequalsswap.depositAmount.-
sourceTokenMint·string· required · min length 32 · max length 44 · pattern^[1-9A-HJ-NP-Za-km-z]{32,44}$· example2b1kV6DkPAnxd5ixfnxCpjxmKwqjjaYmCZfHsFu24GXoMint the owner pays with.
-
sourceAmount·string· required · max length 128 · pattern^(?=.*[1-9])\d+(\.\d+)?$· example25What the swap spends, in source-token units.
-
depositAmount·string· required · max length 128 · pattern^(?=.*[1-9])\d+(\.\d+)?$· example25The deposit amount the transaction encodes, in deposit-token units: the swap's guaranteed minimum output. Any output above it stays in the customer's token account.
-
quotedAmount·string· required · max length 128 · pattern^(?=.*[1-9])\d+(\.\d+)?$· example25The swap's quoted output at the live rate, in deposit-token units.
-
slippageBps·integer· required · example2 -
priceImpactPct·string· required · example0.0001Quoted price impact as a decimal ratio string.
-
routeLabels·string[]· requiredVenue labels along the quoted route.
-
-
strategy·object· required-
id·string· required · exampleearn_strategy_3b6a81ce-00b0-4c5a-9761-cb359932e97e -
name·string· required · exampleAllez USDC -
provider·string· required · examplekamino -
providerReference·string· required · example7uib8xGAwkaPz4ZGCA6t8sSEid5Yp9ty13PHUweTypx -
hostCluster·string· required · exampledevnet
-
-
-
-
Returned instead of a built transaction when the swap and the deposit cannot fit in one Solana transaction (1,232 bytes), even on a compact route. SDP saves no build or movement for it.
-
requiresSeparateSwap·boolean· required · alwaystrueDiscriminates from the atomic answer, which carries
transaction. -
sponsored·boolean· required · alwaysfalseSplit swap transactions are never sponsored by SDP.
-
swap·object· requiredThe Jupiter swap leg attached to (or split out of) a swap-funded deposit.
-
sourceTokenMint·string· required · min length 32 · max length 44 · pattern^[1-9A-HJ-NP-Za-km-z]{32,44}$· example2b1kV6DkPAnxd5ixfnxCpjxmKwqjjaYmCZfHsFu24GXoMint the owner pays with.
-
sourceAmount·string· required · max length 128 · pattern^(?=.*[1-9])\d+(\.\d+)?$· example25What the swap spends, in source-token units.
-
depositAmount·string· required · max length 128 · pattern^(?=.*[1-9])\d+(\.\d+)?$· example25The deposit amount the transaction encodes, in deposit-token units: the swap's guaranteed minimum output. Any output above it stays in the customer's token account.
-
quotedAmount·string· required · max length 128 · pattern^(?=.*[1-9])\d+(\.\d+)?$· example25The swap's quoted output at the live rate, in deposit-token units.
-
slippageBps·integer· required · example2 -
priceImpactPct·string· required · example0.0001Quoted price impact as a decimal ratio string.
-
routeLabels·string[]· requiredVenue labels along the quoted route.
-
transaction·string· requiredBase64 wire bytes of the unsigned swap-only transaction. The fee payer is the customer, or your request's
feePayer, which then co-signs it too. You broadcast it yourself: it moves only the customer's own funds, so SDP records nothing for it. -
lastValidBlockHeight·string· required · example361186610
-
-
followUp·object· requiredThe ordinary (unswapped) deposit build to request once the swap is confirmed.
-
strategyId·string· required · exampleearn_strategy_3b6a81ce-00b0-4c5a-9761-cb359932e97e -
amount·string· required · max length 128 · pattern^(?=.*[1-9])\d+(\.\d+)?$· example25Positive decimal string with at least one non-zero digit; never a float.
-
minSharesOut·string· max length 128 · pattern^(?=.*[1-9])\d+(\.\d+)?$· example25The original request's share floor, carried through so the follow-up build keeps the protection the caller asked for. Absent only when the original request carried none.
-
feePayer·string· example3nMFwZXwY1s1M5s8vYAHqd4wGs4iSxXE4LRoUMMYqEgFThe original request's fee payer, carried through so the follow-up build does not silently bill the customer's wallet. Absent when none was named.
-
-
-
-
meta·object· requiredResponse metadata.
-
requestId·string· required · min length 1 · examplereq_exampleRequest identifier for tracing.
-
timestamp·string· required · formatdate-time· example2025-01-01T00:00:00.000ZISO 8601 timestamp.
-
-
-
400Bad Request-
error·object· requiredStandard error payload.
-
code·string· requiredMachine-readable error code.
-
message·string· requiredHuman-readable error message.
-
details·objectOptional error details for debugging.
*·any
-
-
meta·object-
requestId·string· min length 1 · examplereq_exampleRequest identifier for tracing.
-
-
-
401UnauthorizedSame fields as
400. -
403Forbidden. Requires theearn.executeaction: an API key must hold it (a module'smanageorexecutealso covers itsread), and a signed-in member's organization role must include it. Without it the error is INSUFFICIENT_PERMISSIONS anderror.details.actionnames the action. Any other 403 names its own reason.Same fields as
400. -
404Not FoundSame fields as
400. -
429Too Many RequestsSame fields as
400. -
500Internal Server ErrorSame fields as
400. -
501The provider does not support this operation.-
error·object· requiredStandard error payload.
-
code·string· required -
message·string· requiredHuman-readable error message.
-
details·objectOptional error details for debugging.
*·any
-
-
meta·object-
requestId·string· min length 1 · examplereq_exampleRequest identifier for tracing.
-
-
-
503Service UnavailableSame fields as
400.