Skip to content

Commit c9963d9

Browse files
committed
Merge branch '(feat)-add-express-relay' of github.com:pyth-network/documentation into (feat)-add-express-relay
2 parents 5d3e43e + 04826af commit c9963d9

File tree

6 files changed

+78
-22
lines changed

6 files changed

+78
-22
lines changed

components/icons/CodeIcon.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const CodeIcon = ({ className }: { className: string }) => {
2+
return (
3+
<svg
4+
xmlns="http://www.w3.org/2000/svg"
5+
viewBox="0 0 1024 1024"
6+
fill="currentColor"
7+
height="1em"
8+
width="1em"
9+
>
10+
<path d="M516 673c0 4.4 3.4 8 7.5 8h185c4.1 0 7.5-3.6 7.5-8v-48c0-4.4-3.4-8-7.5-8h-185c-4.1 0-7.5 3.6-7.5 8v48zm-194.9 6.1l192-161c3.8-3.2 3.8-9.1 0-12.3l-192-160.9A7.95 7.95 0 00308 351v62.7c0 2.4 1 4.6 2.9 6.1L420.7 512l-109.8 92.2a8.1 8.1 0 00-2.9 6.1V673c0 6.8 7.9 10.5 13.1 6.1zM880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z" />
11+
</svg>
12+
);
13+
}
14+
15+
export default CodeIcon;
16+
17+

components/icons/QuestionMarkIcon.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const QuestionMarkIcon = ({ className }: { className: string }) => {
2+
return (
3+
<svg
4+
xmlns="http://www.w3.org/2000/svg"
5+
fill="currentColor"
6+
viewBox="0 0 16 16"
7+
height="1em"
8+
width="1em"
9+
>
10+
<path
11+
fillRule="evenodd"
12+
d="M4.475 5.458c-.284 0-.514-.237-.47-.517C4.28 3.24 5.576 2 7.825 2c2.25 0 3.767 1.36 3.767 3.215 0 1.344-.665 2.288-1.79 2.973-1.1.659-1.414 1.118-1.414 2.01v.03a.5.5 0 01-.5.5h-.77a.5.5 0 01-.5-.495l-.003-.2c-.043-1.221.477-2.001 1.645-2.712 1.03-.632 1.397-1.135 1.397-2.028 0-.979-.758-1.698-1.926-1.698-1.009 0-1.71.529-1.938 1.402-.066.254-.278.461-.54.461h-.777zM7.496 14c.622 0 1.095-.474 1.095-1.09 0-.618-.473-1.092-1.095-1.092-.606 0-1.087.474-1.087 1.091S6.89 14 7.496 14z"
13+
/>
14+
</svg>
15+
);
16+
};
17+
18+
export default QuestionMarkIcon;

pages/express-relay/index.mdx

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,56 @@
11
import Link from "next/link";
2-
32
import { Cards, Card } from "nextra/components";
43
import SearchIcon from "../../components/icons/SearchIcon";
54
import ContractIcon from "../../components/icons/ContractIcon";
5+
import QuestionMarkIcon from "../../components/icons/QuestionMarkIcon";
6+
import CodeIcon from "../../components/icons/CodeIcon";
67

78
# Introduction
89

