Skip to main content
Build a deposit returns an unsigned transaction. Sign it with the user’s wallet, then broadcast via your own RPC or optionally through POST /yield/broadcast.
1

Endpoint

POST /yield/deposit
ParameterTypeRequiredDescription
providerstringjupiter_lend or kamino
assetstringToken symbol (e.g. USDC)
walletstringUser’s Solana public key
amountstringDecimal amount to deposit (e.g. "10.0")
chain_namestringNetwork (e.g. solana)
2

Request example

curl --request POST \
  --url https://api.starkfi.io/yield/deposit \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api_key>' \
  --data '{
    "provider": "jupiter_lend",
    "asset": "USDC",
    "wallet": "FmTGYpzX27fDqaiytXUdFVaphC5o68G61Q3uhVM2d8bm",
    "amount": "0.01",
    "chain_name": "solana"
  }'
3

Expected response

{
  "statusCode": 200,
  "success": true,
  "status": "deposit_yield_strategy_ok",
  "message": "Yield strategy deposited successfully",
  "data": {
    "transaction": "AQAAAAA...",
    "charged_starkfi_fee_amount": 0.1,
    "charged_whitelabel_fee_amount": 0.05,
    "starkfi_fee_percentage_applied": 0.5,
    "used_yield_starkfi_custom_fee": false
  }
}
data.transaction is the base64 unsigned Solana wire. Fee fields reflect StarkFi/whitelabel charges embedded in the transaction when applicable.
4

Sign and broadcast

Sign the wire with the user’s keypair, then either:
  • Your RPC: connection.sendRawTransaction(signedBytes), or
  • StarkFi (optional): POST /yield/broadcast with chain_name and op_signed
StarkPay POST /payment/execute/on-chain is still required for payment flows. Yield broadcast is optional.
import { Keypair, Transaction } from "@solana/web3.js";
import bs58 from "bs58";

const keypair = Keypair.fromSecretKey(bs58.decode(privateKeyBase58));
const tx = Transaction.from(Buffer.from(wireBase64, "base64"));
tx.sign(keypair);
const signedTx = tx.serialize().toString("base64");