I'm currently trying to use the 1inch API documented here: https://docs.1inch.io/api/nodejs-web3-example

I would be interested in using the 1inch pathfinder api from a solidity smart contract to make swaps programmatically. The problem is that the way the api works is that you call the HTTP api and you get the transaction calldata already compiled that only needs to be signed and sent to the network. So basically there is no smart contract to invoke from solidity (like with other dexes).

What I was wondering was if it would be possible to use the api to get the calldata for a given swap and then, providing this calldata to a smart contract, integrate this swap as an operation made by the smart contract.

I'm not an expert in solidity and I don't know if what I'm asking is even possible, but anyway thanks to anybody that will answer.

Note: I know originally the 1split protocol was a smart contract deployed on the blockchain but that has been deprecated and is not available on the bsc chain, where I also want to operate, so it isn't a viable option.

1 Answer 1


A minimal example showing how to integrate 1inch in your smart contract using Brownie https://github.com/smye/1inch-swap this may help you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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