{
  "x402Version": 2,
  "id": 57327,
  "slug": "57327",
  "resource": "https://yield.trdefi.com/v1/swaps",
  "description": "TRDEFI prepare request",
  "type": "http",
  "resourceType": "Payments",
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "payTo": "0x4C96dA02d7120BFb81594d0e924B237e0c74660d",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "amount": "20000",
      "amountUsd": 0.02,
      "maxTimeoutSeconds": 3600
    },
    {
      "scheme": "exact",
      "network": "eip155:5042",
      "payTo": "0x4C96dA02d7120BFb81594d0e924B237e0c74660d",
      "asset": "0x3600000000000000000000000000000000000000",
      "amount": "20000",
      "maxTimeoutSeconds": 3600
    }
  ],
  "outputSchema": {
    "description": "One unsigned transaction that performs the swap.",
    "example": {
      "amountOut": "999000",
      "chain": "base",
      "note": "Sign with your own wallet. TRDEFI cannot sign or broadcast this.",
      "transactions": [
        {
          "data": "0x...",
          "to": "0x111111338c5091e8440b67b168bae16a668ac0de",
          "value": "0"
        }
      ]
    },
    "type": "object"
  },
  "extensions": {
    "bazaar": {
      "description": "Swap stablecoins against a live non-custodial liquidity position and receive the result on-chain. Give a strategy hash and an input amount; get back an unsigned transaction that settles the swap against that maker position. Use this when an agent needs to move USDC/USDT and prefers a real on-chain counterparty to a custodial venue: the swap is simulated first, and if it cannot succeed no transaction is returned at all, so a wallet is never handed one that is certain to revert.",
      "info": {
        "input": {
          "body": {
            "example": {
              "amount": "1000000",
              "chain": "base",
              "direction": "aToB",
              "strategyHash": "0x5928c6b6c24c08615ddde8b832e6f4b135550601e2bb903dba4123c1b8ff8f2c",
              "wallet": "0x0000000000000000000000000000000000000000"
            },
            "properties": {
              "amount": {
                "description": "REQUIRED. Input amount in token base units, as an integer string, e.g. \"1000000\" for 1 USDC. Must be greater than zero.",
                "type": "string"
              },
              "chain": {
                "description": "REQUIRED. Network the position is on. Note this list differs from /v1/positions, which ships on `base`, `arc` and `baseSepolia` only.",
                "enum": [
                  "ethereum",
                  "base",
                  "arbitrum",
                  "optimism",
                  "polygon",
                  "arc"
                ],
                "type": "string"
              },
              "direction": {
                "description": "Which way round the pair to swap. Omit to let the route infer it from `tokenIn`/`tokenOut`.",
                "enum": [
                  "aToB",
                  "bToA"
                ],
                "type": "string"
              },
              "strategyHash": {
                "description": "REQUIRED. 32-byte strategy hash of the position to swap against.",
                "pattern": "^0x[a-fA-F0-9]{64}$",
                "type": "string"
              },
              "tokenIn": {
                "description": "Optional. Token you are selling, as a symbol or address. Use it to disambiguate the direction.",
                "type": "string"
              },
              "tokenOut": {
                "description": "Optional. Token you are buying, as a symbol or address. Use it to disambiguate the direction.",
                "type": "string"
              },
              "wallet": {
                "description": "REQUIRED. Your own EVM address that will sign the swap.",
                "pattern": "^0x[a-fA-F0-9]{40}$",
                "type": "string"
              }
            },
            "required": [
              "strategyHash",
              "chain",
              "amount",
              "wallet"
            ],
            "type": "object"
          },
          "method": "POST",
          "type": "http"
        },
        "output": {
          "description": "One unsigned transaction that performs the swap.",
          "example": {
            "amountOut": "999000",
            "chain": "base",
            "note": "Sign with your own wallet. TRDEFI cannot sign or broadcast this.",
            "transactions": [
              {
                "data": "0x...",
                "to": "0x111111338c5091e8440b67b168bae16a668ac0de",
                "value": "0"
              }
            ]
          },
          "type": "object"
        }
      },
      "schema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "properties": {
          "input": {
            "properties": {
              "body": {
                "example": {
                  "amount": "1000000",
                  "chain": "base",
                  "direction": "aToB",
                  "strategyHash": "0x5928c6b6c24c08615ddde8b832e6f4b135550601e2bb903dba4123c1b8ff8f2c",
                  "wallet": "0x0000000000000000000000000000000000000000"
                },
                "properties": {
                  "amount": {
                    "description": "REQUIRED. Input amount in token base units, as an integer string, e.g. \"1000000\" for 1 USDC. Must be greater than zero.",
                    "type": "string"
                  },
                  "chain": {
                    "description": "REQUIRED. Network the position is on. Note this list differs from /v1/positions, which ships on `base`, `arc` and `baseSepolia` only.",
                    "enum": [
                      "ethereum",
                      "base",
                      "arbitrum",
                      "optimism",
                      "polygon",
                      "arc"
                    ],
                    "type": "string"
                  },
                  "direction": {
                    "description": "Which way round the pair to swap. Omit to let the route infer it from `tokenIn`/`tokenOut`.",
                    "enum": [
                      "aToB",
                      "bToA"
                    ],
                    "type": "string"
                  },
                  "strategyHash": {
                    "description": "REQUIRED. 32-byte strategy hash of the position to swap against.",
                    "pattern": "^0x[a-fA-F0-9]{64}$",
                    "type": "string"
                  },
                  "tokenIn": {
                    "description": "Optional. Token you are selling, as a symbol or address. Use it to disambiguate the direction.",
                    "type": "string"
                  },
                  "tokenOut": {
                    "description": "Optional. Token you are buying, as a symbol or address. Use it to disambiguate the direction.",
                    "type": "string"
                  },
                  "wallet": {
                    "description": "REQUIRED. Your own EVM address that will sign the swap.",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "type": "string"
                  }
                },
                "required": [
                  "strategyHash",
                  "chain",
                  "amount",
                  "wallet"
                ],
                "type": "object"
              },
              "method": {
                "const": "POST"
              },
              "type": {
                "const": "http"
              }
            },
            "type": "object"
          },
          "output": {
            "description": "One unsigned transaction that performs the swap.",
            "example": {
              "amountOut": "999000",
              "chain": "base",
              "note": "Sign with your own wallet. TRDEFI cannot sign or broadcast this.",
              "transactions": [
                {
                  "data": "0x...",
                  "to": "0x111111338c5091e8440b67b168bae16a668ac0de",
                  "value": "0"
                }
              ]
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "serviceName": "TRDEFI prepare swap",
      "tags": [
        "stablecoin swap",
        "usdc usdt swap",
        "non-custodial swap",
        "defi swap",
        "prepare transaction",
        "on-chain settlement",
        "liquidity"
      ]
    }
  },
  "tags": [
    "bazaar"
  ],
  "sourceHost": "yield.trdefi.com",
  "lastUpdated": "2026-10-12T00:46:27.289Z",
  "quality": {
    "calls30d": 2,
    "uniquePayers30d": 1,
    "lastCalledAt": "2026-10-12T00:46:25.608Z"
  },
  "metadata": {
    "extensions": {
      "bazaar": {
        "description": "Swap stablecoins against a live non-custodial liquidity position and receive the result on-chain. Give a strategy hash and an input amount; get back an unsigned transaction that settles the swap against that maker position. Use this when an agent needs to move USDC/USDT and prefers a real on-chain counterparty to a custodial venue: the swap is simulated first, and if it cannot succeed no transaction is returned at all, so a wallet is never handed one that is certain to revert.",
        "info": {
          "input": {
            "body": {
              "example": {
                "amount": "1000000",
                "chain": "base",
                "direction": "aToB",
                "strategyHash": "0x5928c6b6c24c08615ddde8b832e6f4b135550601e2bb903dba4123c1b8ff8f2c",
                "wallet": "0x0000000000000000000000000000000000000000"
              },
              "properties": {
                "amount": {
                  "description": "REQUIRED. Input amount in token base units, as an integer string, e.g. \"1000000\" for 1 USDC. Must be greater than zero.",
                  "type": "string"
                },
                "chain": {
                  "description": "REQUIRED. Network the position is on. Note this list differs from /v1/positions, which ships on `base`, `arc` and `baseSepolia` only.",
                  "enum": [
                    "ethereum",
                    "base",
                    "arbitrum",
                    "optimism",
                    "polygon",
                    "arc"
                  ],
                  "type": "string"
                },
                "direction": {
                  "description": "Which way round the pair to swap. Omit to let the route infer it from `tokenIn`/`tokenOut`.",
                  "enum": [
                    "aToB",
                    "bToA"
                  ],
                  "type": "string"
                },
                "strategyHash": {
                  "description": "REQUIRED. 32-byte strategy hash of the position to swap against.",
                  "pattern": "^0x[a-fA-F0-9]{64}$",
                  "type": "string"
                },
                "tokenIn": {
                  "description": "Optional. Token you are selling, as a symbol or address. Use it to disambiguate the direction.",
                  "type": "string"
                },
                "tokenOut": {
                  "description": "Optional. Token you are buying, as a symbol or address. Use it to disambiguate the direction.",
                  "type": "string"
                },
                "wallet": {
                  "description": "REQUIRED. Your own EVM address that will sign the swap.",
                  "pattern": "^0x[a-fA-F0-9]{40}$",
                  "type": "string"
                }
              },
              "required": [
                "strategyHash",
                "chain",
                "amount",
                "wallet"
              ],
              "type": "object"
            },
            "method": "POST",
            "type": "http"
          },
          "output": {
            "description": "One unsigned transaction that performs the swap.",
            "example": {
              "amountOut": "999000",
              "chain": "base",
              "note": "Sign with your own wallet. TRDEFI cannot sign or broadcast this.",
              "transactions": [
                {
                  "data": "0x...",
                  "to": "0x111111338c5091e8440b67b168bae16a668ac0de",
                  "value": "0"
                }
              ]
            },
            "type": "object"
          }
        },
        "schema": {
          "$schema": "https://json-schema.org/draft/2020-12/schema",
          "properties": {
            "input": {
              "properties": {
                "body": {
                  "example": {
                    "amount": "1000000",
                    "chain": "base",
                    "direction": "aToB",
                    "strategyHash": "0x5928c6b6c24c08615ddde8b832e6f4b135550601e2bb903dba4123c1b8ff8f2c",
                    "wallet": "0x0000000000000000000000000000000000000000"
                  },
                  "properties": {
                    "amount": {
                      "description": "REQUIRED. Input amount in token base units, as an integer string, e.g. \"1000000\" for 1 USDC. Must be greater than zero.",
                      "type": "string"
                    },
                    "chain": {
                      "description": "REQUIRED. Network the position is on. Note this list differs from /v1/positions, which ships on `base`, `arc` and `baseSepolia` only.",
                      "enum": [
                        "ethereum",
                        "base",
                        "arbitrum",
                        "optimism",
                        "polygon",
                        "arc"
                      ],
                      "type": "string"
                    },
                    "direction": {
                      "description": "Which way round the pair to swap. Omit to let the route infer it from `tokenIn`/`tokenOut`.",
                      "enum": [
                        "aToB",
                        "bToA"
                      ],
                      "type": "string"
                    },
                    "strategyHash": {
                      "description": "REQUIRED. 32-byte strategy hash of the position to swap against.",
                      "pattern": "^0x[a-fA-F0-9]{64}$",
                      "type": "string"
                    },
                    "tokenIn": {
                      "description": "Optional. Token you are selling, as a symbol or address. Use it to disambiguate the direction.",
                      "type": "string"
                    },
                    "tokenOut": {
                      "description": "Optional. Token you are buying, as a symbol or address. Use it to disambiguate the direction.",
                      "type": "string"
                    },
                    "wallet": {
                      "description": "REQUIRED. Your own EVM address that will sign the swap.",
                      "pattern": "^0x[a-fA-F0-9]{40}$",
                      "type": "string"
                    }
                  },
                  "required": [
                    "strategyHash",
                    "chain",
                    "amount",
                    "wallet"
                  ],
                  "type": "object"
                },
                "method": {
                  "const": "POST"
                },
                "type": {
                  "const": "http"
                }
              },
              "type": "object"
            },
            "output": {
              "description": "One unsigned transaction that performs the swap.",
              "example": {
                "amountOut": "999000",
                "chain": "base",
                "note": "Sign with your own wallet. TRDEFI cannot sign or broadcast this.",
                "transactions": [
                  {
                    "data": "0x...",
                    "to": "0x111111338c5091e8440b67b168bae16a668ac0de",
                    "value": "0"
                  }
                ]
              },
              "type": "object"
            }
          },
          "type": "object"
        },
        "serviceName": "TRDEFI prepare swap",
        "tags": [
          "stablecoin swap",
          "usdc usdt swap",
          "non-custodial swap",
          "defi swap",
          "prepare transaction",
          "on-chain settlement",
          "liquidity"
        ]
      }
    }
  },
  "liveness": {
    "reliability": null
  },
  "verified": false,
  "featured": false,
  "provider": {
    "host": "yield.trdefi.com",
    "manifest_name": "yield.trdefi.com",
    "source": "cdp-mirror",
    "source_manifest_url": "https://api.cdp.coinbase.com/platform/v2/x402/discovery/resources",
    "submitted_at": "2026-10-14T01:15:01.050Z"
  },
  "exampleResponse": {
    "amountOut": "999000",
    "chain": "base",
    "note": "Sign with your own wallet. TRDEFI cannot sign or broadcast this.",
    "transactions": [
      {
        "data": "0x...",
        "to": "0x111111338c5091e8440b67b168bae16a668ac0de",
        "value": "0"
      }
    ]
  }
}