A compiler that takes machine instructions defined in a YAML-based DSL and transpiles them into rootfiles for machines. The compiled configuration is stored in the MakinaHQ/makina-integrations repository. Generated commands and states are based on weiroll.
The transpiler processes:
- Position Files: Define positions with instructions, affected tokens, and configuration
- Blueprint Files: Reusable templates for common operations (deposit, account, etc.)
- Instruction Files: Specific protocol interactions with parameterized calls
The compilation pipeline parses YAML DSL files, resolves blueprint includes, and generates TOML rootfiles with bytecode and metadata.
Compile a YAML instruction file to a rootfile:
cargo run -p transpiler -- -i input.yaml -o rootfile.tomlWhen using token lists:
cargo run -p transpiler -- -i input.yaml -o rootfile.toml -t token_list.jsonWhen using helper contracts:
cargo run -p transpiler -- -i input.yaml -o rootfile.toml -h helpers.jsonExample with test data:
cargo run -p transpiler -- -i test_data/caliber.yaml -o output.toml -t test_data/token_lists/test.json -h test_data/helpers_list/helpers.jsonInput files use a YAML-based domain-specific language with:
- Config: Caliber addresses and global configuration
- Positions: Individual position definitions with management/accounting instructions
- Blueprints: Reusable templates via
!includedirectives - Parameters: Type-safe inputs with address, uint256, and other Solidity types
The transpiler supports template variables that can be used throughout YAML files:
${config.<name>}- Reference config values${token_list.<chain>.<symbol>}- Reference token addresses from a token list${helpers.<chain>.<name>}- Reference helper contract addresses from a helpers list${position.<var>}- Reference position-level variables
The transpiler outputs TOML rootfiles that can be used to interact with the caliber contracts.