Conversions

Convert your balance from one currency to another. Conversions are opened per tenant: until they are opened for you, every call answers 501 not_available_yet, including the quote. That is not your key.

Pairs

GET /v1/pairs
{"pairs": [{"from_currency": "USDT_TRC20", "to_currency": "BTC",
            "rate": "0.0000127", "rate_age_seconds": 12,
            "minimum": "...", "minimum_usd": "...", "usd_unavailable": []}]}

A pair is listed when we deal in both currencies, the custodian lists both, and we hold a fresh price. A pair whose price went stale is absent rather than listed. rate is the market, with no fee applied.

Field
minimumThe least you can convert, in from_currency: the larger of the custodian's floor for the pair and minimum_usd valued in that currency now, rounded up to its decimals. The custodian's floor applies to the amount after the fee: amount − customer_fee must reach it, so an amount equal to minimum is refused when that floor is the larger and a fee is charged. null when neither is known; null is not zero
minimum_usdThe smallest conversion your SWAP fee row states, in US dollars (GET /v1/fees minimum_amount_usd); null when it states none
usd_unavailableEmpty, unless minimum_usd is set and we cannot value from_currency in dollars right now: then minimum is null and this says why. A quote from that currency is refused until we can

GET /v1/currencies answers per currency its decimals (places after the point on its chain: USDT_TRC20 6, BTC 8), whether we deal in it, whether the custodian lists it right now, whether we can price it, and whether you have a verified address to take it out to. When the custodian could not be reached, custodian_read is false and every custodian_lists is null rather than false.

Quote

POST /v1/quotes

{"product": "SWAP", "amount": {"amount": "10", "currency": "USDT_TRC20"}, "to_currency": "BTC",
 "partner_reference": "order-17", "customer_external_id": "user-42"}

partner_reference and customer_external_id are optional labels of yours, up to 120 characters each, answered on the quote.

Answers id, expires_at, valid_for_seconds, amount, customer_fee, binding_floor, amount_received, exchange_rate, rate_locked and rate_observed_at. Nothing is reserved and no money moves. Pass the id as quote_id on the swap and that is the fee you are charged.

Field
valid_for_secondsWhole seconds left, by our clock. Count this down rather than reading expires_at against your own clock
rate_lockedfalse: the quote fixes customer_fee; exchange_rate and amount_received are an estimate, and the swap credits what the conversion produced (to_amount). true on a quote filled from our own stock (Fiat and USDT): a swap at it delivers exactly amount_received
customer_feeIn the currency of amount: your percentage, or your fee floor when that is higher. A floor in US dollars (minimum_fee_usd) is valued in that currency when the quote is made
binding_floorBASE_FEE: the percentage. MINIMUM_FEE: your fee floor. PROVIDER_RETAIL_FLOOR: the pair costs more than the percentage
amount_receivedThe estimate of what arrives: (amount − customer_fee) × exchange_rate, less our estimate of the custodian's own conversion fee, rounded to the decimals of to_currency

A quote is refused 422 validation_failed, with nothing written:

detail
amount, minimum, minimum_usd, reasonYour SWAP fee row states minimum_amount_usd and the amount is under the pair's minimum. reason says whose floor it is: the custodian's, or your own smallest conversion. While your row states none, a quote under the custodian's floor is priced and the swap is refused
amount, customer_fee, amount_to_convert, minimum, reasonYour SWAP fee row states minimum_amount_usd and amount − customer_fee (amount_to_convert) is under the custodian's floor for the pair (minimum). While your row states none, such a quote is priced and the swap is refused
amount, customer_fee, binding_floor, reasonThe fee is not below the amount: nothing would be converted
pricingYour fee row states a floor in US dollars and the currency cannot be valued in dollars right now

A swap quote lives requests.quote_lifetime_seconds on GET /v1/limits, 120 today; a bank payout quote in another currency about 30 seconds (Bank accounts).

