explaingit

big14way/torch

Analysis updated 2026-05-18

0TypeScriptAudience · developerComplexity · 5/5Setup · hard

TLDR

A hackathon project letting users trade perpetual futures on Hyperliquid using XRP as margin, bridged through Flare and a secure trusted execution agent.

Mindmap

mindmap
  root((torch))
    What it does
      XRP margin trading
      Routes to Hyperliquid
      TEE-secured bridge
    Tech stack
      TypeScript
      React
      Solidity
      Flare
    Use cases
      Cross-chain margin trading
      Study TEE bridge design
      Local trading demo
    Safeguards
      FTSOv2 price checks
      No-withdrawal API keys
      On-chain insurance fund

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Trade Hyperliquid perpetual futures using FXRP margin instead of USDC.

USE CASE 2

Study a TEE-secured bridge pattern connecting two different blockchain trading systems.

USE CASE 3

Run a local demo of cross-chain margin trading with a simulated price feed.

What is it built with?

TypeScriptReactSolidityHardhatFlare

How does it compare?

big14way/torch0xradioac7iv/tempfs7vignesh/pgpulse
Stars000
LanguageTypeScriptTypeScriptTypeScript
Setup difficultyhardmoderatemoderate
Complexity5/53/54/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1h+

Requires Node.js 20+, MetaMask, and running a local blockchain plus contract deployment scripts.

No license information is stated in the README.

In plain English

Torch is a hackathon project that lets someone trade perpetual futures using their XRP as collateral, even though the exchange it trades on only accepts a different currency for margin. It was built for a hackathon focused on the Flare blockchain, aiming for two specific bounty categories at once. The idea addresses a real gap: XRP holders have a large amount of value sitting idle because there has not been a way to use XRP directly as margin on a deep order book exchange. Torch bridges this gap. A user deposits a wrapped version of XRP called FXRP on the Flare blockchain, and Torch routes the actual trade execution to Hyperliquid, a separate exchange with deep liquidity, even though Hyperliquid normally only accepts a different asset as margin. The bridge between the two systems is handled by an automated agent running inside a Trusted Execution Environment, a secure isolated computing area, which holds the keys needed to place trades but cannot withdraw funds. The project is upfront that this is an early version, not yet a fully trustless system, and lists the specific safeguards in place: every price the agent reports is checked against Flare's on chain price oracle and rejected if it strays too far from that reference, the exchange key can trade but never withdraw, and profit or loss is settled through an explicit on chain insurance fund rather than a hidden promise. The repository is organized into a smart contract project, a TypeScript agent that watches the vault and executes trades, and a React web app for the trading interface. Running it locally requires Node.js 20 or newer and a wallet like MetaMask, with detailed step by step instructions for starting a local blockchain, deploying contracts, and running the agent in a mock mode that simulates price movement for demonstration purposes. A live deployment already exists on Flare's Coston2 test network.

Copy-paste prompts

Prompt 1
Explain how Torch bridges Flare's FXRP margin to Hyperliquid's order book using a TEE agent.
Prompt 2
Walk me through running this Torch project locally, from deploying contracts to opening a mock trade.
Prompt 3
What safeguards does Torch use to prevent the TEE executor from acting maliciously?
Prompt 4
Help me understand the FTSOv2 price deviation check used in the TorchVault contract.

Frequently asked questions

What is torch?

A hackathon project letting users trade perpetual futures on Hyperliquid using XRP as margin, bridged through Flare and a secure trusted execution agent.

What language is torch written in?

Mainly TypeScript. The stack also includes TypeScript, React, Solidity.

What license does torch use?

No license information is stated in the README.

How hard is torch to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is torch for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.