Skip to content

Commit a5362a0

Browse files
Kman/update v.9 updates (#409)
* move vocs-docs files to the root * updating old vocs-docs path * Remove pnpm action setup from lint workflow * Update lint workflow to install pnpm globally * Update lint command in package.json to use glob pattern for documentation files * Update fee * set C factor to 0 * Update PK example for Typescript * Update guide for OEGS testnet * Update guide for OEGS testnet info * Update description on PK's * Update PK example fromwallet * Put typescript implementation on first tab for now * Fix revshare tpyo --------- Co-authored-by: alexeykichin <[email protected]>
1 parent 8f130ac commit a5362a0

File tree

9 files changed

+99
-55
lines changed

9 files changed

+99
-55
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
dist
2-
/node_modules
2+
/node_modules
3+
vocs-docs/

docs/pages/concepts/architecture/oegs.mdx

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11

22
# OEGS
33

4-
## What is the Order Entry Gateway Service (OEGS) ?
4+
## What is the Order Entry Gateway Service (OEGS)
55
The Order Entry Gateway represents the next step in dYdX’s multi-stage performance evolution:
66

7-
1. Today — full node gossip across all validators.
8-
2. Designated proposers — predictable topology for faster routing (available in v9 software upgrade).
9-
3. Order Entry Gateway Service (OEGS) — specialized nodes for direct, one-hop delivery to proposers (available after v9 upgrade).
7+
1. Designated proposers — A governance-selected subset of validators responsible for proposing blocks. This creates a predictable topology for faster routing (available in v9 software upgrade).
8+
2. Order Entry Gateway Service (OEGS) — specialized nodes for direct, one-hop delivery to proposers (available after v9 upgrade).
109

11-
This staged evolution ensures each layer builds on order latency improvements while keeping the protocol’s decentralized governance and consensus guarantees intact.
10+
The Order Entry Gateway Service (OEGS) is open-sourced infrastructure that provides a direct, optimized path from traders to the proposer set, reducing latency, increasing throughput, and lowering barriers for professional and retail traders alike.
11+
OEGS is now live on testnet, reach out to us for more information.
1212

13-
At dYdX, the mission is clear: make perpetuals trading as fast, fair, and reliable as possible — without compromising the decentralization that defines DeFi. As the protocol scales, the infrastructure that routes and processes orders must evolve alongside it.
14-
15-
That’s why we’re introducing the Order Entry Gateway Service (OEGS) — open-sourced infrastructure that provides a direct, optimized path from traders to the proposer set, reducing latency, increasing throughput, and lowering barriers for professional and retail traders alike.
16-
17-
## 1. Current State
18-
In today’s dYdX architecture (original blog post [here](https://www.dydx.xyz/blog/v4-technical-architecture-overview)), orders from traders — whether via the web app, mobile, API, or third-party integration — are submitted to full nodes, which then gossip them across the network until they reach the current block proposer.
13+
## 1. Previous State
14+
In dYdX previous architecture (original blog post [here](https://www.dydx.xyz/blog/v4-technical-architecture-overview)), orders from traders — whether via the web app, mobile, API, or third-party integration — are submitted to full nodes, which then gossip them across the network until they reach the current block proposer.
1915

2016
**Pros**: Fully decentralized, no single point of routing.
2117

@@ -43,7 +39,7 @@ Historically, traders relying solely on the public Indexer have faced reliabilit
4339
## 2. Designated Proposers
4440
We recently introduced the concept of designated proposers (blog post [here](https://www.dydx.xyz/blog/governance-controlled-path-reliability-and-performance)) — a governance-selected subset of validators responsible for proposing blocks. This change to the open-source software creates a predictable topology, making it possible to route transactions directly to the next proposer instead of broadcasting widely. This is a fully deterministic enhancement to CometBFT that brings increased resilience, network performance, and operational clarity — while preserving the full validator set, stake-based voting power, and decentralized governance of the network.
4541

46-
## 3. Enter the Order Entry Gateway Service (OEGS)
42+
## 3. The Order Entry Gateway Service (OEGS)
4743
The OEGS builds on the designated proposer model by creating a specialized set of gateway nodes that:
4844

4945
Peer directly with all designated proposers.

docs/pages/concepts/architecture/overview.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ In service of building an end-to-end decentralized experience, dYdX has built th
3232

3333
- **Mobile**: The iOS and Android apps are built in native Swift and Kotlin, respectively. The mobile apps interact with the Indexer in the same way the web application does, and will send trades directly to the chain. The mobile apps have been open sourced as well, allowing anyone to deploy the mobile app to the App Store or Play store. Specifically for the App store, the deployer needs to have a developer account as well as a Bitrise account to go through the app submission process.
3434

35+
### Order Entry Gateway Service (OEGS) ?
36+
The Order Entry Gateway represents the next step in dYdX’s multi-stage performance evolution and is made possible by the following 2 designs:
37+
38+
1. Designated proposers — A governance-selected subset of validators responsible for proposing blocks. This creates a predictable topology for faster routing (available in v9 software upgrade).
39+
2. Order Entry Gateway Service (OEGS) — open-sourced infrastructure that provides a direct, optimized path from traders to the proposer set, reducing latency, increasing throughput, and lowering barriers for professional and retail traders alike (available now on testnet).
40+
41+
3542
### Lifecycle of an Order
3643

3744
Now that we have a better understanding of each of the components of dYdX Chain, let's take a look at how it all comes together when placing an order. When an order is placed on dYdX Chain, it follows the flow below:

docs/pages/concepts/trading/rewards/index.mdx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,17 @@ There are several reward mechanisms available with the protocol software.
2121

2222
See more on [Staking Rewards](/concepts/trading/rewards/staking-rewards).
2323

24-
## Trading Rewards
24+
## Trading Rewards (Note that C factor has been set to 0)
2525

2626
- Rewards distributed to `Traders` after each successful trade
2727
- Based on a specified `formula` with several inputs
2828
- Distributed automatically every block with successful trades
2929
- Claimed automatically
3030

31+
:::note
32+
Note that traders now earn 50% trading rebates directly after each trade as trading rewards via C factor have been set to 0 via governance.
33+
:::
34+
3135
See more on [Trading Rewards](/concepts/trading/rewards/trading-rewards).
3236

3337
## Fees
@@ -44,12 +48,10 @@ The basic structure for fees have been developed to reflect the following charac
4448
| 1 | < $1M | 5.0 | 1.0 |
4549
| 2 | ≥ $1M | 4.5 | 1.0 |
4650
| 3 | ≥ $5M | 4.0 | 0.5 |
47-
| 4 | ≥ $25M | 3.5 ||
48-
| 5 | ≥ $125M | 3.0 ||
49-
| 6 | ≥ $125M and ≥0.5% exchange mkt. share | 2.5 | -0.5 |
50-
| 7 | ≥ $125M and ≥1% maker mkt. share | 2.5 | -0.7 |
51-
| 8 | ≥ $125M and ≥2% maker mkt. share | 2.5 | -0.9 |
52-
| 9 | ≥ $125M and ≥4% maker mkt. share | 2.5 | -1.1 |
51+
| 4 | ≥ $25M | 3.5 | 0 |
52+
| 5 | ≥ $50M | 3.0 | 0 |
53+
| 6 | ≥ $100M | 2.5 | -0.7 |
54+
| 7 | ≥ $200M | 2.5 | -1.1 |
5355

5456
## Parameters
5557

docs/pages/concepts/trading/rewards/trading-rewards.mdx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,17 @@ Below is an example using the given formula to calculate the trading reward base
9494
- `Taker Fee Revenue Share`: the taker fee revenue share is 60% or 0.6 including 50% to MegaVault and 10% to Treasury subDAO, as well as 0% to market mapper for a given market.
9595
- `C`: A constant multiplier that is currently set to 0.5 by the dYdX governance, but subject to change through dYdX governance.
9696

97+
:::note
98+
Note that the community has voted to set the C parameter to 0
99+
:::
100+
97101
```
98-
Trading Reward from Taker Fee = 1,000,000 * (0.0004 − 0.00011 − 0.0002) * 0.5 * (1−0.6)
99-
Trading Reward from Taker Fee = 1,000,000 * 0.00009 * 0.5 * 0.4 = 18
102+
Trading Reward from Taker Fee = 1,000,000 * (0.0004 − 0.00011 − 0.0002) * 0.4 * (1−0.6)
103+
Trading Reward from Taker Fee = 1,000,000 * 0.00009 * 0.4 * 0.4 = 18
100104
```
101105

102106
For this example, the Trading Reward would be equivalent to $18 in DYDX for an approximate Taker Fee of $400 paid by the user.
107+
Note that however since the C factor has been reduced to 0, traders now get rebates directly instead of C constant trading rewards
103108

104109

105110
## FAQ

docs/pages/interaction/deposits-withdrawals/overview.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
This guide provides a **step-by-step** explanation of deposit and withdrawal processes on the dYdX Chain. It includes instructions for Skip Go Fast (`Instant`), Skip Go (`regular`), Coinbase deposits, and direct IBC transfers, along with troubleshooting methods and best practices to ensure seamless transactions.
44

5+
:::note
6+
Note that for deposits > $20, skip go fast is the default option.
7+
:::
8+
59
## Deposit & Withdrawal Methods
610

711
| Method | Description | Finality | Chains Supported | Fee Range (USD) |

docs/pages/interaction/integration/integration-revshare.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ To update the revenue share percentage for an existing order router, create a go
5252
"authority": authority,
5353
"order_router_rev_share": {
5454
"address": {{your existing address}},
55-
"sharePpm": {{your new requested ppm}},
55+
"share_ppm": {{your new requested ppm}},
5656
}
5757
}
5858
]
@@ -78,7 +78,7 @@ Submit a governance proposal with the following message structure:
7878
"authority": authority,
7979
"order_router_rev_share": {
8080
"address": {{your existing address}},
81-
"sharePpm": 0,
81+
"share_ppm": 0,
8282
}
8383
}
8484
]

docs/pages/interaction/permissioned-keys/index.mdx

Lines changed: 60 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,32 @@ This section will guide you through authenticators use and management. We show t
99

1010
## Owner
1111

12+
There are 2 ways to setup Permissioned API Keys:
13+
1/ Via the Trade interface (default permissions to trade on all cross-margin pairs)
14+
2/ Via API (customisable)
15+
16+
1217
::::steps
1318

19+
### Setup Permissioned API Keys via Trade Interface
20+
21+
![Setup Permissioned API Key](/APIKey.png)
22+
23+
On the dYdX.trade, after signing in with your wallet or socials:
24+
- click `More → API Trading Keys`.
25+
- Click `Generate New API Key`. This generates a new keypair:
26+
- API Wallet Address
27+
- Private Key
28+
:::note
29+
This is a one-time view, make sure to save your Private Key immediately. It will not be shown again and is not stored by dYdX
30+
:::
31+
- Check the `terms` and click `Authorize API Key`.
32+
- Now you can go to [Import private key](/interaction/permissioned-keys#trader) to start trading via API keys.
33+
34+
1435
### Create an authenticator
1536

16-
Lets create an authenticator which allows only the **trader** to place orders.
37+
Alternatively, you can create a custom authenticator which allows only the **trader** to place orders.
1738

1839
To create this authenticator, we use two sub-authenticators: `signatureVerification` and `messageFilter`:
1940
- the `signatureVerification` authenticator must be present in all authenticator sets and contains the **trader**'s public key;
@@ -170,20 +191,53 @@ client
170191

171192
::::steps
172193

173-
### Get the authenticator ID
174194

175-
Grab the authenticator ID created by the **owner** in [**Owner**::Step 2](/interaction/permissioned-keys#add-the-authenticator), either by:
176-
- request to the **owner** through other channels, or;
177-
- by using the list authenticators method to fetch the last authenticator (see [**Owner**::Step 3](/interaction/permissioned-keys#last-authenticators)).
195+
### Get the authenticator ID and permissioned API Key
196+
197+
Grab the `authenticatorId` created by the **owner** in [Add authenticator](/interaction/permissioned-keys#add-the-authenticator), either by:
198+
- request the **owner** for the `authenticatorId` or by using the list authenticators method to fetch the to be used authenticator (see [list authenticators](/interaction/permissioned-keys#last-authenticators)).
199+
- Get the private key `DYDX_TEST_PRIVATE_KEY` from the owner in [via the Trade Interface](/interaction/permissioned-keys#get-the-private-key).
200+
201+
202+
### Setup the permissioned wallet
203+
If you got a private key from the trading interface load in via `fromPrivateKey`, otherwise use `fromMnemonic` if you didn't create via the trading interface by assigning to mnemonic.
204+
205+
```typescript
206+
const fromWallet = await LocalWallet.fromPrivateKey(DYDX_TEST_PRIVATE_KEY, BECH32_PREFIX);
207+
const authenticatedSubaccount = SubaccountInfo.forPermissionedWallet(
208+
fromWallet,
209+
address, //owner dydx address
210+
subaccountNumber, //subaccount to trade onbehalf of
211+
[authenticatorId],
212+
)
213+
```
214+
178215

179216
### Using the authenticator
180217

181-
Having the authenticator ID, the **trader** can now use it to perform the allowed actions.
218+
The **trader** can now use the permissioned API key to perform the allowed trading actions.
182219

183220
In this example, the **trader** can use the authenticator to issue orders on the behalf of the **owner**.
184221

185222
:::code-group
186223

224+
```typescript [TypeScript]
225+
const client = await CompositeClient.connect(network);
226+
// Place an order using the authenticator.
227+
const tx = await client.placeShortTermOrder(
228+
authenticatedSubaccount,
229+
'ETH-USD',
230+
side,
231+
price,
232+
0.01,
233+
clientId,
234+
goodTilBlock,
235+
timeInForce,
236+
false,
237+
undefined,
238+
);
239+
```
240+
187241
```python [Python]
188242
id = ... # authenticator ID # [!code focus]
189243
# Create the order ID, using the owner address # [!code focus]
@@ -204,31 +258,6 @@ tx_options = TxOptions([id], wallet.sequence, wallet.account_number) # [!code fo
204258
place = await node.place_order(wallet, order, tx_options) # [!code focus]
205259
```
206260

207-
```typescript [TypeScript]
208-
const client = await CompositeClient.connect(network);
209-
const wallet = await LocalWallet.fromMnemonic(DYDX_TEST_MNEMONIC_2, BECH32_PREFIX);
210-
const subaccount = new SubaccountInfo(wallet, 0);
211-
const ownerSubaccount = ...;
212-
const id = ...; // authenticator ID
213-
const currentBlock = await client.validatorClient.get.latestBlockHeight();
214-
// Place an order using the authenticator. // [!code focus]
215-
const tx = await client.placeShortTermOrder( // [!code focus]
216-
subaccount, // [!code focus]
217-
'ETH-USD',
218-
OrderSide.BUY,
219-
1000,
220-
0.01,
221-
Math.floor(Math.random() * 10000), // client ID
222-
currentBlock + 10,
223-
Order_TimeInForce.TIME_IN_FORCE_UNSPECIFIED,
224-
false,
225-
undefined,
226-
{ // [!code focus]
227-
authenticators: [id], // [!code focus]
228-
accountForOrder: ownerSubaccount, // [!code focus]
229-
}, // [!code focus]
230-
); // [!code focus]
231-
```
232261

233262
```rust [Rust]
234263
// Create a `PublicAccount` representing the owner. // [!code focus]

docs/public/APIKey.png

113 KB
Loading

0 commit comments

Comments
 (0)