You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/express-relay/integrate-as-searcher/opportunity-adapter.mdx
+11-6Lines changed: 11 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
import { Steps } from"nextra/components";
2
2
3
-
# Prepare assets for OpportunityAdapter
3
+
# Prepare assets for Opportunity Adapter
4
4
5
-
The `OpportunityAdapter` is a utility contract that can be used for easier integration with express relay while maintaining maximum security.
5
+
The [`OpportunityAdapter`](https://github.com/pyth-network/per/blob/main/contracts/src/opportunity-adapter/OpportunityAdapter.sol) is a utility contract that can be used for easier integration with Express Relay while maintaining maximum security.
6
6
In this integration, searchers use the [`Permit2`](https://github.com/Uniswap/permit2/) contract for safe asset management (`ERC20` tokens and Wrapped ETH) and the adapter contract to transfer bids, execute the opportunity, and ensure the assets are transferred correctly.
7
7
Using the `OpportunityAdapter` means that a searcher does not need to deploy their own custom contract for inventory management and routing to the protocol contracts where liquidation takes place.
8
8
@@ -11,9 +11,11 @@ In order to use `OpportunityAdapter`, you need to prepare your assets via the fo
11
11
<Steps>
12
12
### Transfer tokens to your wallet
13
13
14
-
You will need to own all the tokens you expect to provide as `sell_tokens` for different opportunities.
15
-
You will also need to approve `WETH`, as the `OpportunityAdapter` will pay your bids by deducting the bid amounts from your wallet's `WETH` balance. You can find the `WETH` contract address on the [contract address page](../contract-addresses).
16
-
You can use the following command to deposit native ETH to `WETH`:
14
+
Searchers are expected to own all the tokens that they expect to provide as `sell_tokens` for different opportunities.
15
+
They will also need to approve `WETH`, as the `OpportunityAdapter` will pay the bids by deducting the bid amounts from their wallet's `WETH` balance.
16
+
17
+
You can find the `WETH` contract address on the [contract address page](../contract-addresses).
18
+
Refer to the following command to deposit native ETH to `WETH`:
17
19
18
20
```bash copy
19
21
cast send \
@@ -25,7 +27,10 @@ $WETH_ADDRESS \
25
27
26
28
### Approve your assets to Permit2
27
29
28
-
Approve your tokens, including `WETH`, to the `Permit2` contract `0x000000000022D473030F116dDEE9F6B43aC78BA3`. This step allows the searcher to approve token spending with off-chain signatures.
30
+
Approve your tokens, including `WETH`, to the `Permit2` contract `0x000000000022D473030F116dDEE9F6B43aC78BA3`.
31
+
This step enables token spending with off-chain signatures.
32
+
33
+
Refer to the following command to approve a token to `Permit2`:
0 commit comments