Deposits & Withdrawals
Learn how to simulate depositing crypto into accounts and withdrawing crypto from them.
Before You Begin
Make sure you have a wallet address and id
noted down for an account. If you don't have an account, check out the create deposit wallet guide.
Deposit Crypto
Simulate Outside Deposits
Depositing USDC into your account for this guide requires using our Sandbox Management API to simulate it since external wallets cannot be managed by our API.
Depositing 500 USDC
1. Make a POST
request to https://sandbox.conduit.financial/sandbox/transactions
with the following body but replace the destination
wallet address with the one you noted down:
{
"data": {
"type": "ethereum-transaction",
"attributes": {
"assetType": "asset:eth:USDC",
"amount": "500000000",
"source": "0x0000000000000000000000000000000000000000",
"destination": "0x44a8938044c8f1a2cfd6ff7e66a46482377fa390"
}
}
}
Note
The assetType attribute indicates both the specific asset and the broader family of assets that the quantity is denominated in. For example, "asset:eth:USDC" indicates that the asset is USDC on the Ethereum network.
The amount attribute is a string and represents an integer indicating the number of the smallest unit of the corresponding asset type. For example, USDC is divided into millionths of a unit so the quantity 500 USDC is represented as "500000000"
2. If successful, you will see a similar response from the API:
{
"data": {
"id": "id:sandbox-trxn:2J8hJUxB5whE6I0yKCbP59t0qI0",
"type": "ethereum-transaction",
"attributes": {
"createdAt": "2022-12-19T15:59:05.920Z",
"assetType": "asset:eth:USDC",
"amount": "500000000",
"source": "0x0000000000000000000000000000000000000000",
"destination": "0x44a8938044c8f1a2cfd6ff7e66a46482377fa390",
"status": "completed"
}
}
}
Check Balance
Now that your deposit is confirmed, the deposited USDC should be available in your account. Let's verify this by querying the account and looking at the balance.
1. Make a GET
request to https://sandbox.conduit.financial/accounts/id:acct:2J8Ok1bfIrvpNcX2V8QwDMigUKE
but make sure to replace the account id
with yours.
2. If successful, you will see a response from the API that shows the balance increased by the deposited amount:
{
"data": {
"id": "id:acct:2J8Ok1bfIrvpNcX2V8QwDMigUKE",
"type": "account",
"attributes": {
"balances": {
"available": [
{
"assetType": "asset:eth:ETH",
"amount": "0"
},
{
"assetType": "asset:eth:USDC",
"amount": "500000000"
},
{
"assetType": "asset:eth:USDT",
"amount": "0"
},
{
"assetType": "asset:eth:DAI",
"amount": "0"
}
],
"pending": [
{
"assetType": "asset:eth:ETH",
"amount": "0"
},
{
"assetType": "asset:eth:USDC",
"amount": "0"
},
{
"assetType": "asset:eth:USDT",
"amount": "0"
},
{
"assetType": "asset:eth:DAI",
"amount": "0"
}
]
}
},
"relationships": {
"account-holders": {
"links": {
"self": "/accounts/id:acct:2J8Ok1bfIrvpNcX2V8QwDMigUKE/relationships/account-holders",
"related": "/accounts/id:acct:2J8Ok1bfIrvpNcX2V8QwDMigUKE/account-holders"
},
"data": [
{
"id": "id:ahl:2J8Ocs7KFZJt3CMPi9f0x8UCCQ0",
"type": "account-holder"
}
]
},
"allocations": {
"links": {
"self": "/accounts/id:acct:2J8Ok1bfIrvpNcX2V8QwDMigUKE/relationships/allocations",
"first": "/accounts/id:acct:2J8Ok1bfIrvpNcX2V8QwDMigUKE/relationships/allocations",
"next": null,
"related": "/accounts/id:acct:2J8Ok1bfIrvpNcX2V8QwDMigUKE/allocations"
},
"data": [
{
"id": "id:allc:2J8OkA50iEKCUdAP64xbgU14Irf",
"type": "allocation"
}
]
},
"wallets": {
"links": {
"self": "/accounts/id:acct:2J8Ok1bfIrvpNcX2V8QwDMigUKE/relationships/wallets",
"related": "/accounts/id:acct:2J8Ok1bfIrvpNcX2V8QwDMigUKE/wallets"
},
"data": [
{
"id": "id:wlt:2MW2qbpfnXZoUDUd7L2v1UQJuyQ",
"type": "wallet"
}
]
}
}
},
"included": [
{
"id": "id:allc:2J8OkA50iEKCUdAP64xbgU14Irf",
"type": "allocation",
"attributes": {
"effectiveYieldRate": "0",
"conduitTakeRate": "20",
"clientTakeRate": "0",
"poolId": "id:pool:2H1E3EPxcafvzFKOyoLUwO2PfcK",
"poolYieldRate": "0",
"accountId": "id:acct:2J8Ok1bfIrvpNcX2V8QwDMigUKE",
"poolName": "default_pool_usdc",
"balances": {
"available": [
{
"assetType": "asset:eth:ETH",
"amount": "0"
},
{
"assetType": "asset:eth:USDC",
"amount": "500000000"
},
{
"assetType": "asset:eth:USDT",
"amount": "0"
},
{
"assetType": "asset:eth:DAI",
"amount": "0"
}
],
"pending": [
{
"assetType": "asset:eth:ETH",
"amount": "0"
},
{
"assetType": "asset:eth:USDC",
"amount": "0"
},
{
"assetType": "asset:eth:USDT",
"amount": "0"
},
{
"assetType": "asset:eth:DAI",
"amount": "0"
}
],
"accruedYield": [
{
"assetType": "asset:eth:USDC",
"amount": "0"
},
{
"assetType": "asset:eth:USDT",
"amount": "0"
},
{
"assetType": "asset:eth:DAI",
"amount": "0"
}
]
}
}
},
{
"id": "id:wlt:2MW2qbpfnXZoUDUd7L2v1UQJuyQ",
"type": "wallet",
"attributes": {
"address": "wlt:eth:0x44a8938044c8f1a2cfd6ff7e66a46482377fa390",
"assetType": "asset:eth:USDC",
"networkId": "net:eth:ropsten",
"function": "deposit"
}
}
]
}
Withdraw Crypto
Withdraw 200 USDC
1. Make a POST
request to https://sandbox.conduit.financial/transactions
with the following body but replace the source
with the allocation you want to withdraw from (we'll use the default_pool_usdc
one from the example above) and the destination
with the wallet address you want to withdraw to:
{
"data": {
"attributes": {
"assetType": "asset:eth:USDC",
"amount": "200000000",
"source": "id:allc:2J8OkA50iEKCUdAP64xbgU14Irf",
"destination": "wlt:eth:0x0000000000000000000000000000000000000000"
}
}
}
2. If successful, you will see a similar response from the API:
{
"data": {
"id": "id:trxn:2JEmbbAXZ2TgNNNuchmSW916Bw7",
"type": "transaction",
"attributes": {
"createdAt": "2022-12-21T19:41:29.771Z",
"createdBy": "client",
"effectiveDate": "2022-12-21",
"amount": "200000000",
"source": "id:allc:2J8OkA50iEKCUdAP64xbgU14Irf",
"destination": "wlt:eth:0x0000000000000000000000000000000000000000",
"status": "pending",
"assetType": "asset:eth:USDC"
},
"relationships": {
"source": {
"links": {
"self": "/transactions/id:trxn:2JEmbbAXZ2TgNNNuchmSW916Bw7/relationships/source",
"related": "/transactions/id:trxn:2JEmbbAXZ2TgNNNuchmSW916Bw7/source"
},
"data": {
"id": "id:allc:2J8OkA50iEKCUdAP64xbgU14Irf",
"type": "id"
}
},
"destination": {
"links": {
"self": "/transactions/id:trxn:2JEmbbAXZ2TgNNNuchmSW916Bw7/relationships/destination",
"related": "/transactions/id:trxn:2JEmbbAXZ2TgNNNuchmSW916Bw7/destination"
},
"data": {
"id": "wlt:eth:0x0000000000000000000000000000000000000000",
"type": "wallet"
}
},
"quote": {
"links": {
"self": "/transactions/id:trxn:2JEmbbAXZ2TgNNNuchmSW916Bw7/relationships/quote",
"related": "/transactions/id:trxn:2JEmbbAXZ2TgNNNuchmSW916Bw7/quote"
},
"data": null
}
}
}
}
Check Balance
Now that your withdrawal is confirmed, the withdrawn USDC should be deducted from your account. Let's verify this by querying the account and looking at the balance.
1. Make a GET
request to https://sandbox.conduit.financial/accounts/id:acct:2J8Ok1bfIrvpNcX2V8QwDMigUKE
but make sure to replace the account id
with yours.
2. If successful, you will see a response from the API that shows the balance decreased by the withdrawn amount:
{
"data": {
"id": "id:acct:2J8Ok1bfIrvpNcX2V8QwDMigUKE",
"type": "account",
"attributes": {
"balances": {
"available": [
{
"assetType": "asset:eth:ETH",
"amount": "0"
},
{
"assetType": "asset:eth:USDC",
"amount": "300000000"
},
{
"assetType": "asset:eth:USDT",
"amount": "0"
},
{
"assetType": "asset:eth:DAI",
"amount": "0"
}
],
"pending": [
{
"assetType": "asset:eth:ETH",
"amount": "0"
},
{
"assetType": "asset:eth:USDC",
"amount": "200000000"
},
{
"assetType": "asset:eth:USDT",
"amount": "0"
},
{
"assetType": "asset:eth:DAI",
"amount": "0"
}
]
}
},
"relationships": {
"account-holders": {
"links": {
"self": "/accounts/id:acct:2J8Ok1bfIrvpNcX2V8QwDMigUKE/relationships/account-holders",
"related": "/accounts/id:acct:2J8Ok1bfIrvpNcX2V8QwDMigUKE/account-holders"
},
"data": [
{
"id": "id:ahl:2J8Ocs7KFZJt3CMPi9f0x8UCCQ0",
"type": "account-holder"
}
]
},
"allocations": {
"links": {
"self": "/accounts/id:acct:2J8Ok1bfIrvpNcX2V8QwDMigUKE/relationships/allocations",
"first": "/accounts/id:acct:2J8Ok1bfIrvpNcX2V8QwDMigUKE/relationships/allocations",
"next": null,
"related": "/accounts/id:acct:2J8Ok1bfIrvpNcX2V8QwDMigUKE/allocations"
},
"data": [
{
"id": "id:allc:2J8OkA50iEKCUdAP64xbgU14Irf",
"type": "allocation"
}
]
},
"wallets": {
"links": {
"self": "/accounts/id:acct:2J8Ok1bfIrvpNcX2V8QwDMigUKE/relationships/wallets",
"related": "/accounts/id:acct:2J8Ok1bfIrvpNcX2V8QwDMigUKE/wallets"
},
"data": [
{
"id": "id:wlt:2MW2qbpfnXZoUDUd7L2v1UQJuyQ",
"type": "wallet"
}
]
}
}
},
"included": [
{
"id": "id:allc:2J8OkA50iEKCUdAP64xbgU14Irf",
"type": "allocation",
"attributes": {
"effectiveYieldRate": "0",
"conduitTakeRate": "20",
"clientTakeRate": "0",
"poolId": "id:pool:2H1E3EPxcafvzFKOyoLUwO2PfcK",
"poolYieldRate": "0",
"accountId": "id:acct:2J8Ok1bfIrvpNcX2V8QwDMigUKE",
"poolName": "default_pool_usdc",
"balances": {
"available": [
{
"assetType": "asset:eth:ETH",
"amount": "0"
},
{
"assetType": "asset:eth:USDC",
"amount": "300000000"
},
{
"assetType": "asset:eth:USDT",
"amount": "0"
},
{
"assetType": "asset:eth:DAI",
"amount": "0"
}
],
"pending": [
{
"assetType": "asset:eth:ETH",
"amount": "0"
},
{
"assetType": "asset:eth:USDC",
"amount": "0"
},
{
"assetType": "asset:eth:USDT",
"amount": "0"
},
{
"assetType": "asset:eth:DAI",
"amount": "0"
}
],
"accruedYield": [
{
"assetType": "asset:eth:USDC",
"amount": "0"
},
{
"assetType": "asset:eth:USDT",
"amount": "0"
},
{
"assetType": "asset:eth:DAI",
"amount": "0"
}
]
}
}
},
{
"id": "id:wlt:2MW2qbpfnXZoUDUd7L2v1UQJuyQ",
"type": "wallet",
"attributes": {
"address": "wlt:eth:0x44a8938044c8f1a2cfd6ff7e66a46482377fa390",
"assetType": "asset:eth:USDC",
"networkId": "net:eth:ropsten",
"function": "deposit"
}
}
]
}
Next Steps
Now that you know how to deposit and withdraw crypto, let's try getting crypto with local fiat.