{"id":50708310,"url":"https://github.com/morpho-org/wdk-protocol-lending-morpho-evm","last_synced_at":"2026-06-09T13:30:35.986Z","repository":{"id":358092766,"uuid":"1223283671","full_name":"morpho-org/wdk-protocol-lending-morpho-evm","owner":"morpho-org","description":"WDK module to interact with Morpho Blue and Morpho Vaults lending protocol on EVM blockchains.","archived":false,"fork":false,"pushed_at":"2026-05-15T16:57:56.000Z","size":330,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-15T19:45:01.017Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/morpho-org.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-28T07:13:59.000Z","updated_at":"2026-05-04T13:32:41.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/morpho-org/wdk-protocol-lending-morpho-evm","commit_stats":null,"previous_names":["morpho-org/wdk-protocol-lending-morpho-evm"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/morpho-org/wdk-protocol-lending-morpho-evm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morpho-org%2Fwdk-protocol-lending-morpho-evm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morpho-org%2Fwdk-protocol-lending-morpho-evm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morpho-org%2Fwdk-protocol-lending-morpho-evm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morpho-org%2Fwdk-protocol-lending-morpho-evm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/morpho-org","download_url":"https://codeload.github.com/morpho-org/wdk-protocol-lending-morpho-evm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morpho-org%2Fwdk-protocol-lending-morpho-evm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34110009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-09T13:30:34.975Z","updated_at":"2026-06-09T13:30:35.978Z","avatar_url":"https://github.com/morpho-org.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @morpho-org/wdk-protocol-lending-morpho-evm\n\nNote: This package is in beta. Please test in a dev setup first.\n\nA WDK lending module for Morpho on EVM chains. It keeps the same package shape as the Aave WDK lending module, but delegates Morpho vault and market transaction construction to `@morpho-org/morpho-sdk`.\n\n## About WDK\n\nThis module follows Wallet Development Kit lending protocol conventions and accepts WDK-compatible EVM wallet accounts.\n\n## Features\n\n- Deposit into Morpho Vault V2 earn targets.\n- Withdraw from Morpho Vaults V2.\n- Supply and withdraw collateral in Morpho Blue market.\n- Borrow and repay from a configured Morpho Blue market.\n- Expose Morpho SDK approval/signature/authorization requirements.\n- Quote costs before sending.\n- Works with standard EVM accounts and ERC-4337 smart accounts.\n\n## Installation\n\nThis package is not published to npm yet. For local development, install dependencies from the repository root with pnpm:\n\n```bash\npnpm install\n```\n\nOnce npm publishing is configured, consumers should install the package with:\n\n```bash\npnpm add @morpho-org/wdk-protocol-lending-morpho-evm\n```\n\nUseful local commands:\n\n```bash\npnpm test\npnpm run build\n```\n\n## Quick Start\n\n```javascript\nimport MorphoProtocolEvm from '@morpho-org/wdk-protocol-lending-morpho-evm'\n\n// Use any WDK-compatible EVM wallet account instance.\nconst morpho = new MorphoProtocolEvm(account, {\n  presets: {\n    earn: 'sky-money-usdt-savings',\n    borrow: 'wsteth'\n  }\n})\n\n// Send approval requirements first when returned by the Morpho SDK.\nconst requirements = await morpho.getSupplyRequirements({\n  token: '0xdAC17F958D2ee523a2206206994597C13D831ec7',\n  amount: 1000000n\n})\n\n// Then send the vault deposit transaction.\nawait morpho.supply({\n  token: '0xdAC17F958D2ee523a2206206994597C13D831ec7',\n  amount: 1000000n\n})\n```\n\n## Configuration\n\n```javascript\nnew MorphoProtocolEvm(account, options)\n```\n\nOptions:\n\n- `chainId` (number | bigint): required when using explicit Morpho targets; guards transaction building against wallet chain switches.\n- `earnVaultAddress` (string): explicit Morpho vault address.\n- `borrowMarketParams` (object): explicit Morpho Blue market params.\n- `borrowMarketId` (string): explicit market id; market params are fetched on-chain.\n- `presets` (object): `{ earn?: string, borrow?: string }`.\n- `slippageTolerance` (bigint): passed through to `@morpho-org/morpho-sdk`.\n- `supportSignature` (boolean): enable SDK permit/permit2 requirements.\n- `supportDeployless` (boolean): enable SDK deployless reads.\n\nBuilt-in presets already carry their expected chain id. If you use `earnVaultAddress`, `borrowMarketParams`, or `borrowMarketId` directly, pass `chainId` so the adapter can fail before building transactions after a browser-wallet chain switch.\n\nFor vault deposits and collateral supply, pass either `amount`, `nativeAmount`, or both. `nativeAmount` follows Morpho SDK semantics and is only valid when the configured vault asset or collateral token is the wrapped native token for the chain.\n\n## Methods\n\n| Method | Description |\n|---|---|\n| `supply(options, config?)` | Deposit assets into the configured vault |\n| `getSupplyRequirements(options)` | Return SDK requirements for vault deposit |\n| `quoteSupply(options, config?)` | Quote vault deposit |\n| `withdraw(options, config?)` | Withdraw assets from the configured vault |\n| `quoteWithdraw(options, config?)` | Quote vault withdrawal |\n| `supplyCollateral(options, config?)` | Supply collateral to the configured market |\n| `getSupplyCollateralRequirements(options)` | Return SDK requirements for collateral supply |\n| `quoteSupplyCollateral(options, config?)` | Quote collateral supply |\n| `borrow(options, config?)` | Borrow from the configured market |\n| `getBorrowRequirements(options)` | Return SDK authorization requirements for borrow |\n| `quoteBorrow(options, config?)` | Quote borrow |\n| `repay(options, config?)` | Repay by assets, or pass `amount: 'max'` to repay current borrow shares |\n| `getRepayRequirements(options)` | Return SDK requirements for repay |\n| `quoteRepay(options, config?)` | Quote repay |\n| `withdrawCollateral(options, config?)` | Withdraw collateral from the configured market |\n| `quoteWithdrawCollateral(options, config?)` | Quote collateral withdrawal |\n| `getVaultPosition(account?)` | Read configured vault position |\n| `getMarketPosition(account?)` | Read configured market position |\n| `getAccountData(account?)` | Read combined configured vault and market position |\n\n## Presets\n\nEarn presets target Ethereum mainnet USDT vaults:\n\n| Preset | Vault |\n|---|---|\n| `sky-money-usdt-savings` | sky.money USDT Savings V2 |\n| `steakhouse-prime-instant` | Steakhouse Prime Instant V2 |\n\nThis module only builds Morpho Vault V2 earn flows. `pnpm run check:vault-v2` verifies that code, docs, and tests do not reintroduce Morpho Vault V1 usage or an earn-flow selector.\n\nBorrow presets target Ethereum mainnet USDT loan markets:\n\n| Preset | Collateral |\n|---|---|\n| `susds` | sUSDS |\n| `wsteth` | wstETH |\n| `wbtc` | WBTC |\n| `xaut` | XAUt |\n\n## Morpho SDK Requirements\n\nMorpho SDK actions can require approvals, permit/permit2 signatures, or Morpho authorization before the final action. This module exposes those requirements through `get*Requirements` methods rather than reimplementing allowance or authorization logic.\n\nFor ERC-4337 accounts you can choose to batch the returned requirement transactions with the final transaction using your account-level flow. For EOA accounts, send requirements before the final operation.\n\nRequirement entries are one of:\n\n- Approval transaction: send the returned transaction before the final action.\n- Morpho authorization transaction: send the returned `setAuthorization` transaction before borrow flows that require GeneralAdapter1 authorization.\n- Signature request: call the returned requirement's `sign(client, userAddress)` method, then pass the resulting `requirementSignature` to `supply`, `repay`, or `supplyCollateral`.\n\nMorpho SDK enforces a builder/executor invariant for bundled actions. For that reason, `onBehalfOf` and vault/collateral withdrawal `to` must equal the connected wallet address in this WDK adapter.\n\n## Fork E2E Test\n\nThe regular test suite is fully mocked. To execute a real vault deposit path on an Anvil mainnet fork:\n\n```bash\nMAINNET_RPC_URL=\"https://eth-mainnet.g.alchemy.com/v2/\u003ckey\u003e\" pnpm run test:fork -- --runInBand\n```\n\nThe fork test impersonates a USDT holder, funds the local test wallet, sends SDK requirements, and executes a Morpho Vault V2 deposit against forked mainnet state.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorpho-org%2Fwdk-protocol-lending-morpho-evm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmorpho-org%2Fwdk-protocol-lending-morpho-evm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorpho-org%2Fwdk-protocol-lending-morpho-evm/lists"}