AgentMargin ROBINHOOD CHAIN · MAINNET
AgentMargin / DOCS

Understand the numbers behind your position.

AgentMargin helps you understand how much room your positions have before risk becomes critical. Explore exposure, borrowing costs and possible moves using observable data and explicit assumptions.

Stock Tokens are subject to issuer and jurisdictional restrictions. Connecting a wallet does not establish eligibility.

01

Architecture

AgentMargin is a non-custodial Next.js interface with server-side provider normalization, wagmi wallet discovery, viem contract reads, and direct lending-protocol transactions. No AgentMargin lending contracts are deployed in V1. Existing isolated lending markets supply the accounting and liquidation engine.

02

Sources of truth

Stock Tokens are discovered from the official Robinhood Stock Token API, filtered to chain 4663. The lending indexer supplies market discovery and indexed analytics. Contract state determines transaction eligibility. Blockscout supplies account activity. Provider failures remain unavailable rather than zero.

03

The multiplier

uiMultiplier() is shares per token scaled by 1e18. Raw balances remain token units. Robinhood reference bid/ask prices require multiplication by currentMultiplier for token-equivalent display. Onchain Stock Token feeds already include the multiplier: never multiply those values a second time.

04

Transaction lifecycle

Choose a market and amount, review the impact, approve a limited allowance if required, and review again before execution. Simulation and gas estimates precede wallet submission. A successful receipt is required for confirmation. An approval does not perform the deposit or repayment.

05

Availability

Supply, collateral, borrow, repay and withdrawals use existing lending contracts. Leverage and partial collateral-funded repayment compose its deployed GeneralAdapter with Uniswap v3, subject to live quotes, oracle checks and simulation. Risk monitor supports visible-page monitoring, in-app warnings and wallet-signed target repayments; unattended execution is not connected. Performance records complete observed valuations on your device and calculates FIFO P&L from user-imported trades. No history or acquisition cost is invented.

06

Portfolio scope

The unified view does not create cross-margin. Each isolated market has its own collateral and debt. The lowest market health is shown, never a blended health factor. Wallet discovery covers canonical Stock Tokens and discovered lending-market assets. Indexer delays may hide recent positions temporarily.