Skip to content

feat: add Recta action provider (second opinion on cross-chain stablecoin routes) - #1630

Open
Arquitekto wants to merge 1 commit into
coinbase:mainfrom
RectaBuild:recta-action-provider
Open

Arquitekto wants to merge 1 commit into
coinbase:mainfrom
RectaBuild:recta-action-provider

Conversation

@Arquitekto

Copy link
Copy Markdown

Description

Adds RectaActionProvider, which lets an agent ask, before a cross-chain stablecoin transfer, whether a cheaper route than the one it would use can be proven at the same chain state.

Actions:

  • check_route_coverage: whether the corridor from the wallet's network is covered and which bridges are compared.
  • get_route_saving_odds: how often a saving was found against each bridge on that corridor.
  • compare_bridge_route: for a planned transfer and the agent's own route (baselineProvider, e.g. stargate_v2), whether a saving can be proven, its lower bound in USDC, and the fee.

The provider only reads. It never signs and never sends a transaction, and it needs no API key or configuration. The source network and sender are the wallet's own; gas caps come from the wallet's public client.

Pricing: the actions are free. Recta charges exactly 5% of a saving it verifies on chain, and only if the agent then executes Recta's route. No saving, nothing owed. Example from production: Ethereum USDC to Base, 6,000 USDC, declared route Stargate v2: saving found, lower bound 2.40 USDC.

Tests

  • Unit tests in rectaActionProvider.test.ts (fetch mocked): network support, schema, coverage, template filling with the wallet's address and fees, given recipient, uncovered corridor, refusal passthrough, network error, and that the wallet is never asked to sign or send.
  • Manual: check_route_coverage and get_route_saving_odds against the live API from Ethereum and Arbitrum wallets; compare_bridge_route sends the same request that returned SAVING_FOUND 2.39903 USDC for Ethereum to Base, 6,000 USDC vs stargate_v2.

Checklist

  • Added documentation to all relevant README.md files
  • Added a changelog entry

Read-only second opinion on cross-chain stablecoin routes: coverage, saving odds and a trial comparison against the agent's own route. No signing, no sending, no API key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011DN7pdrtxb86pDZpoj8o74
@cb-heimdall

Copy link
Copy Markdown

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
1 if authored by an app that is not allowlisted and lacks verified human attribution 0
Sum 1

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action provider New action provider documentation Improvements or additions to documentation typescript

Development

Successfully merging this pull request may close these issues.

3 participants