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
+20-20Lines changed: 20 additions & 20 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
137
+
abi.encode(vaultID) // permissionId generated from the unique vault ID
142
138
);
143
139
require(permissioned, "invalid liquidation");
144
140
@@ -168,7 +164,7 @@ contract EasyLend is IExpressRelayFeeReceiver {
168
164
169
165
## Expose Liquidation Opportunities to Searchers
170
166
171
-
Protocols must fetch liquidation opportunities like vaults and positions eligible for liquidation and expose them to Express Relay for auction.
167
+
Protocols should fetch vaults and positions eligible for liquidation and expose them to Express Relay for auction.
172
168
173
169
The Express Relay auction server provides a **POST** method, `/v1/opportunities`, which accepts a JSON payload containing the details of the liquidation opportunity.
174
170
@@ -197,11 +193,11 @@ The JSON payload should contain liquidation opportunities in the following forma
197
193
}
198
194
```
199
195
200
-
TODO: Include a callout to give more info about permission ID
201
196
202
197
Protocols must evaluate each position's health using the latest Oracle prices before exposing them to Express Relay.
203
198
You can do this by indexing the chain, listening to protocol events, or querying open positions through an RPC provider.
204
199
200
+
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
201
206
202
207
203
## Additional Resources
@@ -210,10 +206,14 @@ You may find these additional resources helpful for integrating Express Relay as
210
206
211
207
### Example Application
212
208
213
-
[Easy Lend](https://github.com/pyth-network/pyth-crosschain/tree/main/express_relay/examples/easy_lend) is a simple lending protocol that allows users to borrow and lend assets. This lending protocol contract is updated to permit Express Relay transactions.
209
+
[Easy Lend](https://github.com/pyth-network/pyth-crosschain/tree/main/express_relay/examples/easy_lend) is a dummy lending protocol contract that allows users to borrow and lend assets. This lending protocol contract is updated to permit Express Relay transactions.
214
210
215
211
### Contract Address
216
212
213
+
The [Contract Address](./contract-addresses.mdx) page lists the addresses of Express Relay deployed on various networks.
214
+
217
215
### Error Codes
218
216
219
-
### API Reference
217
+
### API Reference
218
+
219
+
The [API Reference](https://per-staging.dourolabs.app/docs/) provides detailed information on the Express Relay APIs for submitting liquidation opportunities.
0 commit comments