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 all 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
33 changes: 18 additions & 15 deletions components/AddressSvmTable.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import copy from "copy-to-clipboard";
import CopyIcon from "./icons/CopyIcon";
import { StyledTd } from "./Table";

const AddressSvmTable = ({
Expand All @@ -11,15 +13,6 @@ const AddressSvmTable = ({
<table>
<tbody>
{entries.map(({ name, value, link }) => {
const component = (
<code
className={
"nx-border-black nx-border-opacity-[0.04] nx-bg-opacity-[0.03] nx-bg-black nx-break-words nx-rounded-md nx-border nx-py-0.5 nx-px-[.25em] nx-text-[.9em] dark:nx-border-white/10 dark:nx-bg-white/10 "
}
>
{value}
</code>
);
const addLink = explorer.includes("$ADDRESS") && link;
return (
<tr key={name}>
Expand All @@ -28,16 +21,26 @@ const AddressSvmTable = ({
{addLink ? (
<a
href={explorer.replace("$ADDRESS", value)}
className={
"nx-text-primary-600 nx-underline nx-decoration-from-font [text-underline-position:from-font]"
}
target={"_blank"}
className="nx-text-primary-600 nx-underline nx-decoration-from-font [text-underline-position:from-font]"
target="_blank"
rel="noopener noreferrer"
>
{component}
<code className="nx-border-black nx-border-opacity-[0.04] nx-bg-opacity-[0.03] nx-bg-black nx-break-words nx-rounded-md nx-border nx-py-0.5 nx-px-[.25em] nx-text-[.9em] dark:nx-border-white/10 dark:nx-bg-white/10">
{value}
</code>
</a>
) : (
component
<code className="nx-border-black nx-border-opacity-[0.04] nx-bg-opacity-[0.03] nx-bg-black nx-break-words nx-rounded-md nx-border nx-py-0.5 nx-px-[.25em] nx-text-[.9em] dark:nx-border-white/10 dark:nx-bg-white/10">
{value}
</code>
)}

<button
onClick={() => copy(value)}
className="p-1 hover:bg-light dark:hover:bg-dark rounded"
>
<CopyIcon className="shrink-0" />
</button>
</StyledTd>
</tr>
);
Expand Down
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
6 changes: 0 additions & 6 deletions pages/express-relay/contract-addresses.mdx

This file was deleted.

4 changes: 0 additions & 4 deletions pages/express-relay/contract-addresses/_meta.json

This file was deleted.

138 changes: 0 additions & 138 deletions pages/express-relay/contract-addresses/evm.mdx

This file was deleted.

63 changes: 59 additions & 4 deletions pages/express-relay/contract-addresses/svm.mdx
Original file line number Diff line number Diff line change
@@ -1,28 +1,83 @@
---
title: SVM
---

import { Tabs, Callout } from "nextra/components";
import AddressSvmTable from "../../../components/AddressSvmTable";

# SVM Contract Addresses

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
6 changes: 0 additions & 6 deletions pages/express-relay/errors.mdx

This file was deleted.

4 changes: 0 additions & 4 deletions pages/express-relay/errors/_meta.json

This file was deleted.

33 changes: 0 additions & 33 deletions pages/express-relay/errors/evm.mdx

This file was deleted.

28 changes: 17 additions & 11 deletions pages/express-relay/errors/svm.mdx
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
---
title: SVM
---

# 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 fee 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 basis points. |
| `InsufficientUserFunds` | The user lacks the funds to pay the specified amount in the swap instruction. |
Loading