Stablecoin Conversion

The Conversion API allows you to price, confirm, and monitor asset conversions within a portfolio. The typical flow involves:

  1. Create Quote → Price the conversion request.
  2. Show rate, fee, and valid_until to the customer.
  3. Create Hedge → Confirm the conversion using the quote_id.
  4. Retrieve Hedge → Monitor hedge execution status, fills, and timestamps.

Create Quote

Endpoint

POST /v1/portfolios/portfolio_id/conversions/quote

Purpose

Generate a short-lived quote for converting between two assets. Use this to display pricing and fees to your customer before execution.

Request Parameters

FieldTypeRequiredDescription
from_assetobjectYes/NoSource asset details. Must include asset, network, and optionally amount (if not providing to_asset.amount).
to_assetobjectYes/NoTarget asset details. Must include asset, network, and optionally amount (if not providing from_asset.amount).

Example Request

{
  "from_asset": {
    "asset": "USD",
    "network": "US_ACH",
    "amount": "1000.00"
  },
  "to_asset": {
    "asset": "USDC",
    "network": "ETH"
  }
}

Example Response

{
  "quote_id": "1f581bfe-25de-42aa-9429-6802412850b3",
  "rate": "1.0000",
  "fee": "5.00",
  "fee_asset": "USD",
  "from_asset": {
    "asset": "USD",
    "network": "US_ACH",
    "amount": "1000.00"
  },
  "to_asset": {
    "asset": "USDC",
    "network": "ETH",
    "amount": "995.00"
  },
  "valid_until": "2025-08-21T07:56:57.981Z",
  "created_at": "2025-08-21T07:56:57.981Z",
  "modified_at": "2025-08-21T07:56:57.981Z"
}

Create Hedge

Endpoint

POST /v1/portfolios/portfolio_id/conversions/hedge

Purpose

Confirm the quote and lock the conversion into a hedge. This step reserves funds and ensures execution.

Request Parameters

FieldTypeRequiredDescription
quote_idstringYesIdentifier from Create Quote that you wish to hedge.

Example Request

{
  "quote_id": "1f581bfe-25de-42aa-9429-6802412850b3"
}

Example Response

{
  "hedge_id": "hedge-uuid",
  "conversion_id": "conv-uuid",
  "status": "pending",
  "executed_at": null,
  "created_at": "2025-08-21T08:00:01.000Z"
}

Retrieve Hedge

Endpoint

GET /v1/portfolios/portfolio_id/conversions/hedge

Purpose

Retrieve hedge details for a specific conversion, including execution status and timestamps.

Response Fields

FieldTypeDescription
hedge_idstringUnique identifier for the hedge.
conversion_idstringAssociated conversion transaction.
statusstringCurrent state of the hedge (e.g., pending, executed, failed).
executed_atdatetimeTimestamp when the hedge was executed (if applicable).
created_atdatetimeTimestamp when the hedge was created.
updated_atdatetimeLast update timestamp for the hedge record.
fillsarrayList of partial or full execution details (if hedge is filled).

Example Response

{
  "hedge_id": "hedge-uuid",
  "conversion_id": "conv-uuid",
  "status": "executed",
  "executed_at": "2025-08-21T08:05:10.000Z",
  "created_at": "2025-08-21T08:00:01.000Z",
  "updated_at": "2025-08-21T08:05:10.000Z",
  "fills": [
    {
      "fill_id": "fill-uuid-1",
      "amount": "500.00",
      "asset": "USDC",
      "network": "ETH",
      "executed_at": "2025-08-21T08:03:00.000Z"
    },
    {
      "fill_id": "fill-uuid-2",
      "amount": "495.00",
      "asset": "USDC",
      "network": "ETH",
      "executed_at": "2025-08-21T08:05:10.000Z"
    }
  ]
}