> For the complete documentation index, see [llms.txt](https://docs.xy.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xy.finance/single-bridge-integration/ybridge-contract-integration/integrate-ybridge-contract/latest-upgrade-2024-07-17.md).

# Latest Upgrade ( 2024/07/17 )

**New functions**

* `adaptorForAdditionalFeeBlacklist(address): bool`: Lookup DEX aggregator adaptors, which provide swapping service, that’s NOT allowed to be used by old version of function `swapWithReferrer(...)`
* `additionalFeeReceiver()`: For managing purpose
* `additionalFeeConfig(address): uint256`: Lookup the amount of native token it takes to utilize the DEX aggregator adaptor. If it returns `0`, a default value of `additionalFeeConfig(address(0))` will be charged

**Cross chain swap**

* **The old interface**, `swapWithReferrer(address,(address,address,address,uint256,uint256),bytes,(uint32,address,uint256,uint32),address): 2aac3cac`, **is kept**.
  1. **Fees** : It doesn’t apply additional fees as before but cannot go through blacklisted DEX aggregator adaptors (`adaptorForAdditionalFeeBlacklist(address): bool`).
  2. **Event** : Changed to `SwapRequested(uint256,address,(uint32,address,address,uint256,uint32),address,address,uint256,address,uint256,uint256,address): 0xb0e9a29a6096a927bd389ba0d0d1a15f82df21a331d23a33eeb7de1cf7ab2684` **from** `SwapRequested(uint256,address,(uint32,address,uint256,uint32),address,address,uint256,address,uint256,uint256,address):0x40218dc7047d6a284746d042d62140b3629db83daefcd944659e90b4c74b7eb0`
* **The new overloading interface**, `swapWithReferrer(address,(address,address,address,uint256,uint256),bytes,(uint32,address,address,uint256,uint32),address): cdc65927`, **is added.**
  1. Fees: It charges native token according to `additionalFeeConfig` for both source chain and destination chain swapping DEX aggregator adaptor used.
  2. Mechanism: Same as the old `swapWithReferrer`, but charges DEX aggregator adaptor fees according to `additionalFeeConfig`. With enough `msg.value` sent along with the transaction, **extra native token would be refunded back to the caller**.
  3. Event: The same event, `SwapRequested(uint256,address,(uint32,address,address,uint256,uint32),address,address,uint256,address,uint256,uint256,address): 0xb0e9a29a6096a927bd389ba0d0d1a15f82df21a331d23a33eeb7de1cf7ab2684`emitted as the other `swapWithReferrer`


---

# 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.xy.finance/single-bridge-integration/ybridge-contract-integration/integrate-ybridge-contract/latest-upgrade-2024-07-17.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.
