> For the complete documentation index, see [llms.txt](https://documentation.justbeep.it/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.justbeep.it/product-overview/riffs/execution-and-defi.md).

# Execution and DeFi

A smart order router sends every order to the venue with the best all-in cost for its size, and the agent moves liquidity across chains so the user never touches a bridge.

<figure><img src="https://2348763252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ffrgr0Kse7wRCOlaPSZd7%2Fuploads%2FlB91u0xw8Jv9KFKqJcZL%2Friffs-execution.png?alt=media&amp;token=2c5a23b3-b22f-4df6-931c-24e9086803f3" alt=""><figcaption></figcaption></figure>

Orders from a riff wallet go to on-chain venues, bridging first when needed; orders for a linked account run inside that account.

| Venue       | What Riffs uses it for                                       | Asset classes                 |
| ----------- | ------------------------------------------------------------ | ----------------------------- |
| Hyperliquid | Perps, including equity and commodity perps on HIP-3 markets | Crypto, equities, commodities |
| Ondo        | Tokenized stocks and ETFs                                    | Equities                      |
| Polymarket  | Event contracts                                              | Prediction markets            |
| Robinhood   | The user's own linked account                                | Equities, crypto              |
| Coinbase    | The user's own linked account                                | Crypto                        |

* **Routing.** For each order the router weighs price, depth, fees, funding rates and settlement time, then picks the venue with the lowest all-in cost.
* **Bridging and swaps.** LI.FI handles cross-chain routes and swaps; the Coinbase SDK handles USDC movement. The agent bridges only when the better venue outweighs the cost of getting there.
* **Perps.** Leverage is capped by the riff's risk level, funding costs feed into routing, and margin health is watched continuously.
* **Shorts.** Short legs run only on perp markets, so a riff's basket uses only the shorts that a perp market can actually carry.
