1

ideally i will like to add more logic (like fowarding funds or fees) to the quote.data before letting a user send the transaction to the blockchain.

1 Answer 1

0

If I understand correctly you want to create a quote that includes affiliate fee and that fee be forwarded to an address.

On the 0x docs api documention here: https://docs.0x.org/0x-api-swap/api-references/get-swap-v1-quote#request you have the fields feeRecipient and buyTokenPercentage which could be used to get a fee on top of your quote.

For instance: https://api.0x.org/swap/v1/quote?buyToken=DAI&sellToken=WETH&sellAmount=100000000000000000&buyTokenPercentageFee=0.1&feeRecipient=0x5bd68b4d6f90bcc9f3a9456791c0db5a43df676d

You are getting a quote here to buy DAI with WETH, with a percentage fee of 0.1% that will be attributed to address 0x5bd68b4d6f90bcc9f3a9456791c0db5a43df676d

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.