Skip to content

Commit 731684b

Browse files
authored
Feat/update er docs (#645)
* update Reference Material * add integrate-as-protocol changes * remove evm guides from searcher integration * standardize language: mkt -> swaps; * update to permalinks * address comments
1 parent 5f6146e commit 731684b

22 files changed

+212
-959
lines changed

components/AddressSvmTable.tsx

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import copy from "copy-to-clipboard";
2+
import CopyIcon from "./icons/CopyIcon";
13
import { StyledTd } from "./Table";
24

35
const AddressSvmTable = ({
@@ -11,15 +13,6 @@ const AddressSvmTable = ({
1113
<table>
1214
<tbody>
1315
{entries.map(({ name, value, link }) => {
14-
const component = (
15-
<code
16-
className={
17-
"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 "
18-
}
19-
>
20-
{value}
21-
</code>
22-
);
2316
const addLink = explorer.includes("$ADDRESS") && link;
2417
return (
2518
<tr key={name}>
@@ -28,16 +21,26 @@ const AddressSvmTable = ({
2821
{addLink ? (
2922
<a
3023
href={explorer.replace("$ADDRESS", value)}
31-
className={
32-
"nx-text-primary-600 nx-underline nx-decoration-from-font [text-underline-position:from-font]"
33-
}
34-
target={"_blank"}
24+
className="nx-text-primary-600 nx-underline nx-decoration-from-font [text-underline-position:from-font]"
25+
target="_blank"
26+
rel="noopener noreferrer"
3527
>
36-
{component}
28+
<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">
29+
{value}
30+
</code>
3731
</a>
3832
) : (
39-
component
33+
<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">
34+
{value}
35+
</code>
4036
)}
37+
38+
<button
39+
onClick={() => copy(value)}
40+
className="p-1 hover:bg-light dark:hover:bg-dark rounded"
41+
>
42+
<CopyIcon className="shrink-0" />
43+
</button>
4144
</StyledTd>
4245
</tr>
4346
);

pages/express-relay/_meta.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@
3131
"websocket-api-reference": "Websocket API Reference",
3232
"contract-addresses": "Contract Addresses",
3333
"errors": "Error Codes",
34-
"examples": {
35-
"title": "Example Application ↗",
36-
"href": "https://github.com/pyth-network/pyth-examples/tree/6cea7c9602c7949c6dacc94aec44c0fe78ccb128/express-relay/easy_lend",
37-
"newWindow": true
38-
},
3934
"-- Understand Express Relay": {
4035
"title": "Understanding Express Relay",
4136
"type": "separator"

pages/express-relay/contract-addresses.mdx

Lines changed: 0 additions & 6 deletions
This file was deleted.

pages/express-relay/contract-addresses/_meta.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

pages/express-relay/contract-addresses/evm.mdx

Lines changed: 0 additions & 138 deletions
This file was deleted.

pages/express-relay/contract-addresses/svm.mdx

Lines changed: 59 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,83 @@
1+
---
2+
title: SVM
3+
---
4+
15
import { Tabs, Callout } from "nextra/components";
26
import AddressSvmTable from "../../../components/AddressSvmTable";
37

8+
# SVM Contract Addresses
9+
410
Express Relay is currently deployed on the following SVM environments:
511

6-
<Tabs items={['Solana Mainnet-Beta Testing']}>
12+
<Tabs items={['Prod (Solana Mainnet-Beta)', 'Testing (Solana Mainnet-Beta)']}>
13+
<Tabs.Tab>
14+
Auction Server endpoint: https://pyth-express-relay-mainnet.asymmetric.re/
15+
16+
### Prod
17+
18+
**Network Details:**
19+
20+
<AddressSvmTable
21+
explorer={"https://solscan.io/account/$ADDRESS"}
22+
entries={[
23+
{
24+
name: "Express Relay Program",
25+
value: "PytERJFhAKuNNuaiXkApLfWzwNwSNDACpigT3LwQfou",
26+
link: true,
27+
},
28+
{
29+
name: "Limo Limit Order Program",
30+
value: "LiMoM9rMhrdYrfzUCxQppvxCSG1FcrUK9G8uLq4A1GF",
31+
link: true,
32+
},
33+
{
34+
name: "Chain Id",
35+
value: "solana",
36+
link: false,
37+
},
38+
{
39+
name: "Public RPC",
40+
value: "https://api.mainnet-beta.solana.com",
41+
link: false,
42+
},
43+
{
44+
name: "Limo Global Order Config",
45+
value: "prod7Mog8r56sn5dPwze8nVdf94veEawdxNNqd5v7A1",
46+
link: true,
47+
},
48+
{
49+
name: "Frontend",
50+
value: "https://swap.kamino.finance",
51+
link: false,
52+
},
53+
]}
54+
/>
55+
</Tabs.Tab>
56+
57+
<Tabs.Tab>
758

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

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

17-
### Solana
67+
### Testing
1868

1969
**Network Details:**
2070

2171
<AddressSvmTable
2272
explorer={"https://solscan.io/account/$ADDRESS"}
2373
entries={[
2474
{
25-
name: "Express Relay Program",
75+
name: "Express Relay Program (Swaps)",
76+
value: "stag1NN9voD7436oFvKmy1kvRZYLLW8drKocSCt2W79",
77+
link: true,
78+
},
79+
{
80+
name: "Express Relay Program (Limit Orders)",
2681
value: "PytERJFhAKuNNuaiXkApLfWzwNwSNDACpigT3LwQfou",
2782
link: true,
2883
},

pages/express-relay/errors.mdx

Lines changed: 0 additions & 6 deletions
This file was deleted.

pages/express-relay/errors/_meta.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

pages/express-relay/errors/evm.mdx

Lines changed: 0 additions & 33 deletions
This file was deleted.

pages/express-relay/errors/svm.mdx

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
1+
---
2+
title: SVM
3+
---
4+
15
# SVM Error Codes
26

3-
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.
7+
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.
48
They can be used to identify the cause of a failed transaction or bid.
59

610
## ExpressRelay
711

8-
| Error | Explanation |
9-
| ----------------------------- | ------------------------------------------------------------------------------------------- |
10-
| `FeeSplitLargerThanPrecision` | The proposed fee split is invalid (split is larger than `FEE_SPLIT_PRECISION`, 10000) |
11-
| `FeesHigherThanBid` | The fees to pay out exceed the value of the bid amount. |
12-
| `DeadlinePassed` | The bid is no longer valid, as the Unix time deadline has passed. |
13-
| `InvalidCPISubmitBid` | The `SubmitBid` instruction should not be called via CPI. |
14-
| `MissingPermission` | The transaction is missing a `SubmitBid` instruction with the matching permission key. |
15-
| `MultiplePermissions` | The transaction should not contain more than one `SubmitBid` instruction. |
16-
| `InsufficientSearcherFunds` | The searcher lacks the funds to pay the specified bid amount. |
17-
| `InsufficientRent` | The fees splits received by different parties must be sufficient to cover the account rent. |
12+
| Error | Explanation |
13+
| ----------------------------- | -------------------------------------------------------------------------------------------------------- |
14+
| `FeeSplitLargerThanPrecision` | The proposed fee split is invalid (split is larger than `FEE_SPLIT_PRECISION`, 10000) |
15+
| `FeesHigherThanBid` | The fees to pay out exceed the value of the bid amount. |
16+
| `DeadlinePassed` | The bid is no longer valid, as the Unix time deadline has passed. |
17+
| `InvalidCPISubmitBid` | The `SubmitBid` instruction should not be called via CPI. |
18+
| `MissingPermission` | The transaction is missing a `SubmitBid` instruction with the matching permission key. |
19+
| `MultiplePermissions` | The transaction should not contain more than one `SubmitBid` instruction. |
20+
| `InsufficientSearcherFunds` | The searcher lacks the funds to pay the specified amount. |
21+
| `InsufficientRent` | The fee splits received by different parties must be sufficient to cover the account rent. |
22+
| `InvalidReferralFee` | The provided referral fee in the swap instruction data is too high to be a valid number of basis points. |
23+
| `InsufficientUserFunds` | The user lacks the funds to pay the specified amount in the swap instruction. |

0 commit comments

Comments
 (0)