Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

forkline-executor

Self-custody trade executor for Forkline — your private key never leaves your repo.

GitHub Actions Chain viem License

When you place a trade on forkline.xyz, this repo is what actually executes it. Forkline dispatches a workflow_dispatch event to your fork of this repo. GitHub Actions reads your private key from your own GitHub Secrets, signs the on-chain transaction, and reports the result back to Forkline.

Forkline sees the trade request and the final tx hash — nothing else.


Execution flow

forkline.xyz  →  workflow_dispatch  →  your fork of forkline-executor
                                              ↓
                                  GitHub Actions (your environment)
                                              ↓
                                   reads PRIVATE_KEY from your Secrets
                                              ↓
                              RialtoSettlementRouter.exactInputSingle()
                                    (Robinhood Chain · chainId 4663)
                                              ↓
                                   on-chain swap confirmed
                                              ↓
                               reports txHash + status → forkline.xyz

Contracts used

All verified on Blockscout.

Contract Address
RialtoSettlementRouter 0xE23747d8c04b2101c873282C3d339D65d3d84ef0
RialtoV4StockSwapExecutor 0x36E90e3aCaddC1aad147dBF7a965F0290103717A
USDG (Global Dollar) 0x2CE3E396E069Ac9FA62046F423267072E06E77af
Uniswap V3 SwapRouter (fallback) 0xE592427A0AEce92De3Edee1F18E0157C05861564

RPC endpoint: https://rpc.mainnet.chain.robinhood.com


Setup

1. Fork this repo

Fork to your own GitHub account. Set the fork to private — workflow logs contain trade details.

2. Add GitHub Secrets

Navigate to your fork → Settings → Secrets and variables → Actions → New repository secret.

Secret Value
PRIVATE_KEY Your EOA private key (0x…64 hex chars). Must hold ETH for gas and USDG for buys.
RPC_URL https://rpc.mainnet.chain.robinhood.com
FORKLINE_API_URL https://forkline.xyz
FORKLINE_BOT_SECRET Copy from forkline.xyz → Portfolio → Account → Bot Secret

Never share PRIVATE_KEY. GitHub Secrets are encrypted at rest and only exposed inside your own workflow runs. Forkline never requests or receives this value.

3. Connect your repo on Forkline

Go to forkline.xyz → Portfolio → Account → Executor Repo.

Enter your repo in the format: youruser/forkline-executor

4. Fund your wallet

Before trading you need:

  • ETH on Robinhood Chain — for gas fees
  • USDG — to buy tokenized stocks (Global Dollar, native stablecoin on Robinhood Chain)

Workflows

buy.yml — Execute Buy (USDG → stock token)

Triggered by workflow_dispatch from Forkline API.

Inputs: trade_id, ticker, amount_in, slippage_bps (default: 50 bps)

Steps:

  1. Calls RialtoV4StockSwapExecutor.previewOracleMinimum() — Chainlink-backed minimum output
  2. Approves amount_in USDG to RialtoSettlementRouter
  3. Calls exactInputSingle({ tokenIn: USDG, tokenOut: stockToken, ... })
  4. Waits for on-chain confirmation
  5. Reports txHash + status: SUCCESS back to Forkline

sell.yml — Execute Sell (stock token → USDG)

Same flow in reverse. Approves stock token, swaps to USDG.


Supported stock tokens

Ticker Name Contract
AAPL-T Apple 0xaF3D76…
AMD-T AMD 0x86923f…
AMZN-T Amazon 0x12f190…
COIN-T Coinbase 0x6330D8…
GOOGL-T Alphabet 0x2e0847…
META-T Meta 0xc0D645…
MSFT-T Microsoft 0xe93237…
NFLX-T Netflix 0xE0444E…
NVDA-T NVIDIA 0xd0601C…
TSLA-T Tesla 0x322F09…

All tokens are ERC-20, 18 decimals. USDG uses 6 decimals.


Verify on-chain

Every trade produces a transaction hash viewable on the Robinhood Chain explorer:

https://robinhoodchain.blockscout.com/tx/<txHash>

You can independently verify the swap amounts, token addresses, and your wallet address without relying on Forkline.


Troubleshooting

Workflow not triggered?

  • Verify FORKLINE_BOT_SECRET matches the value shown in Forkline → Portfolio → Account
  • Verify the repo path in Forkline matches exactly (user/repo, case-sensitive)
  • Ensure GitHub Actions is enabled on your fork (Settings → Actions → Allow all actions)

Swap reverted?

  • Check ETH balance for gas on Robinhood Chain
  • Check USDG balance ≥ trade amount for buys
  • Try increasing slippage via the Forkline trade UI if markets are volatile

Oracle unavailable?

  • previewOracleMinimum is a soft dependency. If it reverts, the script proceeds with amountOutMinimum = 0. Rialto's internal price guard still applies.

Security model

What Forkline has What Forkline never has
Your GitHub username Your private key
Your wallet address Your GitHub token
Trade request (ticker, amount) Access to your GitHub Secrets
Final tx hash Ability to sign transactions

Your private key exists only inside GitHub Actions' encrypted secret store and your own machines.


License

MIT


About

GitHub Actions trade executor for Forkline — your private key never leaves your repo

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages