Create Swap
Private
Create Swap
Execute a previously estimated swap.
Required flow:
- Call
estimatefirst — never skip this step. - Call this endpoint with the same
src_asset,dst_asset, and the same one ofreq_spend_amountorreq_get_amountused inestimate. Also passexpected_priceset to theestimated_price_exactvalue returned byestimate— this provides slippage protection; if the market has moved beyond tolerance the swap is rejected, in which case re-estimate and retry. - On success, the response includes the swap
idand an initialstatusofprocessing. Check the retrieve operation with thatidroughly once per second for up to 10 seconds until processing completes.
POST
Create Swap
Authorizations
Personal API key, created in the Digital Surge app under Account Settings → API Keys. Send it with every request as Authorization: Bearer <your-api-key>.
Body
A swap: a market-price trade of one asset directly for another (AUD → crypto is a buy, crypto → AUD a sell).
Response
A swap: a market-price trade of one asset directly for another (AUD → crypto is a buy, crypto → AUD a sell).
5- quote10- pending12- estimated15- processing20- error40- rejected60- processed
Available options:
5, 10, 12, 15, 20, 40, 60 Final amount bought by the customer
Final amount sold by the customer
Net amount, after subtracting the fee
Total amount, incl. the fee