9-
Express Relay is a priority auction that enables protocols to eliminate maximal extractable value (MEV).
10-
11-
10+
Express Relay is a priority auction that enables protocols to eliminate [Maximal Extractable Value](https://www.ledger.com/academy/glossary/maximal-extractable-value-mev) (MEV).
1211

1312
- **For Protocol Developers:** Express Relay allows protocols to recapture MEV and access a network of searchers.
1413
With Express Relay, protocols don't need to spend time and energy bootstrapping a protocol-specific searcher network.
1514

15+
- **For Searchers:** Express Relay provides easy and unified access by aggregating liquidation and other MEV opportunities across integrated DeFi protocols.
16+
Searchers integrate once and gain access to all existing and future opportunities.
17+
18+
## Integration
19+
20+
To integrate with Express Relay, you can integrate as a protocol or as a searcher.
21+
22+
<Cards>
1623
<Card
1724
icon={<ContractIcon />}
18-
title="Integrate with Express Relay as a protocol"
25+
title="Integrate with Express Relay as a Protocol"
1926
href="./express-relay/integrate-as-protocol"
2027
/>
2128

22-
- **For Searchers:** Express Relay provides easy and unified access by aggregating liquidation and other MEV opportunities across integrated DeFi protocols.
23-
Searchers integrate once and gain access to all existing and future opportunities.
24-
2529
<Card
2630
icon={<SearchIcon />}
27-
title="Integrate with Express Relay as a searcher"
31+
title="Integrate with Express Relay as a Searcher"
2832
href="./express-relay/integrate-as-searcher"
2933
/>
34+
</Cards>
35+
36+
## Learn
37+
38+
To learn more about Express Relay, refer to the following resources:
39+
40+
<Cards>
41+
<Card
42+
icon={<QuestionMarkIcon />}
43+
title="How Express Relay Works"
44+
href="./express-relay/how-express-relay-works "
45+
/>
46+
47+
<Card
48+
icon={<CodeIcon />}
49+
title="Example Protocol Integration"
50+
href="https://github.com/pyth-network/pyth-examples/tree/main/express-relay/easy_lend"
51+
/>
52+
</Cards>
53+
3054

31-
To learn more about Express Relay's design and how it eliminates MEV, please see [How Express Relay Works](/express-relay/how-express-relay-works).
3255

33-
## Useful Links
3456

35-
TODO: Add Useful Links

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ interface IExpressRelayFeeReceiver {
9393
The following code snippet shows a sample Express Relay-integrated contract that performs liquidation.
9494
_Note: The highlighted lines show the contract's relevant additions for Express Relay integration._
9595

96-
```solidity showLineNumbers {1,2,12,14,21,38,39,41,42, 57-61} copy
96+
```solidity showLineNumbers {1,2,12,14,21,45-50,65-69} copy
9797
import "@pythnetwork/express-relay-sdk-solidity/IExpressRelay.sol";
9898
import "@pythnetwork/express-relay-sdk-solidity/IExpressRelayFeeReceiver.sol";
9999

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const handleOpporunity = async (opportunity: Opportunity) => {
3434

3535
const client = new Client(
3636
{ baseUrl: "https://pyth-express-relay-mainnet.asymmetric.re" },
37-
undefined,
37+
undefined, // Default WebSocket options
3838
handleOpporunity
3939
);
4040
await client.subscribeChains(["op_sepolia"]);
@@ -127,11 +127,11 @@ The `OpportunityAdapter` contract handles asset transfers and ensures the opport
127127

128128
<Callout type="warning" emoji="⚠️">
129129
Before constructing the bid, make sure your wallet has the required assets and has made the necessary approvals.
130-
Refer to the [Prepare assets for OpportunityAdapter](./integrate-as-searcher/opportunity-adapter.mdx) section for more details.
130+
Refer to the [Prepare assets for Opportunity Adapter](./integrate-as-searcher/opportunity-adapter.mdx) section for more details.
131131
</Callout>
132132

133133

134-
Here is an example of how to construct a bid using `OpportunityAdapter` via the SDKs:
134+
Here is an example of how to construct a bid object using `OpportunityAdapter` via the SDKs:
135135

136136
<Tabs items={['Typescript', 'Python']}>
137137
<Tabs.Tab>
@@ -171,7 +171,7 @@ def opportunity_callback(opportunity: Opportunity):
171171

172172

173173

174-
If you prefer to use your own custom contracts instead of the `OpportunityAdapter`, please refer to the [custom contracts](./integrate-as-searcher/custom-contract.mdx) section.
174+
If you prefer to use your custom contracts instead of the `OpportunityAdapter`, please refer to the [custom contracts](./integrate-as-searcher/custom-contract.mdx) section.
175175

176176
### Submit Bids on Opportunities to Express Relay
177177

pages/home/_meta.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@
1616
"href": "/benchmarks"
1717
},
1818

19-
"Entropy": {
20-
"title": "Entropy →",
21-
"href": "/entropy"
22-
},
23-
2419
"Express Relay": {
2520
"title": "Express Relay →",
2621
"href": "/express-relay"
2722
},
2823

24+
"Entropy": {
25+
"title": "Entropy →",
26+
"href": "/entropy"
27+
},
28+
2929
"--- Additional Information": {
3030
"title": "Additional Information",
3131
"type": "separator"

0 commit comments

Comments
 (0)