Skip to content

Commit 84d8831

Browse files
committed
WIP-searcher-guide-refactor
1 parent 47ea3f0 commit 84d8831

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

pages/express-relay/integrate-as-searcher.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ The code snippet below demonstrates how to submit a bid using the `Typescript` S
186186
```typescript {4} copy
187187
const handleOpporunity = async (opportunity: Opportunity) => {
188188
...
189-
const bid = await client.signBid(opportunity, {amount, nonce, deadline},privateKey)
189+
const bid = await client.signBid(opportunity, {amount, nonce, deadline}, privateKey)
190190
await client.submitBid(bid)
191191
}
192192
```

pages/express-relay/integrate-as-searcher/custom-contract.mdx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import { Callout } from "nextra/components";
22

33
# Custom Searcher Contract
44

5-
Searchers can use their in-house custom contracts to execute the opportunities provided by the auction server.
6-
In this case they need to construct the bids based on the opportunity details.
5+
Searchers can use their in-house custom contracts to execute the opportunities Express Relay provides.
6+
In this case, they must construct the bids based on the opportunity details.
77

8-
Check the following example of a custom contract that executes liquidation transactions:
8+
Refer to the following example of a custom contract that executes liquidation transactions:
99

1010
```solidity copy
1111
...
@@ -35,6 +35,5 @@ function callLiquidation(Opportunity memory opp){
3535
```
3636

3737
<Callout type="info" emoji="ℹ️">
38-
Make sure to approve the `opp.contract` for the necessary amount of
39-
`sell_tokens`.
38+
Make sure to allow the [Express Relay contract](../contract-addresses.mdx) to call the relevant methods in your custom contract.
4039
</Callout>

pages/express-relay/integrate-as-searcher/opportunity-adapter.mdx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Steps } from "nextra/components";
22

3-
# Prepare assets for OpportunityAdapter
3+
# Prepare assets for Opportunity Adapter
44

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.
66
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.
77
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.
88

@@ -11,9 +11,11 @@ In order to use `OpportunityAdapter`, you need to prepare your assets via the fo
1111
<Steps>
1212
### Transfer tokens to your wallet
1313

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`:
1719

1820
```bash copy
1921
cast send \
@@ -25,7 +27,10 @@ $WETH_ADDRESS \
2527

2628
### Approve your assets to Permit2
2729

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`:
2934

3035
```bash copy
3136
cast send \

0 commit comments

Comments
 (0)