
Research
/Security News
10 npm Typosquatted Packages Deploy Multi-Stage Credential Harvester
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.
@metamask-institutional/mmi-defi-adapters
Advanced tools
MMI Defi adapter library
We have created an open source DeFi adapater library. The aim of this library is to provide the tools and scaffolding for a DeFi protocol to build an adapter. This adapter will provide read and write capabilities within the MMI and MetaMask portfolio dashboards. Our goal is to (i) connect users with DeFi protocols (ii) benefit the wider ecosystem (iii) simplify and standardize adapter building.
Create a copy of .env.example as .env.
Run the following command:
npm i
Run the following command for building the app once
npm run build
Run the following command for constantly building the app during development
npm run build:watch
Specific details on what commands are available can be shown running:
npm run adapters-cli
For getting the arguments and options for specific commands:
npm run positions -- --help
It is possible to get results for specific protocols and chains for every command by adding --chain <chainId> and/or --protocol <protocolName>
For example:
npm run positions 0x6b8Be925ED8277fE4D27820aE4677e76Ebf4c255 -- --protocol stargate --chain 1
npm run positions 0x6b8Be925ED8277fE4D27820aE4677e76Ebf4c255
npm run profits 0xB0D502E938ed5f4df2E681fE6E419ff29631d62b
npm run prices
npm run tvl
npm run apr
npm run apy
npm run deposits 0x6b8Be925ED8277fE4D27820aE4677e76Ebf4c255 17719334 17719336
npm run withdrawals 0x6b8Be925ED8277fE4D27820aE4677e76Ebf4c255 17719334 17719336
mmi-defi-adapters/
β
βββ src/
βββ adapters/ # Folder for all the protocol adapters and code
β βββ example-protocol/ # Folder for the new protocol called example-protocol
β β βββ products/ # Folder for the different protocol product
β β β βββ pool/ # Folder for the pool product
β β β β βββ ethereum/ # Folder with protocol specific metadata and code
β β β β βββ optimism/ # Folder with protocol specific metadata and code
β β β β βββ arbitrum/ # Folder with protocol specific metadata and code
β β β β βββ protocolNamePoolAdapter.ts # Implementation of IProtocolAdapter
β β β β
β β β βββ vesting/ # Folder for the staking product
β β β βββ ethereum/ # Folder with protocol specific metadata and code
β β β βββ arbitrum/ # Folder with protocol specific metadata and code
β β β βββ protocolNameVestingAdapter.ts # Implementation of IProtocolAdapter
β β β
β β βββ buildMetadata.ts # Metadata builder script
β β
β βββ index.ts # Exports supportedProtocols object
β βββ metadataBuilders.ts # Exports protocolMetadataBuilders object
β
βββ contracts/
βββ abis/
βββ example-protocol/ # Folder to place all the protocol contract abis
βββ example-lp-factory-contract.json # Abi for the protocol lp-factory contract
βββ example-staking-contract.json # Abi for the protocol staking contract
See CONTRIBUTING.md.
Run the following command to add a new adapter
npm run new-adapter <Example> <example-product> [Chains]
Where:
<Example> is the name of your protocol as you'd like it to appear.<example-product> is the name of the product for the adapter in kebab-case[Chains] is an optional argument with a comma separated list of supported chains (e.g. Ethereum,Arbitrum,Optimism). Default: EthereumTo integrate a new protocol:
src/adapters/index.ts:
Protocol object: key in CamelCase, value in kebab-case (matching folder name).supportedProtocols object.src/adapters, named in kebab-case, e.g., src/${protocolName}/products/${productName}/productAdapter.ts.After adding your protocol:
src/adapters/stargate/products/pool/arbitrum/metadata.json using src/adapters/stargate/buildMetadata.ts.protocolMetadataBuilders object in src/adapters/metadataBuilders.ts and test npm run metadatasrc/${protocolName}/products/${productName}.src/adapters/example/products/example-product/exampleProductAdapter.ts to your product folder.supportedProtocols in src/adapters/index.ts.npm run positions 0x6b8Be925ED8277fE4D27820aE4677e76Ebf4c255.npm run profits 0x6b8Be925ED8277fE4D27820aE4677e76Ebf4c255.npm run prices 0x6b8Be925ED8277fE4D27820aE4677e76Ebf4c255.Add a JSON file with the abi of any new contract to the folder src/contracts/abis/<protocol-name>.
Run the following command to generate factories and abis for those contracts automatically:
npm run build-types
JP | Bernardo | Johann |
FAQs
Defi adapters for MMI Dashboard
We found that @metamask-institutional/mmi-defi-adapters demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.Β It has 6 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authoritiesβ publishing activity, highlighting trends and transparency across the CVE ecosystem.