Skip to content

Feat/update er docs #645

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 25, 2025
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions pages/express-relay/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@
"websocket-api-reference": "Websocket API Reference",
"contract-addresses": "Contract Addresses",
"errors": "Error Codes",
"examples": {
"title": "Example Application ↗",
"href": "https://github.com/pyth-network/pyth-examples/tree/6cea7c9602c7949c6dacc94aec44c0fe78ccb128/express-relay/easy_lend",
"newWindow": true
},
"-- Understand Express Relay": {
"title": "Understanding Express Relay",
"type": "separator"
Expand Down
3 changes: 1 addition & 2 deletions pages/express-relay/contract-addresses.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Contract Addresses

This section covers the contract addresses for Express Relay on different networks. Please navigate to the relevant section below.
This section covers the contract addresses for Express Relay. Please navigate to the relevant section below.

- [EVM](contract-addresses/evm)
- [SVM](contract-addresses/svm)
1 change: 0 additions & 1 deletion pages/express-relay/contract-addresses/_meta.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"evm": "EVM",
"svm": "SVM"
}
138 changes: 0 additions & 138 deletions pages/express-relay/contract-addresses/evm.mdx

This file was deleted.

57 changes: 53 additions & 4 deletions pages/express-relay/contract-addresses/svm.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,75 @@ import AddressSvmTable from "../../../components/AddressSvmTable";

Express Relay is currently deployed on the following SVM environments:

<Tabs items={['Solana Mainnet-Beta Testing']}>
<Tabs items={['Prod (Solana Mainnet-Beta)', 'Testing (Solana Mainnet-Beta)']}>
<Tabs.Tab>
Auction Server endpoint: https://pyth-express-relay-mainnet.asymmetric.re/

### Prod

**Network Details:**

<AddressSvmTable
explorer={"https://solscan.io/account/$ADDRESS"}
entries={[
{
name: "Express Relay Program",
value: "PytERJFhAKuNNuaiXkApLfWzwNwSNDACpigT3LwQfou",
link: true,
},
{
name: "Limo Limit Order Program",
value: "LiMoM9rMhrdYrfzUCxQppvxCSG1FcrUK9G8uLq4A1GF",
link: true,
},
{
name: "Chain Id",
value: "solana",
link: false,
},
{
name: "Public RPC",
value: "https://api.mainnet-beta.solana.com",
link: false,
},
{
name: "Limo Global Order Config",
value: "prod7Mog8r56sn5dPwze8nVdf94veEawdxNNqd5v7A1",
link: true,
},
{
name: "Frontend",
value: "https://swap.kamino.finance",
link: false,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
link: false,
link: true,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this table needs to be refactored a bit if we want to use it for non-explorer links. A future TODO

},
]}
/>
</Tabs.Tab>

<Tabs.Tab>

<Callout type="warning" emoji="⚠️">
To simulate real performance conditions and activity, the staging/testing
environment for Solana is on the mainnet-beta network. This environment is not
for production use and should only be used for testing.
</Callout>

<Tabs.Tab>
Auction Server endpoint: https://per-staging.dourolabs.app/

### Solana
### Testing

**Network Details:**

