Skip to main content
POST
/
accounts
/
swap
/
crypto
Create a crypto swap account
curl --request POST \
  --url https://api.platform.dakota.xyz/accounts/swap/crypto \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --header 'x-idempotency-key: <x-idempotency-key>' \
  --data '
{
  "destination_id": "1NFHrqBHb3cTfLVkFSGmHZqdDPi",
  "destination_asset": "USDC",
  "source_asset": "USDC",
  "source_network_id": "ethereum-mainnet",
  "return_crypto_address": {
    "network_id": "ethereum-mainnet",
    "crypto_address": "0x165cd37b4c644c2921454429e7f9358d18a45e14"
  },
  "developer_fee_bps": 50
}
'
{
  "id": "1NFHrqBHb3cTfLVkFSGmHZqdDPi",
  "source_crypto_address": "0x1234",
  "source_network_id": "ethereum-mainnet",
  "destination": {
    "destination_id": "1NFHrqBHb3cTfLVkFSGmHZqdDPi",
    "destination_type": "crypto",
    "name": "My Ethereum Wallet",
    "crypto_address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "family": "evm",
    "network_id": "ethereum-mainnet"
  },
  "source_asset": "USDC",
  "destination_asset": "USDC"
}

Authorizations

x-api-key
string
header
required

Headers

x-idempotency-key
string<uuid>
required

Unique key to ensure request idempotency. If the same key is used within a certain time window, the original response will be returned instead of executing the request again.

Body

application/json
destination_id
string
required

KSUID is a 27-character globally unique ID that combines a timestamp with a random component. Used for all entity identifiers in the Dakota platform.

Required string length: 27
Example:

"1NFHrqBHb3cTfLVkFSGmHZqdDPi"

destination_asset
string
required

Asset to receive at the destination.

Minimum string length: 1
Example:

"USDC"

source_asset
string
required

Asset to send into the account. Use 'any' to accept any supported asset (USDC, USDT, DKUSD).

Minimum string length: 1
Example:

"USDC"

source_network_id
string
required

Network ID (e.g., ethereum-mainnet, base-mainnet, polygon-mainnet) or 'evm' to accept any EVM mainnet chain we currently support.

Example:

"ethereum-mainnet"

return_crypto_address
Crypto Resource Identifier · object

Optional address to return crypto back to if the transaction fails.

Validation Rules:

  1. Specific network (e.g., source_network_id: "ethereum-mainnet"):

    • At account creation, the return address network must exactly match the source network.
    • At transaction time, failed transactions are returned to this address.
  2. EVM wildcard (source_network_id: "evm"):

    • At account creation, the return address must be any EVM network we support (ethereum-mainnet, base-mainnet, polygon-mainnet, arbitrum-mainnet, optimism-mainnet, avalanche-mainnet).
    • At transaction time, if the actual transaction network matches the return address network, failed transactions are returned to this address.
    • If the networks don't match, the system falls back to return-to-sender (sender's address).
  3. Not provided:

    • Failed transactions are automatically returned to the sender's address (return-to-sender policy).
developer_fee_bps
integer<int32>

Developer fee in basis points (1 bp = 0.01%). Only available for authorized clients.

Required range: 0 <= x <= 10000
Example:

50

Response

Crypto swap account created successfully

id
string
required

KSUID is a 27-character globally unique ID that combines a timestamp with a random component. Used for all entity identifiers in the Dakota platform.

Required string length: 27
Example:

"1NFHrqBHb3cTfLVkFSGmHZqdDPi"

source_crypto_address
string
required
Example:

"0x1234"

source_network_id
enum<string>
required

Identifier for a blockchain network

Available options:
ethereum-mainnet,
ethereum-sepolia,
ethereum-goerli,
ethereum-holesky,
solana-mainnet,
solana-devnet,
solana-testnet,
base-mainnet,
base-sepolia,
arbitrum-mainnet,
arbitrum-sepolia,
optimism-mainnet,
optimism-sepolia,
avalanche-mainnet,
avalanche-fuji,
polygon-mainnet,
polygon-amoy
Required string length: 1 - 30
Example:

"ethereum-mainnet"

destination
Crypto Destination Response · object

Response for a crypto destination.

source_asset
string

Asset to send into the account.

Example:

"USDC"

destination_asset
string

Asset to receive at the destination.

Example:

"USDC"