You’ll need: an app ID (Base URL, app IDs & API keys), your site’s
origin in the app’s allowed origins, and React 18 or later.
Result: a React app with AGG data, sign-in, and a buy that is tracked to a final state.
@agg-build/sdk.
1. Create the client and provider
Mount oneAggProvider around your app. Use the hooks export for data hooks, or the UI export
to include the UI kit’s toast support; the UI export already includes the hooks provider.
Mount AggAuthProvider inside it for the connect button. The example assumes you have a
Wagmi configuration in ./wagmi-config and your application component in MyApp.
AggProvider from @agg-build/ui instead of from
@agg-build/hooks. Keep the same client and config props. That component already mounts the
hooks provider.
UI components go inside MyApp:
2. Sign the user in
AuthButton above lets the user sign in through @agg-build/auth. Trading calls use that
user’s session through the shared client.
See the Connect Button reference and
Authentication & sessions for every provider.
3. Buy and track to a final state
The user needs a balance first. See Funding for deposits. No session means a preview quote. See Quotes. Then quote, fill, and poll the execution status untilterminal is true.
terminal is true. overallState then reads filled, partially_filled,
failed, cancelled, or expired. Read Order lifecycle & statuses
for what each state means.
WebSocket endpoint
The SDK and hooks manage the socket, reconnection, resnapshots, and orderbook integrity checks. If you open raw sockets yourself, connect to:Next steps
Quickstart: REST
The same flow over REST, for backends and agents.
Order lifecycle
Every order status and how to track it.
Real-Time Orderbook
Live orderbook rendering with the SDK, hooks, and UI.
Customize UI
Brand AGG components with CSS variables, labels, formatting, and slots.