Yes, Tether's WDK can handle ALL the operations you mentioned:
- ✅ RPC provider connections
- ✅ Contract interactions (read-only calls)
- ✅ Encoding/decoding function data
- ✅ Gas estimation
WDK Supports:
- Direct RPC endpoint URLs
- EIP-1193 provider instances
- Automatic fee rate fetching
- Network-aware operations
Example:
const wallet = new WalletManagerEvm(seedPhrase, {
provider: 'https://ethereum-rpc.publicnode.com',
transferMaxFee: 100000000000000 // in wei
})Methods:
getFeeRates()- Returns normal and fast fee rates- Automatic RPC calls for all operations
WDK Provides:
getAccountData()- Read Aave account datagetTokenBalance(tokenAddress)- Read ERC-20 balancegetTokenBalances(tokenAddresses)- Batch read balancesgetAllowance(token, spender)- Read token allowances- Protocol-specific read methods via lending modules
Example:
const aave = new AaveProtocolEvm(account)
// Read-only operations
const data = await aave.getAccountData()
console.log({
totalCollateralBase: data.totalCollateralBase,
totalDebtBase: data.totalDebtBase,
availableBorrowsBase: data.availableBorrowsBase,
currentLiquidationThreshold: data.currentLiquidationThreshold,
ltv: data.ltv,
healthFactor: data.healthFactor
})
const balance = await account.getTokenBalance('0xdAC17F958D2ee523a2206206994597C13D831ec7')WDK Handles:
- Automatic function encoding for all operations
- Protocol-specific method encoding
- Transaction data preparation
- No manual ABI encoding needed
Example:
// WDK automatically encodes the function call
const result = await aave.supply({
token: '0xdAC17F958D2ee523a2206206994597C13D831ec7', // USDT
amount: 1000000n
})
// Returns: { hash: '0x...', fee: BigInt(...) }Supported Operations:
supply()- Encodes Aave supply functionwithdraw()- Encodes Aave withdraw functionborrow()- Encodes Aave borrow functionrepay()- Encodes Aave repay functionapprove()- Encodes ERC-20 approve functiontransfer()- Encodes ERC-20 transfer function
WDK Provides:
estimateFee(transaction)- Estimate transaction feequoteSupply()- Quote supply operation with feequoteWithdraw()- Quote withdraw operation with feequoteBorrow()- Quote borrow operation with feequoteRepay()- Quote repay operation with feeestimateTransfer()- Estimate ERC-20 transfer feegetFeeRates()- Get current network fee rates
Example:
// Get fee estimate before executing
const supplyQuote = await aave.quoteSupply({
token: USDT,
amount: 1000000n
})
console.log('Supply fee estimate:', supplyQuote.fee)
// Get current network fee rates
const rates = await wallet.getFeeRates()
console.log({
normal: rates.normal, // Base fee × 1.1
fast: rates.fast // Base fee × 2.0
})- Package:
@tetherto/wdk-wallet-evm - Features: BIP-39/BIP-44 wallet management, signing, basic operations
- Aave:
@tetherto/wdk-protocol-lending-aave-evm - Compound:
@tetherto/wdk-protocol-lending-compound-evm(if available) - Spark:
@tetherto/wdk-protocol-lending-spark-evm(if available)
- ERC-4337:
@tetherto/wdk-wallet-evm-erc-4337 - Features: Paymaster support, bundler integration, gasless transactions
- USDT Bridge:
@tetherto/wdk-bridge-usdt0-evm - Cross-chain operations: Bridge USDT across chains
| Operation | ethers | WDK |
|---|---|---|
| RPC Provider | ✅ Yes | ✅ Yes |
| Read-only calls | ✅ Yes | ✅ Yes |
| Function encoding | ✅ Manual | ✅ Automatic |
| Gas estimation | ✅ Yes | ✅ Yes |
| Transaction signing | ✅ Yes | ✅ Yes (WDK-native) |
| Protocol abstraction | ❌ No | ✅ Yes (Aave, Compound, etc.) |
| Quote operations | ❌ No | ✅ Yes |
| Account data | ❌ No | ✅ Yes (protocol-specific) |
| ERC-4337 support | ✅ Full | |
| Paymaster support | ❌ No | ✅ Yes |
ethers (RPC, contracts, encoding)
↓
WDK (wallet, signing)
WDK (everything)
├── Wallet management
├── RPC connections
├── Protocol operations
├── Gas estimation
└── Transaction signing
// Before: ethers
const provider = new ethers.JsonRpcProvider(rpcUrl)
// After: WDK
const wallet = new WalletManagerEvm(seedPhrase, { provider: rpcUrl })// Before: ethers
const contract = new ethers.Contract(address, abi, provider)
const data = await contract.getReserveData(tokenAddress)
// After: WDK
const aave = new AaveProtocolEvm(account)
const data = await aave.getAccountData()// Before: ethers
const gasLimit = await provider.estimateGas({ from, to, data })
// After: WDK
const quote = await aave.quoteSupply({ token, amount })
console.log('Fee:', quote.fee)// Before: ethers
const iface = new ethers.Interface(abi)
const data = iface.encodeFunctionData('supply', [asset, amount, user, 0])
// After: WDK
const result = await aave.supply({ token: asset, amount })
// Encoding is automatic- Unified Security Model: All operations go through WDK's security layer
- Simplified Code: No manual ABI encoding or contract instantiation
- Protocol Abstraction: Built-in support for Aave, Compound, Spark
- Better Error Handling: Protocol-specific error messages
- Gas Optimization: Built-in fee estimation and optimization
- Account Abstraction: Native ERC-4337 support for gasless transactions
- Paymaster Support: Can use paymasters to cover gas fees
- Reduced Dependencies: One less library to maintain
YieldKernel currently uses:
- ✅ WDK for wallet management (correct)
⚠️ ethers for RPC and contracts (can be replaced)
Recommendation: Migrate to WDK-only for:
- Stronger security posture
- Cleaner code
- Better protocol integration
- Native support for advanced features (ERC-4337, paymasters)
- Install WDK Aave module:
npm install @tetherto/wdk-protocol-lending-aave-evm - Replace ethers RPC provider with WDK provider
- Replace contract interactions with WDK protocol methods
- Remove ethers dependency (if not needed elsewhere)
- Update gas estimation to use WDK quotes
- Test all operations with WDK-only stack
This would make YieldKernel a pure WDK-based solution with maximum security and protocol integration.