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: pages/express-relay/integrate-as-protocol.mdx
+18-19Lines changed: 18 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -54,11 +54,7 @@ Developers need to update the Protocol's contract to:
54
54
55
55
The `isPermissioned` function takes two arguments:
56
56
1.`protocolFeeReceiver`: The address of the Protocol's contract.
57
-
1.`permissionId`: A unique identifier for the liquidation opportunity.
58
-
59
-
<Callouttype="info"emoji="ℹ️">
60
-
The `permissionId` allows you to permission an depermission a set of transaction. ........ To know more about permission ID, refer to the [Permission ID](#) page.
61
-
</Callout>
57
+
1.`permissionId`: A unique identifier of a vault or position eligible for liquidation.
The `permissionId` represents unique identifying information for the vault or position within a protocol.
76
+
It can be the vault address or the vault ID, concatenated into `bytes` format.
77
+
Consult [`Permission Id`](#) for more information on generating permission IDs.
78
+
</Callout>
79
79
80
80
#### 2. Set up Fee Receiver
81
81
82
-
The `IExpressRelayFeeReceiver` interface requires the Protocol's contract to implement the `receiveAuctionProceedings` function. The Express Relay server calls this function to send funds to the protocol's contract.
82
+
After a successful auction, the Express Relay server sends funds to the Protocol's contract.
83
+
Express Relay server calls the `receiveAuctionProceedings` function present in `IExpressRelayFeeReceiver` to send funds to the Protocol's contract
abi.encode(vaultID) // vault id uniquely represents the opportunity and can be used as permission id
136
+
abi.encode(vaultID) // permissionId generated from the unique vault ID
142
137
);
143
138
require(permissioned, "invalid liquidation");
144
139
@@ -168,7 +163,7 @@ contract EasyLend is IExpressRelayFeeReceiver {
168
163
169
164
## Expose Liquidation Opportunities to Searchers
170
165
171
-
Protocols must fetch liquidation opportunities like vaults and positions eligible for liquidation and expose them to Express Relay for auction.
166
+
Protocols must fetch vaults and positions eligible for liquidation and expose them to Express Relay for auction.
172
167
173
168
The Express Relay auction server provides a **POST** method, `/v1/opportunities`, which accepts a JSON payload containing the details of the liquidation opportunity.
174
169
@@ -197,11 +192,11 @@ The JSON payload should contain liquidation opportunities in the following forma
197
192
}
198
193
```
199
194
200
-
TODO: Include a callout to give more info about permission ID
201
195
202
196
Protocols must evaluate each position's health using the latest Oracle prices before exposing them to Express Relay.
203
197
You can do this by indexing the chain, listening to protocol events, or querying open positions through an RPC provider.
204
198
199
+
Check the [`monitor.ts`]() script, which fetches liquidation opportunities for the below-mentioned [Easy Lend](https://github.com/pyth-network/pyth-crosschain/tree/main/express_relay/examples/easy_lend) example and exposes them to Express Relay for auction.
205
200
206
201
207
202
## Additional Resources
@@ -214,6 +209,10 @@ You may find these additional resources helpful for integrating Express Relay as
214
209
215
210
### Contract Address
216
211
212
+
The [Contract Address](./contract-addresses.mdx) page lists the addresses of Express Relay deployed on various networks.
213
+
217
214
### Error Codes
218
215
219
-
### API Reference
216
+
### API Reference
217
+
218
+
The [API Reference](https://per-staging.dourolabs.app/docs/) provides detailed information on the Express Relay API.
0 commit comments