# Add DeFi providers in AppKit (https://docs-rbcpr9qys-ton-core-docs.vercel.app/llms/applications/appkit/get-started/providers/content.md)



Plug in a swap or staking provider when the app needs DeFi flows. Each provider sits on the AppKit instance and supplies data: prices, quotes, and the transactions that the user will sign. The wallet still signs; the provider only prepares.

A provider is not a wallet and not a connector. AppKit treats whatever it returns as external input — useful for showing prices, balances, and quotes, but never as proof of settlement.

## Before you begin [#before-you-begin]

You need AppKit packages installed and an `AppKit` instance created. See [Prepare your project](https://docs-rbcpr9qys-ton-core-docs.vercel.app/llms/applications/appkit/get-started/installation/installation/content.md) and [Add wallet connectors](https://docs-rbcpr9qys-ton-core-docs.vercel.app/llms/applications/appkit/get-started/connectors/content.md).

## Add a swap provider [#add-a-swap-provider]

Swap providers ship as separate entrypoints under `@ton/appkit/swap/*` so the bundler only includes the protocols you actually use. Construct an instance and pass it in the `providers` array on the `AppKit` constructor; AppKit registers it with the swap manager and the swap hooks (`useSwapQuote`, `useBuildSwapTransaction`) start returning quotes from that protocol.

```ts
// appkit.ts
import { AppKit } from '@ton/appkit';
import { DeDustSwapProvider } from '@ton/appkit/swap/dedust';

export const appKit = new AppKit({
  // networks, connectors...
  providers: [
    new DeDustSwapProvider(),
  ],
});
```

Omniston requires its own SDK package — install it before registering the provider:

```bash
npm i @ston-fi/omniston-sdk
```

## Add a staking provider [#add-a-staking-provider]

Use `createTonstakersProvider({})` from `@ton/appkit/staking/tonstakers` the same way:

```ts
import { AppKit } from '@ton/appkit';
import { createTonstakersProvider } from '@ton/appkit/staking/tonstakers';

export const appKit = new AppKit({
  // networks, connectors...
  providers: [
    createTonstakersProvider({}),
  ],
});
```

The staking hooks (`useStakingQuote`, `useBuildStakeTransaction`) start returning data from the registered provider.

## Tips [#tips]

Provider responses are external data. Validate critical outcomes server side before changing product state — wallet acceptance is not settlement, and a swap quote is not a price guarantee.

## Next steps [#next-steps]

* Continue to [Use UI widgets](https://docs-rbcpr9qys-ton-core-docs.vercel.app/llms/applications/appkit/get-started/using-ui-widgets/content.md) to render full swap and staking UIs with one component each.
* For task-level walkthroughs, see [Perform swaps](https://docs-rbcpr9qys-ton-core-docs.vercel.app/llms/applications/appkit/howto/swaps/content.md) and [Staking](https://docs-rbcpr9qys-ton-core-docs.vercel.app/llms/applications/appkit/howto/staking/content.md).
* See [Use providers](https://docs-rbcpr9qys-ton-core-docs.vercel.app/llms/applications/appkit/howto/providers/content.md) for the full provider model — including the streaming and API client roles not covered here.