<AddressSvmTable
explorer={"https://solscan.io/account/$ADDRESS"}
entries={[
{
name: "Express Relay Program",
name: "Express Relay Program (Swaps)",
value: "stag1NN9voD7436oFvKmy1kvRZYLLW8drKocSCt2W79",
link: true,
},
{
name: "Express Relay Program (Limit Orders)",
value: "PytERJFhAKuNNuaiXkApLfWzwNwSNDACpigT3LwQfou",
link: true,
},
Expand Down
1 change: 0 additions & 1 deletion pages/express-relay/errors.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@

This section covers error codes one may run into during integration. Please see the relevant section below for the environment of interest.

- [EVM](errors/evm)
- [SVM](errors/svm)
1 change: 0 additions & 1 deletion pages/express-relay/errors/_meta.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"evm": "EVM",
"svm": "SVM"
}
33 changes: 0 additions & 33 deletions pages/express-relay/errors/evm.mdx

This file was deleted.

24 changes: 13 additions & 11 deletions pages/express-relay/errors/svm.mdx
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# SVM Error Codes

The following table lists the error codes and their explanations for the [`ExpressRelay`](https://github.com/pyth-network/per/tree/fccac65b00cff1cfe5c278b333a582fe66bda0f8/contracts/svm/programs/express_relay) programs.
The following table lists the error codes and their explanations for the [`ExpressRelay`](https://github.com/pyth-network/per/tree/358eedc1f9072cdfc3418fba309697580f2474f9/contracts/svm/programs/express_relay) programs.
They can be used to identify the cause of a failed transaction or bid.

## ExpressRelay

| Error | Explanation |
| ----------------------------- | ------------------------------------------------------------------------------------------- |
| `FeeSplitLargerThanPrecision` | The proposed fee split is invalid (split is larger than `FEE_SPLIT_PRECISION`, 10000) |
| `FeesHigherThanBid` | The fees to pay out exceed the value of the bid amount. |
| `DeadlinePassed` | The bid is no longer valid, as the Unix time deadline has passed. |
| `InvalidCPISubmitBid` | The `SubmitBid` instruction should not be called via CPI. |
| `MissingPermission` | The transaction is missing a `SubmitBid` instruction with the matching permission key. |
| `MultiplePermissions` | The transaction should not contain more than one `SubmitBid` instruction. |
| `InsufficientSearcherFunds` | The searcher lacks the funds to pay the specified bid amount. |
| `InsufficientRent` | The fees splits received by different parties must be sufficient to cover the account rent. |
| Error | Explanation |
| ----------------------------- | ----------------------------------------------------------------------------------------------- |
| `FeeSplitLargerThanPrecision` | The proposed fee split is invalid (split is larger than `FEE_SPLIT_PRECISION`, 10000) |
| `FeesHigherThanBid` | The fees to pay out exceed the value of the bid amount. |
| `DeadlinePassed` | The bid is no longer valid, as the Unix time deadline has passed. |
| `InvalidCPISubmitBid` | The `SubmitBid` instruction should not be called via CPI. |
| `MissingPermission` | The transaction is missing a `SubmitBid` instruction with the matching permission key. |
| `MultiplePermissions` | The transaction should not contain more than one `SubmitBid` instruction. |
| `InsufficientSearcherFunds` | The searcher lacks the funds to pay the specified amount. |
| `InsufficientRent` | The fees splits received by different parties must be sufficient to cover the account rent. |
| `InvalidReferralFee` | The provided referral fee in the swap instruction data is too high to be a valid number of bps. |
| `InsufficientUserFunds` | The user lacks the funds to pay the specified amount in the swap instruction. |
27 changes: 10 additions & 17 deletions pages/express-relay/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@ import CodeIcon from "../../components/icons/CodeIcon";

# Introduction

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).
Express Relay is a priority auction which enables better orderflow mechanisms that eliminate [Maximal Extractable Value](https://www.ledger.com/academy/glossary/maximal-extractable-value-mev) (MEV).

- **For Protocol Developers:** Express Relay allows protocols to recapture MEV and access a network of searchers.
With Express Relay, protocols don't need to spend time and energy bootstrapping a protocol-specific searcher network.
- **For Protocol Developers:** Express Relay allows protocols to recapture MEV and access a network of searchers for more competitive pricing than on-chain sources provide.
With Express Relay, protocols get access to plug-and-play liquidity.

- **For Searchers:** Express Relay provides easy and unified access by aggregating liquidation and other MEV opportunities across integrated DeFi protocols.
Searchers integrate once and gain access to all existing and future opportunities.
- **For Searchers:** Express Relay provides easy and unified access to a range of orderflow opportunities across integrated DeFi protocols.

## Integration

To integrate with Express Relay, you can integrate as a protocol or as a searcher.
To integrate with Express Relay, you can integrate as a protocol (to power token swaps) or as a searcher.

<Cards>
<Card
Expand All @@ -38,15 +37,9 @@ To integrate with Express Relay, you can integrate as a protocol or as a searche
To learn more about Express Relay, refer to the following resources:

<Cards>
<Card
icon={<QuestionMarkIcon />}
title="How Express Relay Works"
href="./express-relay/how-express-relay-works "
/>

<Card
icon={<CodeIcon />}
title="Example Protocol Integration"
href="https://github.com/pyth-network/pyth-examples/tree/6cea7c9602c7949c6dacc94aec44c0fe78ccb128/express-relay/easy_lend"
/>
<Card
icon={<QuestionMarkIcon />}
title="How Express Relay Works"
href="./express-relay/how-express-relay-works "
/>
</Cards>
Loading