User Flow
Flow participants
The process involves 3 main participants:
- the user or partner, who initiates the swap,
- provider (Changelly DeFi), who connects partner application with best execution quote,
- and the resolver, who executes swap.
Changelly DeFi supports main user flows to provide the best quotes:
- Offchain: An intent-based flow where the user signs a swap intention off-chain, authorizing the resolver's smart contract to deduct funds from their wallet via specialized mechanisms.
- Onchain: The swap transaction is directly signed and submitted to the network by the wallet holder.
- Deposit: A scenario where the user receives a unique resolver address to transfer funds via an on-chain transaction to start the DeFi swap.
Offchain (Intent-based) scenario
- Quote request: a time-bound estimation of the exchange. The quote has a limited, predefined lifespan and a slippage tolerance coefficient to find the best rate; the quote also explicitly depends on the method of depositing funds to initiate the swap.
- Creating an exchange intent: the partner places an off-chain request indicating their intent to execute an exchange based on the previously requested quote. The intent is strictly tied to the quote and its parameters.
- Signing the intent: the approval and signing procedure is performed using the partner's own key.
- Resolver action: the resolver receives information about the signature through us and executes the exchange according to the previously transmitted parameters.
- Swap execution: the swap is executed via the provider on the resolver. The partner can track their transaction through the network and a block explorer, or by calling our DeFi API GET methods.
Importantly, signing is performed entirely on the partner's side; Changelly DeFi does not and cannot perform any additional signing.
Deposit scenario
- Quote request: a time-bound estimation of the exchange. The quote has a limited, predefined lifespan and a slippage tolerance coefficient to find the best rate.
- Creating an exchange intent: the partner forms an exchange intent via our API, which is strictly tied to the quote and its parameters.
- Polling the intent status: done to obtain the deposit address.
- Depositing funds: executing the deposit to the received address (the exact amount specified in the quote).
- Swap execution: followed by the standard swap procedure on the provider/resolver.
During execution, the transaction may exceed the slippage tolerance or fail for other reasons—a refund address is provided for this purpose.
info
If the desired token is not in the list of available, you can provide a custom contract address and network_id to request a quote.