The ILAL DeFi API builds unsigned Uniswap V4 transactions for you. Your institution signs and broadcasts them using its own wallet — ILAL never touches your private key.
| Token | Address |
|---|---|
| WETH (Wrapped Ether) | 0x4200000000000000000000000000000000000006 |
| USDC (Circle) | 0x036CbD53842c5426634e7929541eC2318f3dCF7e |
Note: token0 must be lexicographically less than token1. WETH < USDC by address.
Sell 0.001 ETH for USDC — WETH → USDC (zeroForOne: true).
curl -X POST https://ilalapi-production.up.railway.app/api/v1/defi/swap \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"tokenIn": "0x4200000000000000000000000000000000000006",
"tokenOut": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
"amount": "1000000000000000",
"zeroForOne": true,
"userAddress": "YOUR_WALLET_ADDRESS"
}'import { ethers } from 'ethers';
const provider = new ethers.JsonRpcProvider('https://sepolia.base.org');
const wallet = new ethers.Wallet(process.env.PRIVATE_KEY!, provider);
// Build
const res = await fetch('https://ilalapi-production.up.railway.app/api/v1/defi/swap', {
method: 'POST',
headers: { 'X-API-Key': 'YOUR_API_KEY', 'Content-Type': 'application/json' },
body: JSON.stringify({
tokenIn: '0x4200000000000000000000000000000000000006',
tokenOut: '0x036CbD53842c5426634e7929541eC2318f3dCF7e',
amount: '1000000000000000',
zeroForOne: true,
userAddress: wallet.address,
}),
});
const { transaction } = await res.json();
// Sign & broadcast — your key, never shared
const tx = await wallet.sendTransaction(transaction);
console.log('Tx submitted:', tx.hash);
const receipt = await tx.wait();
console.log('Swap confirmed in block', receipt.blockNumber);import { createWalletClient, http } from 'viem';
import { privateKeyToAccount } from 'viem/accounts';
import { baseSepolia } from 'viem/chains';
const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);
const client = createWalletClient({ account, chain: baseSepolia, transport: http() });
// Build
const res = await fetch('https://ilalapi-production.up.railway.app/api/v1/defi/swap', {
method: 'POST',
headers: { 'X-API-Key': 'YOUR_API_KEY', 'Content-Type': 'application/json' },
body: JSON.stringify({
tokenIn: '0x4200000000000000000000000000000000000006',
tokenOut: '0x036CbD53842c5426634e7929541eC2318f3dCF7e',
amount: '1000000000000000',
zeroForOne: true,
userAddress: account.address,
}),
});
const { transaction } = await res.json();
// Sign & broadcast
const hash = await client.sendTransaction({
to: transaction.to,
data: transaction.data,
value: BigInt(transaction.value),
gas: BigInt(transaction.gas),
});
console.log('Swap hash:', hash);Provide liquidity to the WETH/USDC pool.
curl -X POST https://ilalapi-production.up.railway.app/api/v1/defi/liquidity \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"token0": "0x4200000000000000000000000000000000000006",
"token1": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
"amount0": "1000000000000000",
"amount1": "1000000000000000",
"tickLower": -600,
"tickUpper": 600,
"userAddress": "YOUR_WALLET_ADDRESS"
}'token0 must have a lower address value than token1. For WETH/USDC on Base Sepolia, WETH is token0.