The endpoint plays a pivotal role in the preparation and execution of secure asset swaps on the blockchain. By providing a Quote ID and a destination address, users can initiate the signing process, resulting in the generation of the essential signature and transaction data. This signature and data package, in turn, is integral for ensuring the validity and security of asset transfers within the blockchain network.
Request
Body Param
Description
Example
quote_id
"4c707e45-7019-4b81-b875-c5eb6fe061d6"
destination_address
String - Required
It will receive the output token
"0x960376b3F62f41E7e66809a05D1C5afdFD60A0E9"
sender_address
String - Optional
it is for DEX aggregator partners that are using their own smart contract to mediate the interaction between users and Clipper. Aggregators should use the address of the account that they will pull tokens from (i.e., the EOA user address) as opposed to the address of their deployed contract. This is an optional value on signing requests - by default, destination_address will be used.
"0x960376b3F62f41E7e66809a05D1C5afdFD60A0E9"
aux_data
String(bit32) - Optional
It is for use the calldata swap feature, it can be set to any string and is used for identification purposes in the event logs. By default is 0x436c697070657200000000000000000000000000000000000000000000000000 that is the representation of Clipper
Bool - Optional
Send this as true if we want to get the bytes representation of the swap in the response. Client can use this to be sent directly to the pool contract for execution.
Default is false
true
native_input
Bool - Optional
If the input token is native (e.g. raw ETH), this value must be true. This will use the sellEthForToken contract function and will take the msg.value for the input. e.g ETH -> USDC
Default is false
This field is mutually exclusive with native_output
true
native_output
Bool - Optional
If the output token is native (i.e. raw ETH), this value must be true. This will use the sellTokenForEth contract function. e.g USDC -> ETH
Default is false
This field is mutually exclusive with native_input
true
In case that you want to deal with raw ETH or MATIC for input or output on the swap you should use native_input and native_output params. More details about Native Tokens can be found here.
Response
Sign object
Field
Description
chain_id
Integer - Represents the ID of the chain
input_asset_address
String - Contract address of the asset you want to provide for the swap
output_asset_address
String - Contract address of the asset you want to receive in the swap
input_amount
String - Amount of assets to be exchanged
output_amount
String - Amount of assets you will receive in the exchange
good_until
String - Number of seconds that quotes live. It can also contained a packed representation of the state
destination_address
String - Address will receive the output token
signature
clipper_exchange_address
String - Clipper contract address of the pool, is the address used when executing a transaction
calldata
String - Bytes representation of the swap function and parameters to be sent directly to the clipper_exchange_address for execution
Examples
Without calldata
If you want to sign a quote and manually use the values in the response to create the transaction.