You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/pages/interaction/integration/integration-builder-codes.mdx
+66-51Lines changed: 66 additions & 51 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,68 +3,83 @@
3
3
Builder codes enables external parties to submit orders to dYdX and collect fees (per-order) for building and routing an order to the exchange.
4
4
The address and fee, in parts per million, needs to be configured via the `BuilderCodeParameters` in the order message itself. The fee will be paid out when the given order is filled.
5
5
6
+
**Important:** Builder code fees are added **on top of each fill**, as opposed to revenue share where the fee revenue is split. No governance proposal is required to use builder codes.
7
+
6
8
Builder fees and addresses can be queried via the indexer using the `/orders` and `/fills` endpoints as usual. `/orders` contains details on the fee rate and builder address. `/fills` also contains the builder address as well as details on the amount charged per-fill.
7
9
8
10
9
-
## Changes To The Order Message
11
+
#Placing orders and verifying Order Router Address in Fills
10
12
11
13
::::steps
12
14
13
15
## BuilderCodeParameters
14
16
`BuilderCodeParameters` is an addition to the order message which will specify:
15
-
- `partner address` - where fees will be routed
16
-
- `fee (in ppm)` that will be charged on order matching
17
-
18
-
```typescript [TypeScript]
19
-
// BuilderCodeParameters interface
20
-
exportinterfaceIBuilderCodeParameters {
21
-
builderAddress:string; // Address to receive the fee
22
-
feePpm:number; // Fee in parts per million
23
-
}
24
-
25
-
// Example: Place an order with builder code parameters
Copy file name to clipboardExpand all lines: docs/pages/interaction/integration/integration-revshare.mdx
+52-92Lines changed: 52 additions & 92 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,133 +17,93 @@ To participate in the Order Router Rev Share program, users need to propose and
17
17
18
18
## Voting in via Governance
19
19
20
-
To participate in the Order Router Rev Share program, you need to create and submit a governance proposal. Below are examples of the governance message structure:
20
+
To participate in the Order Router Rev Share program, you need to create and submit a governance proposal. Since governance proposals require adding gas, deposit, and other parameters, it's recommended to create the proposal using a JSON file and submit it via CLI command.
21
21
22
-
```python [Python]
23
-
# Example: Set order router revenue share via governance
24
-
from dydx_v4_client.node.client import NodeClient
22
+
For an example of the governance proposal JSON structure, see [proposal 311 on Mintscan](https://www.mintscan.io/dydx/proposals/311).
25
23
26
-
# This method creates the governance message
27
-
# Note: This requires governance authority to execute
28
-
asyncdefset_order_router_revenue_share_example():
29
-
node =await NodeClient.connect(network.node)
30
-
31
-
# Set order router revenue share
32
-
# authority: Governance authority address
33
-
# address: Order router address that will receive revenue share
address="dydx1your_router_address", # Your order router address
38
-
share_ppm=5000# 0.5% revenue share (5000 parts per million)
39
-
)
40
-
41
-
print(response)
42
-
```
43
-
44
-
The key components of this message are:
24
+
The key components of the proposal message are:
45
25
46
26
-`address` - The address of the order router that will receive the revenue share. This is also the id you place in your order message
47
-
-`sharePpm` - The revenue share percentage in parts per million (ppm).
27
+
-`share_ppm` - The revenue share percentage in parts per million (ppm)
48
28
49
29
After submitting the proposal, it must go through the standard governance voting process and receive a passing vote before the order router address and revenue share percentage are activated in the system.
50
30
51
-
## Updating Revenue Share (Optional)
52
-
53
-
The process for updating an existing order router's revenue share is the same as setting up a new one. You will need to submit a governance proposal with the updated parameters.
54
-
55
-
To update the revenue share percentage for an existing order router, create a governance message with the same structure:
share_ppm=7500# New revenue share: 0.75% (7500 parts per million)
68
-
)
69
-
70
-
print(response)
71
-
```
72
-
73
-
The proposal must go through the standard governance voting process and receive a passing vote before the updated revenue share percentage takes effect.
74
-
75
-
:::note
76
-
77
-
- You must use the exact same address that was previously approved
78
-
- The update will completely replace the previous configuration once approved
79
-
:::
80
-
81
-
## Deleting an Order Router Rev Share (Optional)
82
-
83
-
To delete an order router's revenue share configuration, you simply need to set the revenue share percentage to 0. This process follows the same governance workflow as setting up or updating a revenue share.
84
-
85
-
Submit a governance proposal with the following message structure:
86
-
87
-
```python [Python]
88
-
# Delete order router revenue share by setting share_ppm to 0
0 commit comments