> For the complete documentation index, see [llms.txt](https://docs.symm.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.symm.io/exchange-builder-documentation/frontend-builder-sdk/hyperevm.md).

# HyperEVM

On HyperEVM you build your frontend against the [Trading SDK](https://doc.trading-sdk.symm.io), specifically `@symmio/trading-react`. It gives you a provider and typed hooks for wallet connection, sub-account state, deposits, session-key delegation, and trading, all wired to wagmi and TanStack Query. You do not hand-encode AccountLayer `_call()` payloads, and you keep full control of your own UI.

Your solver counterparty on HyperEVM is Enigma (`0x76bc5889c0cfcC20960b0D81F541595d81a95122`), which also serves as the price feed. The SDK talks to it for you.

### Install

```bash
pnpm add @symmio/trading-react viem wagmi @tanstack/react-query
```

### Set up the providers

```tsx
"use client";
import { SymmioProvider, SymmioSupportedChainId } from "@symmio/trading-react";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { useState } from "react";
import { http } from "viem";
import { hyperEvm } from "viem/chains";
import { createConfig, WagmiProvider } from "wagmi";
import { injected } from "wagmi/connectors";

const wagmiConfig = createConfig({
  chains: [hyperEvm],
  transports: { [hyperEvm.id]: http("https://rpc.hyperliquid.xyz/evm") },
  connectors: [injected()],
});

export function Providers({ children }: { children: React.ReactNode }) {
  const [queryClient] = useState(() => new QueryClient());
  return (
    <WagmiProvider config={wagmiConfig}>
      <QueryClientProvider client={queryClient}>
        <SymmioProvider
          symmioConfig={{
            [SymmioSupportedChainId.HYPER_EVM]: {
              addresses: { affiliatesAddress: "0xYourRegisteredAffiliate" },
            },
          }}
        >
          {children}
        </SymmioProvider>
      </QueryClientProvider>
    </WagmiProvider>
  );
}
```

> Provider order matters: Wagmi outside QueryClient outside SymmioProvider. The SDK reads both wagmi and the QueryClient from context.

### Build against the hooks

From there, build your UI against the documented hooks:

* Wallet: `useConnectWallet`, `useWalletAccount`, `useSwitchToSymmioChain`
* Accounts: `useUserSubAccounts`, `useAccountBalanceOf`, `useAccountBalanceInfo`
* Funding: `useApproveCollateral`, `useDeposit`, `useAllocate`, `useDeallocate`
* Session key / delegation: `useGrantDelegation`, `useIsDelegationActive`
* Markets and prices: `useMarkets`, plus `useEnigmaPriceServicePrices`, `useEnigmaPriceServiceMetadata`, `useEnigmaPriceServiceSymbolsInfo`, `useEnigmaPriceServiceHealth`
* Trading: `useInstantOpenAuto`, `useInstantCloseAuto`, `useManagedQuotes`
* TP/SL: `useSetQuoteTpSl`, `useQuoteTpSl`

Full hook reference: <https://doc.trading-sdk.symm.io/react/>

### The underlying flow

The hooks wrap the same protocol steps a headless bot performs: create a SubAccount with the SDK's `createSubAccounts`, fund and allocate collateral, delegate a session key, then open, manage, and close positions against Enigma. Building a Trading Bot walks that flow call by call; the same sequence applies here, hook for hook. Three details worth internalizing before you wire up the UI:

* Approval and deposit amounts (`useApproveCollateral`, `useDeposit`) use collateral-token decimals (6 for USDC), while `useAllocate` takes an 18-decimal amount.
* Closes and TP/SL belong to the position's Virtual Account, not the SubAccount. Pass the VA where the API asks for `partyA` or `virtualAccount`.
* Delegation must be active before the first open, or the open fails silently. Grant the full `INSTANT_TRADE_REQUIRED_SELECTORS` set and gate the trade form until every selector checks active.

{% hint style="info" %}
Only HyperEVM (999) is deployed today. For Base, Arbitrum, Mantle, BNB, and the other SYMMIO deployments, use [frontend-sdk](/exchange-builder-documentation/frontend-builder-sdk/legacy-sdk.md) instead.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.symm.io/exchange-builder-documentation/frontend-builder-sdk/hyperevm.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
