# Resolve a swap market and recover an interrupted trade

Find the exact sell and buy tokens, choose the matching signer and recover a submitted trade from its original identifier.

Guide: https://www.bitpont.com/help/ai-agents/swap-direction-and-recovery/

MCP resource: `bitpont://guides/swap-direction-and-recovery`

[Browse swap networks](https://www.bitpont.com/swap/networks/)

## 1. Resolve the direction

Start with swapMarketCoverage. Pass the network to swapPairBrowser and select a sell and buy address. Call swapMarketWorkflow with those exact identities. Its workspace opens the same trade in Bitpont.

## 2. Check the wallet and the route

Request a fresh quote. Compare amounts in the actual token decimals, minimum output, fee recipient, allowance, gas and expiry. A listed market can have no executable quote at the requested size.

## 3. Choose the owner policy

An agent using its own funded wallet signs locally under its spending policy. A customer can approve an exact batch where the execution-session adapter supports it. The agent receives authority for those reviewed tickets only. Other routes require the owner signer.

## 4. Recover the original submission

Save the execution ID, signed transaction identifier and request ID before submitting. On timeout, query the workflow’s receipt or executionLookup first. Inspect the received asset, amount and verified fee. An unknown result still requires reconciliation.

## 5. Run the local example

Download the agent kit and run node swap-recovery-example.mjs with Node 24. It runs both wallet models and simulates a lost reply. The output includes the original transaction hash and received amount.

## List network coverage

```
curl -fsS "https://www.bitpont.com/api/v1/agent/discovery/swap-coverage"
```

### MCP tool call

```json
{
  "method": "tools/call",
  "params": {
    "name": "bitpont_swapMarketCoverage",
    "arguments": {}
  }
}
```

## Tools

- `swapMarketCoverage`
- `swapPairBrowser`
- `swapMarketWorkflow`
- `executionLookup`
- `tradeReceipt`
- `tronRouteObservations`

## Further reading

- [Download the runnable agent kit](<https://www.bitpont.com/assets/sdk/bitpont-agent-kit.zip>)
- [Report an agent integration issue](<https://www.bitpont.com/contact/>)
- [Find a swap pair by network and token address](<https://www.bitpont.com/help/ai-agents/browse-directional-swap-markets/>)
- [Check a trading wallet before signing and verify its receipt](<https://www.bitpont.com/help/ai-agents/check-trade-readiness-and-receipts/>)
