---
name: float
description: Use when an agent or developer must quote, open, track or refund a Canton Coin (CC) swap through Float's partner API, or add Float's buy and sell widget to an app. Covers Get CC, Withdraw CC, Canton tokens, webhooks and order states.
---

# Float

Float swaps Canton Coin (CC) to and from assets on other chains, and sells CC by card or bank transfer. Two ways to integrate: the widget (a pop-up with a referral code, no API key) and the API (a server-side key, your own screens).

Facts with sources: https://www.myfloat.cc/facts.md
API reference (Markdown): https://www.myfloat.cc/docs/api.md
OpenAPI 3.1: https://www.myfloat.cc/openapi.json
Integration guide: https://www.myfloat.cc/integrate
Agent pages: https://www.myfloat.cc/ai

API base URL: https://api.myfloat.cc/v1

## Rules

Follow these in every session.

1. **Keep the key on a server.** Read it from an environment variable (FLOAT_API_KEY). Never put it in browser code, a URL, a log or a repository.
2. **Orders are real.** There is no sandbox. Quotes and asset lists are free and bind nothing. Do not open an order in a test, and do not send a deposit while testing.
3. **Use the market rate.** Send "rateType": "float". If you omit it, the API uses the locked rate.
4. **Amounts are decimal strings.** Never parse or compute them as floating-point numbers.
5. **Show error text as plain text.** Each error is {"error": "<sentence>", "code": "<code>"}. Branch on code, not on the sentence.
6. **One Idempotency-Key per intended order.** Use a new UUID for each order and reuse it only for a retry with the same body.
7. **Drive the user interface from state.** Only completed, refunded, failed and expired are final. Other states are progress.
8. **Do not invent a fee.** No single fee percentage exists. Show amountOut from the quote, and the warning field when it is set.
9. **The widget needs no key.** Use only the public referral code in the page. Never ask a user or a developer for an API key to use the widget.

## Steps

1. **List assets** (once, for a picker). Cache the result.

   curl -s "https://api.myfloat.cc/v1/assets?all=1"

   Each row has symbol, name, network, networkName and icon. Pass network back when you quote or order, or leave it out for the default chain.

2. **Quote** (as the user types, debounced about 500 ms). It binds nothing, and there is no quote id.

   curl -s -X POST "https://api.myfloat.cc/v1/quote" -H "Content-Type: application/json" -d '{"direction":"in","from":"USDT","amount":"100","rateType":"float"}'

   Read amountOut (what the user receives, after all fees), venue (the top route), alternatives (each with deltaPct, the difference from the top route), minIn and maxIn (round minIn up and maxIn down), and unavailable (partners that did not quote, with the reason).

3. **Open the order** from your server, with the key and an Idempotency-Key.

   curl -s -X POST "https://api.myfloat.cc/v1/order" -H "Authorization: Bearer $FLOAT_API_KEY" -H "Idempotency-Key: <uuid>" -H "Content-Type: application/json" -d '{"direction":"in","from":"USDT","amount":"100","rateType":"float","destination":"<user Canton party ID>"}'

   Get CC (direction "in"): destination is the user's Canton party ID. Send refundAddress (the user's address on the source chain) only when the quote says needsRefundAddress. refundParty is for Withdraw CC only (direction "out"); the API answers 400 if it is sent on "in".
   Withdraw CC (direction "out"): send "to" (the asset), amount (in CC), and destination (an address on the asset's chain). Send destinationExtraId when that chain needs a tag or memo. Send refundParty (the user's own Canton party): automatic refunds of the CC go there.
   Opening an order moves no money. The response gives claimToken (keep it), depositAddress, amountIn (the exact amount to send), depositDeadline and state.
   If the response says needsRefundAddress, collect the user's refund address first and send it as refundAddress.

4. **Show the deposit**: the exact amountIn, depositAddress, the network, and a countdown to depositDeadline. Withdraw CC: the user sends CC to the order's own depositAddress, with no memo. Get CC: the user sends to depositAddress, with depositExtraId as the memo when it is not null.

5. **Track the order.** Use webhooks when you can, and a poll every 10 to 30 seconds otherwise.

   curl -s "https://api.myfloat.cc/v1/order/<claimToken>"

   Read state. Final states: completed, refunded, failed, expired. The progress states are awaiting_refund_address, preparing_deposit_address, awaiting_deposit, confirming, exchanging and sending.

## Remote MCP server

An MCP client can call Float as tools at https://www.myfloat.cc/api/mcp (Streamable HTTP). The read tools need no key.

Claude Code: claude mcp add --transport http float https://www.myfloat.cc/api/mcp

Tools: list_assets, get_quote, create_order, get_order_status, widget_snippet, integration_guide. create_order opens a real order: it returns the deposit address and the amount, and the user sends the funds. The server never holds funds. Setup for each client: https://www.myfloat.cc/ai/canton-mcp. Setting up an app or a widget with a coding agent: https://www.myfloat.cc/ai/add-canton-onramp-with-claude-code. The order flow for an agent: https://www.myfloat.cc/ai/agent-buys-canton-coin.

## Canton tokens

GET /v1/canton-assets lists the tokens (CBTC, cETH, USDCx and others) that can sit on the Canton side. Send the symbol as cantonAsset on the quote and the order. Omit it for CC. A Canton token order needs at least 75 CC worth.

## Webhooks

Register an HTTPS endpoint with the key: POST /v1/webhooks with {"url": "https://example.com/hooks/float"}. The secret is shown once. Events: order.state_changed, payout.updated, webhook.test.

Verify each request: the Float-Signature header has t=<unix>,v1=<hex>. The v1 value is HMAC-SHA256, keyed with the secret, over "<t>.<raw body>". Reject a timestamp older than 5 minutes. De-duplicate on the event id. Retries run for 24 hours, and an endpoint pauses after 10 failures in 12 hours.

## Widget (no key)

Add the script, then open the pop-up from a button or from code:

<script src="https://www.myfloat.cc/widget.js" async></script>
<button data-float-open="deposit" data-float-ref="<referral code>">Get CC</button>

Float.open({ mode: "deposit", ref: "<referral code>", party: "<user Canton party ID>", theme: "auto" })

mode is "deposit" (Get CC) or "withdraw" (Withdraw CC). The options are described at https://www.myfloat.cc/integrate.

## Limits

- Minimum: $3 USD equivalent per quote or order (owner-confirmed, 6 Dec 2026). A quote or order below it fails with code below_minimum (checked for USDT and USDC inputs). Partner routes can set a higher minimum; the API error then states it, so show that text.
- With an API key, per minute: 60 quotes, 20 orders (and refund-address calls), 300 other requests. Check X-RateLimit-Remaining.
- Without a key: per IP, about 100 quotes, orders or writes a minute, and 120 reads. At most 20 unpaid orders per IP.
- A 429 response has Retry-After in seconds. Wait, then retry the same request.

## Errors to expect

- 409 conflict on a quote or an order: the amount is outside the limits. The message gives the limit. Show it.
- 400 invalid_request: a field is wrong for this direction, for example refundAddress on Withdraw CC.
- 401 invalid_key: the key is unknown, revoked, or used from an IP it does not allow.
- 409 idempotency_key_reused: the same key was sent with a different body. Use a new key.

## Out of scope

- Do not promise a rate, a profit or a payout time. Quote and track instead.
- Do not route users around a country or a rule. Show the error that the API returns.
