Quick Diagnosis
SDK throws 'SDK_NOT_INITIALIZED'
SDK throws 'SDK_NOT_INITIALIZED'
Cause: Calling SDK functions before See Project Setup for initialization patterns.
initAmplifySDK() completes.Solution:- Ensure
initAmplifySDK()is called at app startup and awaited - In React, use a provider pattern or custom hook
- Check that the API key environment variable is set
'VAULT_NOT_FOUND' error
'VAULT_NOT_FOUND' error
Cause: No vault matches the provided yieldType, token, and chainId combination.Solution:
- Verify the token address is correct for the chain
- Check that the yield type supports the token via
fetchSupportedAssets() - Ensure you’re using the correct chain ID
Permit signature fails or is rejected
Permit signature fails or is rejected
Cause: Token may not support EIP-2612, or wallet doesn’t support
eth_signTypedData_v4.Solution:- The SDK automatically falls back to approval flow
- For smart wallets, use
forceMethod: "approval"as they cannot sign permits - Check wallet compatibility with typed data signing
Transaction reverts on deposit
Transaction reverts on deposit
Cause: Insufficient balance, allowance, or slippage exceeded.Solution:
- Verify user has sufficient token balance
- Check that approval transaction confirmed before deposit
- Increase slippage tolerance if market conditions are volatile
Withdrawal fails with liquidity error
Withdrawal fails with liquidity error
Cause: Vault may have temporary withdrawal limits.Solution:
- Try a smaller withdrawal amount
- Wait and retry during different market conditions
- Surface the
endpointandstatusCodefromAPIErrorto understand the specific failure
Error Reference
All SDK functions throwAPIError with structured metadata:
Error Codes
| Code | Description | Resolution |
|---|---|---|
SDK_NOT_INITIALIZED | SDK used before init | Call initAmplifySDK() at app startup |
INVALID_API_KEY | API key validation failed | Check key format (pxl_...) |
VAULT_NOT_FOUND | No vault matches params | Verify yieldType, token, chainId |
PERMIT_NOT_SUPPORTED | Token lacks EIP-2612 | Use approval flow or forceMethod: "approval" |
INSUFFICIENT_ALLOWANCE | Approval amount too low | Increase approval or use permit |
LIQUIDITY_UNAVAILABLE | Vault has withdrawal limits | Try smaller amount or wait |
Wallet-Specific Issues
Smart Wallets (Privy Smart Wallet, Alchemy)
| Issue | Cause | Solution |
|---|---|---|
| Permit signing fails | Smart contracts cannot sign EIP-712 | Use forceMethod: "approval" |
| UserOperation times out | Bundler congestion | Increase timeout, retry later |
| Batched transaction reverts | One call in batch failing | Debug individual calls separately |
EOA Wallets
| Issue | Cause | Solution |
|---|---|---|
eth_signTypedData_v4 unsupported | Older wallet version | Update wallet, or force approval |
| Gas estimation fails | Simulation reverted | Check parameters, token balance |
Debugging Checklist
Verify parameters
- Token address is checksummed
- Chain ID matches the network
- Amount is a valid decimal string (e.g., “100.25”)
Common Patterns
Retry with Exponential Backoff
User-Friendly Error Messages
Getting Help
If you’ve tried these steps and still have issues:- Enable
LogLevel.DEBUGand capture full console output - Note the exact error code and message
- Check the Changelog for breaking changes
- Contact support@paxoslabs.com with details