Overview
Camino Treasury lets you deposit USDC or USDT into the C0 yield-bearing token to earn returns on idle funds. The API provides unsigned transactions that you sign and submit on-chain. You can withdraw back to stablecoins at any time.
Prerequisites
1. Prepare a Deposit
Get the unsigned transactions needed to deposit USDC or USDT into C0:
const chainId = 1;
const response = await fetch(
`https://api.caminotreasury.com/v1/${chainId}/deposit/prepare`,
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'your-api-key'
},
body: JSON.stringify({
token: 'USDC',
amount: '1000',
from: '0x742d35cc6634c0532925a3b844bc454e4438f44e',
recipient: '0x742d35cc6634c0532925a3b844bc454e4438f44e'
})
}
);
const { steps, summary } = await response.json();
// steps:
// [
// {
// "type": "approve",
// "description": "Approve USDC spending",
// "transaction": { "to": "0xA0b8...", "data": "0x095e...", "value": "0x0" }
// },
// {
// "type": "swap",
// "description": "Deposit USDC for C0",
// "transaction": { "to": "0xB680...", "data": "0x6e81...", "value": "0x0" }
// }
// ]
//
// summary:
// {
// "tokenIn": "USDC",
// "tokenOut": "C0",
// "amountIn": "1000",
// "amountInRaw": "1000000000"
// }
| Field | Type | Description |
|---|
token | string | Input token — USDC or USDT |
amount | string | Human-readable amount to deposit |
from | string | Address that holds the tokens |
recipient | string | Address that receives C0 |
The response contains an array of steps that must be signed and submitted in order. Each step includes an unsigned transaction object with to, data, and value fields.
Step types
| Type | Description |
|---|
approve | Approve the token spending allowance |
reset-approval | Reset USDT allowance to zero before setting a new one |
swap | Execute the deposit swap |
USDT requires resetting the allowance to zero before approving a new amount. The API handles this automatically — if a reset-approval step is included, submit it before the approve step.
2. Prepare a Withdrawal
Get the unsigned transactions to withdraw C0 back to USDC or USDT:
const chainId = 1;
const response = await fetch(
`https://api.caminotreasury.com/v1/${chainId}/withdraw/prepare`,
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'your-api-key'
},
body: JSON.stringify({
token: 'USDC',
amount: '500',
from: '0x742d35cc6634c0532925a3b844bc454e4438f44e',
recipient: '0x742d35cc6634c0532925a3b844bc454e4438f44e'
})
}
);
const { steps, summary } = await response.json();
// steps:
// [
// {
// "type": "approve",
// "description": "Approve C0 spending",
// "transaction": { "to": "0x00c0...", "data": "0x095e...", "value": "0x0" }
// },
// {
// "type": "swap",
// "description": "Withdraw C0 for USDC",
// "transaction": { "to": "0xB680...", "data": "0x04db...", "value": "0x0" }
// }
// ]
//
// summary:
// {
// "tokenIn": "C0",
// "tokenOut": "USDC",
// "amountIn": "500",
// "amountInRaw": "500000000"
// }
| Field | Type | Description |
|---|
token | string | Output token — USDC or USDT |
amount | string | Amount of C0 to withdraw |
from | string | Address that holds C0 |
recipient | string | Address that receives the stablecoin |
3. Estimate Yield
Get yield projections for a wallet’s C0 balance:
const chainId = 1;
const address = '0x742d35cc6634c0532925a3b844bc454e4438f44e';
const response = await fetch(
`https://api.caminotreasury.com/v1/${chainId}/yield?address=${address}`,
{ headers: { 'x-api-key': 'your-api-key' } }
);
const { earning, decimals, rate, dailyYield, monthlyYield, annualYield } =
await response.json();
// {
// "earning": "5000000000",
// "decimals": 6,
// "rate": { "apy": 0.03047 },
// "dailyYield": "417",
// "monthlyYield": "12500",
// "annualYield": "152373"
// }
| Field | Type | Description |
|---|
earning | string | Current C0 balance in raw units |
decimals | integer | Token decimal places (6) |
rate.apy | number | Net annual percentage yield |
dailyYield | string | Estimated daily yield in raw units |
monthlyYield | string | Estimated monthly yield in raw units |
annualYield | string | Estimated annual yield in raw units |
To convert raw yield values to human-readable amounts:
const monthly = Number(monthlyYield) / 10 ** decimals;
// 12500 / 1e6 = 0.0125 USDC
Next Steps