Features
The DeFi plugin offers four core capabilities:Loan quotes
Calculate loan quotes with optimal interest rates and terms
Loan execution
Build and execute collateralized loan transactions
Loan management
Retrieve all active loans for a wallet address
Loan repayment
Repay outstanding loans and reclaim collateral
Installation
The DeFi plugin is included in the Synto Mobile SDK. Initialize it when configuring your agent:Plugin structure
The plugin exports methods and actions that work together:API endpoint
All operations communicate with the RainFi API:Base URL for all RainFi protocol operations
Available operations
RainFi loans
Complete API reference for RainFi loan operations including quotes, execution, management, and repayment
Error handling
All DeFi operations return structured responses with error handling:Common error messages
No available loans match the requested parameters. Try increasing the amount or using different currencies.
The RainFi API returned an error. Check the status code and message for details.
The API response was invalid. This may indicate a temporary service issue.
The transaction builder returned an invalid transaction. Verify all parameters are correct.
Best practices
Use currency addresses
Always use full Solana addresses for currencies, not symbols. For example, use
"So11111111111111111111111111111111111111112" for SOL.Display quotes before execution
Show loan quotes to users in a readable format before executing transactions. Include APR, duration, fees, and total repayment amount.
Handle amounts correctly
All amounts are in the smallest unit (lamports for SOL, base units for tokens). Convert to decimals for display.
Next steps
RainFi loans
Detailed API reference for all RainFi operations
AI agent actions
Learn how actions work with the AI agent