0

I am planning to create an app that connects to the Binance account of the user (API) and trades automatically with his credentials. If transactions (only one buy and sell pair) successfully earn BTC, then I would like to receive a fee (a percentage of the utility). If the transactions don't earn money, then there is no fee. As the Binance API can only be used for trade I can not collect the fee automatically from that API. So, I would like a smart contract collect the fee from user, prior to the transactions (based on the investment quantity and the expected percentage of profit entered by the user) and if transactions earn money (buy and sell pair) then the fee is sent to my address and if not, the fee is returned to the user address. Is it possible to do something like this?. Is ethereum network the best option, or I need to use chainlink or another provider like that one?

1

All blockchains are deterministic, which means that they can only use data which is already inside them. They can't connect directly to external systems, such as APIs.

There are ways to get external data into the blockchain for contracts to use, called oracles, but I would not recommend that path for you. Using an oracle simply means that an external system sends a transaction to the blockchain to input the required data.

For your use case, Ethereum simply isn't a suitable option. All of your trading is done outside Ethereum and you would need to input data into your Ethereum contract often to calculate the fees. Since transactions are expensive in Ethereum, this would cost far more than you'd collect from fees and would introduce a lot of moving parts.

2
  • Thank you for your fast answer. So that means, that I must to wait for a cheaper way to do that, right?. I have pointed out that IOTA is developing a smarts contract without fees, so that would be a good solution? – Juan Jara Mar 8 at 14:19
  • I don't think any blockchain is a good solution for you, since the trading happens outside blockchains. Even if the transactions are for free, the blockchain doesn't provide much benefits, because users would still need to trust your systems to input the correct data, even if on-chain contracts are honest – Lauri Peltonen Mar 8 at 14:21

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.