Skip to content

Commit bf4902a

Browse files
committed
update readme
1 parent bbc6664 commit bf4902a

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Swagger UI is served at the root, it is also available at [swap.euler.finance](h
4141

4242
## Fetching quotes and executing trades
4343

44-
The `/swap` endpoint fetches token trade quotes which can be used with the swapping peripheries in the Euler Vault Kit [periphery contracts](https://github.com/euler-xyz/evk-periphery/tree/master/src/Swaps). See [periphery docs](https://github.com/euler-xyz/evk-periphery/blob/master/docs/swaps.md) for detailed description of the swapping architecture in Euler V2. The API response includes both encoded payloads as well as raw data for calls to the `Swapper` (`swap` field of the response) and `SwapVerifier` (`verify` field) contracts. These payloads can be used directly in EVC batches.
44+
The `/swaps` endpoint fetches token trade quotes which can be used with the swapping peripheries in the Euler Vault Kit [periphery contracts](https://github.com/euler-xyz/evk-periphery/tree/master/src/Swaps). See [periphery docs](https://github.com/euler-xyz/evk-periphery/blob/master/docs/swaps.md) for detailed description of the swapping architecture in Euler V2. The API response includes both encoded payloads as well as raw data for calls to the `Swapper` (`swap` field of the response) and `SwapVerifier` (`verify` field) contracts. These payloads can be used directly in EVC batches.
4545

4646
Example of fetching a swap and repay quote to use e.g. in liquidation:
4747

@@ -101,7 +101,7 @@ const batchItems =
101101
value: 0,
102102
data: response.data.swap.swapperData
103103
},
104-
// execut SwapVerifier payload from the API response
104+
// execute SwapVerifier payload from the API response
105105
{
106106
targetContract: response.data.verify.verifierAddress,
107107
onBehalfOfAccount: connectedAccount,
@@ -124,11 +124,18 @@ const evcBatch = encodeFunctionData({
124124
125125
To handle an incoming swap request, the API processes the query through a series of strategies until one of them provides a valid response. The strategy pipelines are defined per chain in `/swapService/config` folder. The strategies can handle requests in multiple ways. The basic one is the balmy SDK strategy, which queries multiple DEXes and aggregators for a swap quote and picks the best one. Strategies can themselves run the pipelines recursively. ERC4626 wrapper can be configured for assets which are vault shares and are not supported by aggregators. The strategy will deposit or redeem vault shares and run the pipeline again, this time using the underlying asset of the vault. For a list of available strategies see `swapService/strategies` folder.
126126
127-
The pipeline definition consits of an array of objects, each of which designates a strategy with its configuration and an optional matching logic. In the following example, the pipeline is configured to query Pendle and LI.FI for swap of the Pendle PT tokens, and 1Inch and LI.FI for all other tokens.
127+
The pipeline definition consits of an array of objects, each of which designates a strategy with its configuration and an optional matching logic. In the following example, the pipeline is configured to query Pendle and LI.FI for swap of the Pendle PT tokens, and 1Inch and LI.FI for all other tokens. There's also a repay wrapper strategy, which processes a regular exact input quote to include a repay on the receiver vault.
128128
129129
```js
130130
const pipeline = [
131-
{
131+
{
132+
strategy: StrategyRepayWrapper.name(),
133+
match: {
134+
isRepay: true,
135+
swapperModes: [SwapperMode.EXACT_IN],
136+
},
137+
},
138+
{
132139
strategy: StrategyBalmySDK.name(),
133140
config: {
134141
sourcesFilter: {

0 commit comments

Comments
 (0)