Agent flow

An AI agent quotes and opens a Canton Coin order

The agent prices the swap and opens the order. The user pays from their own wallet. The agent never holds the funds, and it does not send them.

Steps

  1. Ask the user for the asset to send, the amount, and their Canton party ID.
  2. Check the symbol and network with list_assets.
  3. Price the swap with get_quote and rateType float. Show amountOut and any warning.
  4. Show the plan: asset, amount, the amount the user receives, and the party ID. Get a yes.
  5. Open the order with create_order. Pass the user's party ID as destination.
  6. Show the user depositAddress, the exact amountIn, the network and depositDeadline. Give them status_link.
  7. The user sends from their own wallet. The agent does not send.
  8. Check get_order_status until the state is final. Report the state in plain words.

The calls

list_assets  { "query": "USDT" }
get_quote    { "direction": "in", "from": "USDT", "amount": "100", "rateType": "float" }
create_order { "direction": "in", "from": "USDT", "amount": "100", "rateType": "float",
               "destination": "<user Canton party ID>" }
get_order_status { "order_id": "<claimToken from create_order>" }

Rules for the agent

Withdraw CC

To send CC out, set direction to out, give to (the asset), amount (in CC) and destination (an address on that chain). Add refundParty, the user’s own Canton party. The user sends CC to the order’s own deposit address, with no memo. The full field list is in the API reference.

The state list, with what the agent should say for each one, is in skill.md.