Overview
The yield functionality allows you to:- Discover available yield opportunities across different protocols and networks
- Enter yield positions by depositing tokens into yield opportunities
- Manage existing positions (claim rewards, voting, etc.)
- Exit yield positions to withdraw aggregated tokens and rewards
- Track yield balances and historical yield actions
Prerequisites
Before using yield operations, ensure you have:- A properly initialized Portal client (see Create a client)
- An active wallet with the required token(s) on the target network (see Create a wallet)
- Yield.xyz integration enabled in your Portal Dashboard (see Yield.xyz Integration)
Discovering Yield Opportunities
Use theGET /api/v3/clients/me/integrations/yield-xyz/yields endpoint to find available yield opportunities.
For complete API documentation, see the Client API reference.
Entering Yield Positions
To enter a yield position, first discover the specific yield, then use thePOST /api/v3/clients/me/integrations/yield-xyz/actions/enter endpoint to create the action and get transactions. You’ll then sign and submit these transactions using the Enclave MPC API.
For complete API documentation, see the Client API reference.
For the example below, we will use the yield opportunity with the ID "ethereum-sepolia-link-aave-v3-lending". Fund your Portal client with the required LINK token to enter the position (here is the correct LINK token on Sepolia testnet Etherscan).
Step 1: Create the Enter Action
Take note of the
transactionId and unsignedTransaction fields in the response’s data.rawResponse.transactions array items. You will need to use these to track the transaction.Step 2: Process and Sign Transactions
The response will include an array of transactions. Process them sequentially, sign each using the Enclave MPC API, track it, and wait for on-chain confirmation before proceeding to the next.Step 3: Track Transaction
After signing and broadcasting, submit the transaction hash to Yield.xyz:Learn more about processing these transactions sequentially in the section below.
Checking Yield Balances
Retrieve current yield positions and balances using thePOST /api/v3/clients/me/integrations/yield-xyz/yields/balances endpoint.
For complete API documentation, see the Client API reference.
Exiting Yield Positions
Use thePOST /api/v3/clients/me/integrations/yield-xyz/actions/exit endpoint to create an exit action, then sign and submit the resulting transactions.
For complete API documentation, see the Client API reference.
Managing Yield Positions
If your Portal client has entered into a yield balance, they may have a yield balance with availablependingActions. You can use the POST /api/v3/clients/me/integrations/yield-xyz/actions/manage endpoint to perform actions on existing yield positions. For example, if the balance has a pendingAction of WITHDRAW or CLAIM_REWARDS, you can use the manage method to withdraw or claim rewards from the yield balance.
For complete API documentation, see the Client API reference.
Getting Historical Actions
Retrieve the history of yield actions for an address using theGET /api/v3/clients/me/integrations/yield-xyz/actions endpoint.
For complete API documentation, see the Client API reference.
Transaction Processing
Yield operations can require multiple transactions. Process them sequentially, sign each using the Enclave MPC API, track it, and wait for on-chain confirmation (e.g. usingeth_getTransactionReceipt) before proceeding to the next.
For complete API documentation, see the Client API reference and get transaction details reference.
Example Transaction Processing Flow
Here’s a complete example of processing transactions from an enter action:The
unsignedTransaction field in the Yield.xyz response is a JSON string. Parse it and extract the transaction parameters before passing to the Enclave MPC API sign endpoint. Remove the gas parameters if you want Portal to estimate the gas for you.Best Practices
- Always check yield availability before attempting to enter positions
- Process transactions sequentially as yield operations often require multiple steps and are dependent on previous transactions being mined successfully
- Handle network errors gracefully and provide user feedback
- Monitor transaction status and provide progress updates to users
- Validate user balances before initiating yield operations
- Track all transactions using the Yield.xyz submit-hash endpoint to maintain accurate state
Supported Networks
The yield functionality supports various networks including:- Monad Testnet (
eip155:10143) - Ethereum Mainnet (
eip155:1) - Ethereum Sepolia (
eip155:11155111) - Polygon (
eip155:137) - Polygon Amoy (
eip155:80002) - Base (
eip155:8453) - Base Sepolia (
eip155:84532) - Arbitrum (
eip155:42161) - Optimism (
eip155:10) - Optimism Sepolia (
eip155:11155420) - Solana (
solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp) - Solana Devnet (
solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1)
Next Steps
- Learn about signing Ethereum transactions
- Explore sending tokens
- Check out the Client API Yield.xyz endpoints