Swap

POST /v1/swaps
Idempotency-Key: <your record id>

{"amount": {"amount": "10", "currency": "USDT_TRC20"},
 "to_currency": "BTC",
 "quote_id": "...",
 "partner_reference": "order-17",
 "customer_external_id": "user-42"}
status
PENDINGCreated, not yet with the custodian
SUBMITTEDWith the custodian
SETTLEDDone. to_amount is what arrived
FAILEDDid not happen. The source is back on your balance
UNKNOWNNot yet accounted for, with unresolved: true. Do not retry

Read with GET /v1/swaps/{swap_id} or GET /v1/swaps?status=, or follow swap.* events.

Fiat and USDT

Where we open it for you, a conversion between a fiat currency your bank accounts hold and USDT_TRC20 is filled from our own stock, at once:

POST /v1/swaps
Idempotency-Key: <your record id>

{"customer_id": "...", "amount": {"amount": "100.00", "currency": "USD"},
 "to_currency": "USDT_TRC20", "deliver_to": "float"}

Not open yet: every call answers 501 not_available_yet.

The customer sends a coin from their own wallet and USDT_TRC20 arrives at one of the deposit addresses we issued you. Nothing is held on your balance.

GET /v1/swaps/incoming/pairs lists what the customer can pay with now: from_currency, from_network, rate_types, minimum, maximum (in the currency sent) and refund_memo.

POST /v1/swaps/incoming/quote

{"amount": {"amount": "0.01", "currency": "BTC"},
 "to_currency": "USDT_TRC20",
 "customer_country": "DE"}

Answers to_amount_estimated, customer_fee, amount_received, minimum, maximum, minimum_usd. It keeps nothing and locks no rate.

POST /v1/swaps/incoming
Idempotency-Key: <your record id>

{"amount": {"amount": "0.01", "currency": "BTC"},
 "to_currency": "USDT_TRC20",
 "customer_country": "DE",
 "deposit_address_id": "...",
 "refund_address": {"address": "bc1q..."},
 "min_amount_received": {"amount": "580", "currency": "USDT_TRC20"},
 "partner_reference": "order-17",
 "customer_external_id": "user-42"}
progress
waiting_for_paymentCreated; the customer has not paid
confirming, exchanging, sendingPaid, on its way
on_holdThe payment is being checked; hold_reason says which check
finishedSent to the deposit address
refundedReturned to refund_address; refund_tx_hash, refund_amount
failedDid not happen
declinedWe declined it after a check

On hold:

hold_reasonTell your user
under_reviewWe are checking the paymentThe swap is under review
verification_requiredThe customer is asked to verify themselvesThe swap waits for verification

Read with GET /v1/swaps/incoming/{swap_id}.

How it ends:

status
SUBMITTEDCreated; not finished
SETTLEDThe coins were read at the deposit address and confirmed. to_amount is what arrived, customer_fee our fee on it, amount_received what is left, deposit_id the deposit
FAILEDNo coins came, or we declined it. reason: refunded (sent back to refund_address), failed, expired (never paid), or declined

Your balance

Call
GET /v1/floatPer currency: available (act on this), held (taken by an operation in flight), total
GET /v1/float/statement?currency=Every movement on one currency, oldest first, with a running balance. No cursor: when truncated is true, narrow since / until
GET /v1/registerEvery operation, newest first, with its fee and transaction hash. Pages on an opaque cursor
GET /v1/register/summaryTotals by kind, currency and status

Every balance is summed from ledger entries; there is no balance column to disagree with them.

Halts

503 temporarily_halted means we have stopped conversions, withdrawals and transfers for everyone. Our hourly solvency check or one of our operators opens the halt; only a person clears it. detail.reason says why (for a halt an operator opened, the fixed text stopped by an operator) and detail.halted_since when. Back off and retry. GET /v1/halt (any key) says whether it is open, since when, and a reason with no amounts.