Plugin architecture
Every plugin follows a standard interface that the agent understands:Plugins are loaded when the agent initializes and cannot be added or removed at runtime.
How plugins work
When you add a plugin to the agent:- Registration - Plugin is registered in the agent’s plugin map
- Initialization -
initialize()is called with agent instance - Method binding - All plugin methods are bound to the agent’s
methodsobject - Action registration - Actions are added to the agent’s action list
utils/syntoUtils/agent/core/index.ts:61
Method conflicts
The agent prevents method name conflicts:Available plugins
Synto Mobile includes two core plugins:Token plugin
Token transfers, swaps, balances, and data
DeFi plugin
Lending, borrowing, and loan management
Token plugin
The Token plugin provides comprehensive token and trading capabilities.Overview
- Name:
token - Methods: 12 callable functions
- Actions: 12 natural language actions
- Integrations: DexScreener, Jupiter, Solana RPC
utils/syntoUtils/agent/plugins/plugin-token/index.ts:44
Available methods
Token data methods
Token data methods
DexScreener integration:
getTokenDataByAddress- Get token info by mint addressgetTokenAddressFromTicker- Look up address by symbol
fetchPrice- Get current token price in USDCstakeWithJup- Stake JUP tokenstrade- Execute token swap on Jupiter
Balance methods
Balance methods
Check balances:
get_balance- Your SOL balanceget_balance_other- Another wallet’s SOL balanceget_token_balance- Specific SPL token balance
Transaction methods
Transaction methods
Execute transactions:
transfer- Send SOL or SPL tokenscloseEmptyTokenAccounts- Reclaim rent from empty accountsrequest_faucet_funds- Get devnet/testnet SOL
Utility methods
Utility methods
Blockchain utilities:
getTPS- Current Solana transactions per secondgetWalletAddress- Your wallet’s public key
Actions
The Token plugin includes 12 actions triggered by natural language:- Transfer
- Trade
- Balance
- Other actions
Action: Source:
TRANSFERTriggers:- “send tokens”
- “transfer funds”
- “send money”
- “send sol”
- “transfer tokens”
utils/syntoUtils/agent/plugins/plugin-token/solana/actions/transfer.ts:6Forbidden actions
Some actions are explicitly disabled for safety:utils/syntoUtils/agent/agentBuilder.ts:15
DeFi plugin
The DeFi plugin integrates with Rainfi for decentralized lending and borrowing.Overview
- Name:
defi - Methods: 4 callable functions
- Actions: 4 natural language actions
- Integrations: Rainfi Protocol
utils/syntoUtils/agent/plugins/plugin-defi/index.ts:18
Rainfi integration
Rainfi is a decentralized lending protocol on Solana that allows:- Collateralized loans - Borrow against your crypto
- Short-term lending - Typically 7-day loan periods
- Multiple currencies - Support for SOL, USDC, and other tokens
- Transparent rates - Clear APR and fee structure
Available methods
- Quote calculator
- Transaction builder
- Get user loans
- Repay loan
Method: Returns:Source:
quoteLoanCalculatorCalculate loan terms before borrowing.Parameters:utils/syntoUtils/agent/plugins/plugin-defi/rainfi/actions/quoteLoanCalculator.ts:5Actions
The DeFi plugin provides 4 natural language actions:RAINFI_QUOTE_LOAN_CALCULATOR
Triggers:
- “quote loan calculator”
- “calculate loan”
- “get loan quote”
- “loan quote calculator”
RAINFI_TRANSACTION_BUILDER
Builds loan transactions from quotes
RAINFI_GET_USER_LOANS
Retrieves all your active loans
RAINFI_REPAY_LOAN
Repays loans and reclaims collateral
Loan quote workflow
The typical flow for taking out a loan:- Get quote - Calculate loan terms
- Review terms - Agent displays quote for confirmation
- Build transaction - Construct the loan transaction
- Sign and send - Execute the loan
Important: Always review the loan quote before proceeding. The agent will display all terms including interest rate, fees, and repayment amount.
Plugin initialization
Plugins initialize differently based on their needs:- Token plugin
- DeFi plugin
Creating custom plugins
You can extend the agent with custom plugins:Plugin best practices
When working with plugins:Unique method names
Unique method names
Ensure all method names are unique across plugins to avoid conflicts. The agent will throw an error if methods collide.
Clear action triggers
Clear action triggers
Use descriptive and distinct similes for actions. Avoid overlapping trigger phrases that could confuse the AI.
Input validation
Input validation
Always use Zod schemas to validate action inputs. This prevents runtime errors and provides clear error messages.
Error handling
Error handling
Methods should catch errors and return structured responses:
Agent binding
Agent binding
If your methods need the agent instance, bind them in the
initialize function:What’s next
See capabilities
Explore what the plugins can do
Agent overview
Learn about the core architecture