Guides
Earn with Spark
Let your users earn the Sky Savings Rate on USDC with
Spark, with Execute.
Your user sends USDC to an executable address, which deposits it into Spark Savings USDC on Base, and the savings shares, sUSDC, go to your user’s wallet. They never connect their wallet to your app, and never approve anything.
Get an API key
The contracts
Everything happens on Base. The intent calls these contracts, and nothing else:
Contract Address Why USDC 0x8335…2913The token your user deposits. Spark Savings USDC 0x3128…e858Spark’s savings vault for USDC (sUSDC): an ERC-4626 vault that earns the Sky Savings Rate. The intent
The token is USDC, and the amount is in its base units: USDC has 6 decimals, so 100 USDC is
"100000000". Once the address holds exactly the amount, it makes these calls, as itself, in one transaction:1
approve(address spender, uint256 amount)on USDCAn ERC-4626 deposit pulls its assets with
transferFrom, so the address first allows the vault to take exactly the amount, and no more.Argument Value Why spender0x3128…e858The vault, which takes the USDC in the next call. amount$AMOUNTExactly the deposit, so nothing is left approved afterwards. 2
deposit(uint256 assets, address receiver)on Spark Savings USDCThe ERC-4626 deposit: the vault takes the USDC and mints sUSDC to
receiver.Argument Value Why assets$AMOUNTAll of the USDC. receiver$WALLETYour user’s wallet: the sUSDC is theirs. recoveryis$WALLET: your user’s wallet, so if the deposit can’t happen, their USDC goes straight back to them.Create the address
Post the intent to Create an address. The expiry is 5 minutes away and the salt is random, so every run gives a new address:
Request AMOUNT=100000000 # the deposit in base units: 100 USDC WALLET=0x… # your user’s wallet curl https://api.execute.cash/v1/address/create \ -H "Authorization: Bearer $EXECUTE_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", "amount": "'$AMOUNT'", "calls": [ { "target": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", "function": "approve(address spender, uint256 amount)", "args": ["0x3128a0F7f0ea68E7B7c9B00AFa7E41045828e858", "'$AMOUNT'"] }, { "target": "0x3128a0F7f0ea68E7B7c9B00AFa7E41045828e858", "function": "deposit(uint256 assets, address receiver)", "args": ["'$AMOUNT'", "'$WALLET'"] } ], "expirationTimestamp": '$(( $(date +%s) + 300 ))', "recovery": "'$WALLET'", "salt": "0x'$(openssl rand -hex 32)'", "chainId": 8453 }'The response’s
addressis the executable address. Check it as the quickstart shows before you show it to anyone.Show it to your user
Show the address with the exact amount, the token and the chain, in words, and a way to copy each. Beside them, a QR code of an EIP-681 payment request lets your user’s wallet fill in the chain, the token and the amount by itself:
Payment request // address and intent, from the create response const request = `ethereum:${intent.token}@${intent.chainId}/transfer?address=${address}&uint256=${intent.amount}`;uint256is in the token’s base units, like the intent’samount. Say under the code what it fills in, and offer a plain code of the address alone for wallets that can’t read a request; your user then picks the token and chain and enters the amount themselves. The address’s page,execute.cash/address/<address>, shows your user what paying it will do.Your user pays with an ordinary transfer, from any wallet or exchange. They connect nothing and approve nothing.
Track it
Poll the address’s status, or get webhooks. Once it’s
settled, your user’s wallet holds sUSDC. It grows in value at the Sky Savings Rate, and redeems for USDC at any time, from any app that supports Spark.