This question already has an answer here:
I haven't written any contract yet, but would like to know if this is something that can be done. Lets say I write a smart contract to pay someone if his ethereum address goes below a certain amount say less than 1 ether.
I understand the smart contract can detect the amount of funds it has in the account, but the question is does the contract have to continually run/check the addresses balance?
What if I tell the contract to check the balance every 1 day for 365 days? That's 365 gas fee right? And if I pay this fee, doesnt this mean the contract is always on for an entire year? What if I didn't want to check an ether address, but a bitcoin address?
I'm just curious to how ethereum deals with TIME based contracts that requires a condition to be met in the future. I don't understand how this can scale if there are 1000 contracts waiting for a condition to happen. Someone please explain.