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
* Added optional --id param to the auto claim withdrawal actions
* Updated ARMs in the README
* README update
* Added new getReserves interface
* Removed Defender from the repo
Actions are bundled via: `pnpm rollup -c src/js/actions/rollup.config.cjs`
80
-
81
79
**Scheduled actions (Talos):** the runner's cron/manual actions live in `src/js/tasks/actions/*.ts`, are scheduled in `migrations/seed_schedules.sql`, and are catalogued in `docs/ACTIONS.md`. When you add, remove, or change the behaviour of a scheduled action, update `docs/ACTIONS.md` in the same change.
-**`src/js/tasks/`** - Hardhat tasks for admin and operational jobs.
69
67
70
68
**Scheduled actions (Talos):** the runner's cron/manual actions live in `src/js/tasks/actions/*.ts`, are scheduled in `migrations/seed_schedules.sql`, and are catalogued in `docs/ACTIONS.md`. When you add, remove, or change the behaviour of a scheduled action, update `docs/ACTIONS.md` in the same change.
Copy file name to clipboardExpand all lines: README.md
+25-91Lines changed: 25 additions & 91 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
# Automated Redemption Manager (ARM)
2
2
3
-
There are currently three ARM contracts:
3
+
There are currently five ARM contracts:
4
4
5
5
1.[Lido ARM](https://docs.originprotocol.com/automated-redemption-manager-arm/steth-arm) on Ethereum with stETH as the base asset and WETH as the liquidity asset.
6
6
2.[EtherFi ARM](https://docs.originprotocol.com/automated-redemption-manager-arm/eeth-arm) on Ethereum with eETH as the base asset and WETH as the liquidity asset.
7
-
3. Ethena ARM on Ethereum with sUSDe as the base asset and USDe as the liquidity asset.
8
-
2.[OS ARM](https://docs.originprotocol.com/os-arm) on Sonic with OS as the base asset and wS as the liquidity asset.
9
-
3. OETH ARM on Ethereum with OETH as the base asset and WETH as the liquidity asset.
7
+
3.[Ethena ARM](https://docs.originprotocol.com/automated-redemption-manager-arm/susde-arm) on Ethereum with sUSDe as the base asset and USDe as the liquidity asset.
8
+
4. USD ARM on Ethereum with PYUSD and USDG as base assets and USDC as the liquidity asset.
9
+
5.[OS ARM](https://docs.originprotocol.com/os-arm) on Sonic with OS as the base asset and wS as the liquidity asset.
10
10
11
11
## Deployed Contracts
12
12
@@ -100,11 +100,27 @@ function swapTokensForExactTokens(
100
100
) external returns (uint256[] memory amounts);
101
101
102
102
/**
103
-
* @notice Get the available liquidity for a each token in the ARM.
104
-
* @return reserve0 The available liquidity for token0
105
-
* @return reserve1 The available liquidity for token1
103
+
* @notice Get the available reserves for each token in the ARM.
104
+
* @dev Applies to the Lido, EtherFi, OETH and OS ARMs.
105
+
* @return reserve0 The available liquidity for token0.
106
+
* @return reserve1 The available liquidity for token1.
106
107
*/
107
108
function getReserves() external view returns (uint256 reserve0, uint256 reserve1);
109
+
110
+
/**
111
+
* @notice Get available liquidity and base asset reserves for a supported base asset.
112
+
* @dev Applies to the Ethena and USD ARMs.
113
+
* For the Ethena ARM, reserveBaseAsset is sUSDe and liquidityAssets are USDe.
114
+
* For the USD ARM, reserveBaseAsset is PYUSD or USDG and liquidityAssets are USDC.
115
+
* Liquidity assets are net of outstanding LP withdrawal claims.
116
+
* @param reserveBaseAsset Supported base asset whose reserve should be returned.
117
+
* @return liquidityAssets Available liquidity assets.
118
+
* @return baseAssetReserve Base assets held directly by the ARM.
@@ -293,7 +309,7 @@ yarn hardhat tenderlySync --network sonic
293
309
yarn hardhat tenderlyUpload --network sonic --name ORIGIN_ARM
294
310
```
295
311
296
-
## Automated Actions (Talos)
312
+
## Automated Actions (Talos)
297
313
298
314
The `src/js/tasks/actions/*.ts` files are hardhat tasks that handle operational jobs (allocations, fee collection, withdrawal requests, etc.). In production they're driven by a container that imports [`@talos/client`](https://github.com/oplabs/talos):
299
315
@@ -316,86 +332,4 @@ pnpm hardhat healthcheck
316
332
317
333
If you opt in by setting `DATABASE_URL` (e.g., via `docker compose up`), the nonce queue engages and will try to connect to whatever that URL points at. `unset DATABASE_URL` to go back to the unwrapped path.
318
334
319
-
Signer selection (`DEPLOYER_PRIVATE_KEY` → KMS via `KMS_RELAYER_ID` → `IMPERSONATE` → Defender → hardhat first signer) lives entirely in `src/js/utils/signers.ts` and is unchanged.
320
-
321
-
## Open Zeppelin Defender
322
-
323
-
[Open Zeppelin Defender v2](https://docs.openzeppelin.com/defender/v2/) is used to manage the Operations account and automate AMM operational jobs like managing liquidity.
324
-
325
-
### Deploying Defender Actions
326
-
327
-
Defender Actions are used to run operational jobs are specific times or intervals.
328
-
329
-
[rollup](https://rollupjs.org/) is used to bundle the Actions source code in [/src/js/actions](./src/js/actions) into a single file that can be uploaded to Defender. The implementation was based off [Defender Action example using Rollup](https://github.com/OpenZeppelin/defender-autotask-examples/tree/master/rollup). The rollup config is in [/src/js/actions/rollup.config.cjs](./src/js/actions/rollup.config.cjs). The outputs are written to task-specific folders under [/src/js/actions/dist](./src/js/actions/dist/).
330
-
331
-
The [defender-autotask CLI](https://www.npmjs.com/package/@openzeppelin/defender-autotask-client) is used to upload the Action code to Defender.
332
-
For this to work, a Defender Team API key with `Manage Actions` capabilities is needed. This can be generated by a Defender team admin under the `Manage` tab on the top right of the UI and then `API Keys` on the left menu.
333
-
334
-
The following will set the Defender Team API key and bundle the Actions code ready for upload.
335
-
336
-
```bash
337
-
# Set the DEFENDER_TEAM_KEY and DEFENDER_TEAM_SECRET env vars in the .env file
338
-
339
-
yarn rollup -c src/js/actions/rollup.config.cjs
340
-
```
341
-
342
-
The following will upload the different Action bundles to Defender.
343
-
344
-
```bash
345
-
346
-
# Set the DEBUG environment variable to oeth* for the Defender Action
`rollup` can be installed globally to avoid the `yarn` prefix.
398
-
399
-
The Defender Actions need to be under 5MB in size. The [rollup-plugin-visualizer](https://www.npmjs.com/package/rollup-plugin-visualizer) can be used to visualize the size of an Action's dependencies.
400
-
A `stats.html` file is generated in the`src/js/actions` folder that can be opened in a browser to see the size of the Action's dependencies.
401
-
This will be for the last Action in the rollup config `src/js/actions/rollup.config.cjs`.
335
+
Signer selection (`DEPLOYER_PRIVATE_KEY` → KMS via `KMS_RELAYER_ID` → `IMPERSONATE` → hardhat first signer) lives in `src/js/utils/signers.ts`.
0 commit comments