Trading and Earn
Rehearse a position exit with Portfolio, REST or MCP
Check a wallet-specific exit from lending, liquidity, derivatives, swaps, a bridge or a Safe. Save the plan, review signer requirements and recover its settlement evidence.
Workflow
Discover exits for the exact product
Call productExitRoutes without credentials. Filter by product, network or routeId. Each result includes its route ID, native workspace, required fields and units. For example, POST {"product":"liquidity","network":"base"} to /api/v1/agent/portfolio/exit/products to find supported Base LP exits. Choose the exact protocol and pool or NFT. For Earn choose the correct network, market and action. Closing exposure at a venue, releasing collateral and converting the proceeds to USDC can require separate steps.
Preview what the wallet can do
Call productExitPreview with the selected routeId and its input object. Supply the owner address and exact position identifiers from Portfolio. Include spending, slippage, fee or gas limits where the schema accepts them. Check the observation time, expiry, units and source of each fact. A quoted minimum, simulated wallet credit and finalized wallet receipt describe different events. For Safe Treasury, distinguish the signing owner from the Safe custody address. Operations can inspect an allowance or original transaction. An unavailable balance or margin value stays unknown.
Save a portable product task
In the original private workspace, send the same routeId and input to productExitTaskCreate with a new UUID requestId. Reuse that UUID and the same terms on a timeout. Persist the returned taskId and use productExitTaskStatus from Portfolio, REST or MCP after a restart. The copied agent handoff contains the task reference. Supply the workspace separately on your own host. The task ID grants no signing authority.
Prepare the checked action and reconcile
If the preview returns an available preparation, call productExitTaskPrepare with only taskId. Retain the returned executionId, review the exact action and limits, and sign through an authorized owner signer. Follow the returned next tool for routes requiring venue-specific signing or a native claim. After submission, call productExitTaskReceipt with the original taskId. Check the actual receiving chain, token, wallet and amount. A Safe proposal can still need owner approvals. A bridge can be pending or refunded, and a partial fill can leave exposure on the venue.
Look up your Base USDC supply position
Open Portfolio Earn and choose Rehearse my exit. Use the public address that owns the supply shares and the exact Morpho Blue market ID. Confirm that the loan asset is native USDC on Base. The example below reads a sample public address. Replace both identifiers with your own position to get a useful result.
Read what is available
The USDC already in the wallet is separate from the amount the market can return. Check the supplied amount, available market liquidity, estimated withdrawal, ETH for gas and projected USDC balance. For a specific amount, enter USDC base units, such as 1000000 for 1 USDC. Rehearse again if the observation has gone stale or an estimate is missing. Pledged collateral and pending orders need their own checks.
Hand the task to your agent
Save a fresh rehearsal with exitTaskCreate using the same inputs and a new UUID requestId. Keep the returned taskId in the original private workspace. Reuse the requestId after a timeout. Pass taskId to exitTaskStatus to resume. A rehearsal transfers no funds. Before any withdrawal, compare the prepared transaction with the chosen wallet, Base network, market, amount and destination. If the task is ready, pass its returned preparation to executionPrepare with the supplied requestId. In Portfolio, a connected wallet that supports signing raw transactions can review and sign this exact Base withdrawal. If the wallet does not offer that method, use the owner signer with the same execution ID. On the owner host, walletReview can inspect local policy without signing if the adapter supports it. An unavailable policy check leaves permission unknown. The owner or its authorized signer reviews the resulting ticket.
Test a different order of actions
Use exitPlanCompare to explore a debt repayment and a short hedge in two different orders. Model a partial fill, an expired quote or delayed funds using the same starting assumptions. A simulation describes what could happen. A venue fill, remaining margin and destination delivery each need their own evidence before the next real step.
Compare the receipt
After an authorized withdrawal, retain the execution ID and check tradeReceipt. Pass taskId and executionId to exitTaskCompare in the same workspace to match the saved preview with the finalized withdrawal. Compare the amount delivered in USDC and gas in ETH separately. If a value is unknown or finality is pending, keep tracking the original transaction. The linked controlled-RPC example shows a simulated 50 USDC withdrawal. A funded comparison requires a real finalized transaction.
Check past route delivery
Use exitRouteScorecard in the original workspace for a specific source network, destination network, input token, output token and input size. Check the reporting period, sample size, comparable quotes, reported refunds and unresolved transfers. An empty sample means that this workspace has no matching evidence for those terms.
Read public route results
Call publicRouteScorecard for the same token pair and size. Each publication covers a complete UTC month after seven days of observation. A venue needs 20 submissions from at least five workspaces and five source wallets, with each contributor at or below 40% of the sample. Small outcome groups are suppressed. A blank result means the publication threshold was not met or no qualifying evidence was available. Use exitScorecardConsent in your own workspace to opt in to future submissions or withdraw consent.
Preview 1 USDC using a sample address
curl -fsS "https://www.bitpont.com/api/v1/agent/portfolio/exit/rehearse" \
-H 'Content-Type: application/json' \
-d '{"wallet":"0x0000000000000000000000000000000000000001","marketId":"0x09276541cfecb6920a80679a1deced4dde3ae64bf5fc2c9c1f9c21e0c152e1a5","amountUsdc":"1000000"}'