Perpetual Engines: The Engineering Logic Behind On-Chain Derivatives