Stablecoin Deposits

Let users add funds by sending stablecoins to a deposit address. Addresses are per-account, per-chain, reusable, and never expire.
┌──────────┐     ┌───────────────────────────┐     ┌──────────┐
│ Your app │     │ Deposit Address            │     │Stableyard│
│          │ ──► │ 0xABC...                   │ ──► │          │
│ Shows    │     │ (reusable, never expires)  │     │ Detects  │
│ address  │     │ Accepts from ANY chain     │     │ deposit  │
│ to user  │     │                            │     │ Routes   │
│          │ ◄── │                            │ ◄── │ Settles  │
│ Credits  │     │                            │     │ Webhook  │
│ balance  │     └───────────────────────────┘     └──────────┘
└──────────┘

Flow

Your server: POST /v2/deposits/addresses { account, chain }
→ Get deposit address (one-time, then reuse forever)
→ Show address to user in your app
→ User sends USDC/USDT from any chain to the address
→ Call POST /v2/deposits/settle { accountId, chainId }
→ Token auto-detected (no need to specify currency)
→ Routes if cross-chain
→ Webhook: deposit.detected → payment.settled
→ Your server credits user balance

Create a Deposit Address

curl -X POST https://api.stableyard.fi/v2/deposits/addresses \
  -H "Authorization: Bearer sy_secret_*" \
  -H "Content-Type: application/json" \
  -d '{ "account": "acc_alice", "chain": "polygon" }'
Address generation by chain:
  • EVM: CREATE2 via factory contract (deterministic from accountId + chainId salt)
  • Solana: Wallet manager service
  • Movement: Wallet manager service

Settle with Auto-Detection

After a user sends tokens, call settle. It queries all supported tokens and picks the one with a balance — no need to know which token was sent.
curl -X POST https://api.stableyard.fi/v2/deposits/settle \
  -H "Authorization: Bearer sy_secret_*" \
  -H "Content-Type: application/json" \
  -d '{ "accountId": "acc_alice", "chainId": 137 }'

How Auto-Detection Works

VMMethod
EVMbalanceOf call on each ERC20 contract via RPC
Solana (SVM)getTokenAccountsByOwner with SPL Token Program, match mint addresses
Movement (MoveVM)Aptos REST API, match 0x1::coin::CoinStore<CoinType> resources
The token with the highest non-zero balance is selected. If no token has balance, returns no_funded_token error.

Multi-Chain Deposits

Users can have deposit addresses on multiple chains simultaneously:
Polygon:   0xALICE_POLY   (chainId: 137)
Base:      0xALICE_BASE   (chainId: 8453)
Solana:    AliceSolAddr   (chainId: 103)
Movement:  0xALICE_MOVE   (chainId: 2)
Cross-chain routing happens automatically if the deposit chain differs from the account’s settlement chain.