Skip to main content
PositionRouter never holds a position. The loan stays on the user. The router must be an operator before it can borrow. Addresses: Addresses, Robinhood Chain testnet. ABI: PositionRouter.json.
1

Approve the router as operator

Required for borrow and withdrawCollateral on behalf of the user. setOperatorWithSig exists for EOAs that need one flow.
2

Permit or approve the stock

openPosition pulls supplyAmount of the book’s collateral with transferFrom. Pass a Permit if the token supports it. deadline = 0 skips permit.The book must be borrowingEnabled and regime == LIVE.
3

Open in one transaction

What can go wrong

  • NotOperator if you skipped step 1 and borrowAmount > 0.
  • RegimeBlocked on weekends, holidays, halts, corporate-action windows, and sequencer-down.
  • Paused if the guardian flipped the core.
  • BorrowingDisabled while the book is still closed. Launch default is off. Testnet may have flipped it.
  • Unhealthy / cap errors if borrowAmount exceeds RiskLens.maxBorrow or the book/issuer cap.
  • Leftover stock is swept back to the caller. The router must end at zero balances.

Parameters

Launch default for borrowingEnabled is off. Testnet may have flipped it. Read the flag on Parameters rather than trusting the ARCHITECTURE.md launch prose. Next: Repay and withdraw, Zap.