# Compare Earn opportunities after costs for a chosen holding period

Match an opportunity to its underlying token, compare provider-reported yield components and model a 90-day return with entry and exit costs.

Guide: https://www.bitpont.com/help/ai-agents/compare-earn-yield-and-costs/

## 1. Compare like assets and rate components

Call earnCompareOpportunities with a network and search term such as Base and USDC. Check the underlying asset, protocol, source and observation time. Save the candidate IDs, then repeat the call with just the network and ids to compare those rows across pages. Compare base and incentive APY separately. comparableGroups includes matching on-chain token identities. Inspect unmatchedIds when a selected opportunity is missing.

## 2. Model the holding period

Use earnYieldScenario with an assumed APY, a positive holding period and the principal and round-trip cost in the same units. The example uses 100 USDC at six decimals, an assumed annual yield of 4.50% and a combined cost of 0.20 USDC. With constant APY, grossYield is 1091259 base units and netChange is 891259, or 0.891259 USDC after costs. The first whole day that covers the assumed cost is day 17. Repeat the calculation with your own rate, costs and holding period.

## 3. Match the result to an available action

Use earnOfferingSearch to find the network, protocol, underlying asset and exact offering you intend to use. Follow its workspace and check the current deposit and exit terms. The comparison reflects reported rates and the scenario reflects your assumptions. A new deposit still requires a supported adapter, a fresh review and an authorized wallet.

## Model 100 USDC at 4.50% APY over 90 days

```
curl -fsS "https://www.bitpont.com/api/v1/agent/earn/yield/scenario" \
  -H 'Content-Type: application/json' \
  -d '{"principal":"100000000","apyPercent":"4.50","days":90,"roundTripCost":"200000"}'
```

## Tools

- `earnCompareOpportunities`
- `earnYieldScenario`
- `earnOfferingSearch`
- `earnPathTools`

## Further reading

- [Compare Earn products](<https://www.bitpont.com/earn/>)
- [Earn product guides](<https://www.bitpont.com/help/earn/>)
- [Check how much USDC a wallet can withdraw from lending](<https://www.bitpont.com/help/ai-agents/check-lending-withdrawal-capacity/>)
- [Find lending markets, vaults and staking actions for an agent](<https://www.bitpont.com/help/ai-agents/lending-vaults-and-staking/>)
- [Compare DeFi liquidity protocols and plan a position exit](<https://www.bitpont.com/help/ai-agents/defi-protocol-discovery/>)
