# Integration Guideline

This page provides a high-level guide on integrating with Wombat on various projects.

### Swap

You will want to use the [`Router`](/developers/integration-guideline/router.md) contract. To get a quote, use [`getAmountOut`](/developers/integration-guideline/router.md#function-getamountout). To swap BEP20 tokens, use [`swapExactTokensForTokens`](/developers/integration-guideline/router.md#function-swapexacttokensfortokens). Each swap in the path will incur a haircut fee, which can differ for each pool.

### Yield Farming

First, [`deposit`](/developers/integration-guideline/pool.md#function-deposit) your tokens to a [`Pool`](/developers/integration-guideline/pool.md) (which may trigger a deposit gain). You'll get LP tokens in BEP20 format.

Then, use [`MasterWombat`](/developers/integration-guideline/masterwombatv2.md)'s [`getAssetPid`](/developers/integration-guideline/masterwombatv2.md#function-getassetpid) to find the id of the asset. Use the id to [`deposit`](/developers/integration-guideline/masterwombatv2.md#function-deposit) the LP tokens into MasterWombat. Alternatively, you may set the param `shouldStake` to be true while calling`Pool.deposit` (This feature is experimental. Please use it with caution).

To view a user's position, you may read the value `amount` returned by [MasterWombat.userInfo](/developers/integration-guideline/masterwombatv2.md#function-userinfo).

After the deposit, you may use [`pendingTokens`](/developers/integration-guideline/masterwombatv2.md#function-pendingtokens) to check for any pending rewards. Note that there may be more than one reward token. To claim rewards, you can either do a [`deposit`](/developers/integration-guideline/masterwombatv2.md#function-deposit) (with zero amount), [`withdraw`](/developers/integration-guideline/masterwombatv2.md#function-withdraw) (with zero amount), or call [`multiClaim`](/developers/integration-guideline/masterwombatv2.md#function-multiclaim) to claim one or more positions.

The withdrawal flow is similar to the above in reverse.

### veWOM

You may call [VeWom.mint](/developers/integration-guideline/vewom.md#function-mint) to lock WOM into the contract and mint veWOM with a length of 7 days to 1461 days. Up to 10000 positions could be locked for each user. To view locked positions, call [VeWom.getUserInfo](/developers/integration-guideline/vewom.md#function-getuserinfo). After the locking period, call [VeWom.burn](/developers/integration-guideline/vewom.md#function-burn) to burn veWOM and get back locked WOM.

### Questions

Please use our [discord](/resources/links.md#discord) if you have any questions.


---

# Agent Instructions: 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:

```
GET https://docs.wombat.exchange/developers/integration-guideline.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
