# Biatec Scheduler

Biatec scheduler is timed based executor of the AVM smart contract.

Scheduler use cases are:

* Standing payment order - Execute periodic payment to another algorand account
* DCA - Buy your desired token token at periodic intervals
* Conditional purchase if token price is above or below desired price

Decentralized scheduler consists of the frontend blockly code builder where anyone can build their own logic. Person selects the start time and period how often the tasks should execute and execution fee in tokenized gold. User deposits funds to the escrow account. Anyone can execute the tasks from the escrow account when the times comes. Each execution event is logged in the escrow account transactions.

Endpoints:

* <https://www.a-wallet.net> - Algorand wallet with standing order option
* <https://scheduler.biatec.io> - Smart contract blockly builder
* <https://api-scheduler.biatec.io> - API endpoint to build smart contract from biatec yaml or json code
* <https://docs-scheduler.biatec.io> - Documentation
* <https://www.biatec.io> - List of all of our products - Concentrated liquidity AMM DEX, Aramid bridge,  Vote Coin, AWallet, Accounting services ...&#x20;

**Disclaimer**: Biatec scheduler is quite new product (launched April 2024) and may still contain errors or the future versions may not be compatible with the older versions. Always check the generated smart contract source code if it is compliant with your intended use. YOU are responsible for any and all actions you do, noone else is liable. You may loose money using this service if not configured properly. Remember that with great power comes great responsibility, your keys, your security, your crypto.<br>


# Fees

All fees associated with using biatec decentralized scheduler are listed here.

### Deploly task fee

To deploy task, the built smart contract must be created, configured and registration fee paid.

Create smart contract on algorand: 0.001 algo

Configure task network fees: 0.003 algo

Registration fee: 1 algo . Registration fee consists of the service fee and minimum balance requirements for smart contracts and boxes.

Total costs at algo price 0.2 algo/usd is approx $ 0,2

### Update task fee

Network fees: 0,001 algo

### Delete task fee

Network fees: 0,003 algo

Delete task fee consists of paying execution funds back to the creator of the task.

### Deposit fee

We charge you service fee 1% of the deposits. If you deposit 1 gram of gold for execution fees, you will have available 0.99 gold grams. (Also available for withdrawal)

Network fee for deposit is 0,001 algo.

### Withdrawal of execution fees

There is no service fee associated with withdrawal of the execution fees.

Network fee for deposit is 0,002 algo.

### Execution fee

Execution fee is paid in tokenized gold. If the selected fee is too low, the executors will not execute the tasks.

Default execution fee is 0,001 gram of gold (1000 in base units) \~ 8 cents at price 80 gold/usd.


# Executors

Anyone can execute the tasks. Successful executor will receive reward set in the smart contract.

All scheduled tasks are stored in the box storage at the task pool contract.

List of deployed task pool contracts:

* Algorand Testnet: 643872805

Sample executor code is here: <https://github.com/scholtz/BiatecCron/blob/main/src/bin/executor.ts>&#x20;

This sample executor can be run as [docker image](https://hub.docker.com/r/scholtz2/biatec-cron-executor/tags) or as the [kubernetes deployment](https://github.com/scholtz/BiatecCron/blob/main/k8s/executor/testnet/deployment-main.yaml).


# xGov grant

This work has been performed with support from the Algorand Foundation xGov Grants Program - [xGov#90](https://github.com/algorandfoundation/xGov/blob/main/Proposals/xgov-90.md).

More information about expert algorand governance program can be found at <https://xgov.algorand.foundation/>


# General info

If you want to add your project to the scheduler, you have to add it to the biatec meta code first, and then the blockly designer.

Biatec meta code is json/yaml schema similar to pipeline execution scripts where each work item is converted into the tealscript code.

Frontend uses the blockly to create the biatec meta code which is rendered to the tealscript at the api and generated client is produced.


# Biatec meta code

Please visit <https://github.com/scholtz/BiatecCron/tree/main/src/templates> and add your project to the repo. Please create pull request and our developers will verify it and merge it.


# Blockly components

After you have sucessfully deployed to the biatec meta code to the api server, please visit <https://github.com/scholtz/BiatecCronBuilder/tree/main/src/blocks> and create blocks. Then visit generator from blocks <https://github.com/scholtz/BiatecCronBuilder/blob/main/src/generators/tealscript.ts>.

Please create pull request with your project and our developers will review and and merge it.


