Install
openclaw skills install morpho-market-creationDeploys Morpho markets backed by API3 oracles.
openclaw skills install morpho-market-creation| Variable | Description |
|---|---|
CHAIN_NAME | Human-readable chain name (e.g. Ethereum) |
CHAIN_ALIAS | Chain alias from the chain list (e.g. ethereum) |
CHAIN_ID | Numeric chain ID (e.g. 1) |
COLLATERAL_TOKEN | Collateral asset symbol (e.g. ETH, USDC) |
LOAN_TOKEN | Loan asset symbol (e.g. DAI, USDT) |
COLLATERAL_PROXY_ADDRESS | Api3ReaderProxyV1 address for the collateral/USD feed — starts with 0x, exactly 42 characters |
LOAN_PROXY_ADDRESS | Api3ReaderProxyV1 address for the loan/USD feed — starts with 0x, exactly 42 characters |
exec tool to run commands. Never use Bash or shell directly.{baseDir} variable and name is given in this file's name field at top. Prefix every command with cd {baseDir} && to ensure it runs from the correct directory.exec command before running it.<CHAIN_ALIAS> and the token symbol (<COLLATERAL_TOKEN> / <LOAN_TOKEN>) when substituting them into market.api3.org URL paths (e.g. https://market.api3.org/ethereum/eth-usd/integrate), even if the confirmed values are stored/displayed with different casing.@api3/dapi-management@morpho-org/blue-sdkdotenvetherspnpm install. Wait for an affirmative response. Once approved, run the command regardless of whether packages may already be installed:exec command="cd {baseDir} && pnpm install"
[ERR_PNPM_IGNORED_BUILDS] Ignored build scripts: unrs-resolver..., this is expected and not a real failure — the ignored build script is not needed for this skill. Treat it as success and continue.get-dapis.ts and get-chains.ts to fetch the list of available feeds and supported chains:exec command="cd {baseDir} && ts-node {baseDir}/scripts/get-dapis.ts"
exec command="cd {baseDir} && ts-node {baseDir}/scripts/get-chains.ts"
Validate CHAIN_ALIAS:
get-chains.ts — first by alias field (case-insensitive), then by name field.CHAIN_ALIAS, CHAIN_NAME, CHAIN_ID and confirm the matched values with the user. If they say no, ask them to re-enter the chain and repeat.Validate feeds:
get-dapis.ts for <COLLATERAL_TOKEN>/USD and <LOAN_TOKEN>/USD (case-insensitive).COLLATERAL_TOKEN and LOAN_TOKEN as bare token symbols only, and show the user the matched feed names (<COLLATERAL_TOKEN>/USD and <LOAN_TOKEN>/USD) for confirmation.<CHAIN_NAME> (<CHAIN_ALIAS>, ID: <CHAIN_ID>)<COLLATERAL_TOKEN><LOAN_TOKEN><COLLATERAL_TOKEN>/USD, <LOAN_TOKEN>/USD0x and be exactly 42 characters. If invalid, tell the user and ask them to re-enter.COLLATERAL_PROXY_ADDRESS to the validated value.read-data-feed.ts to verify the collateral feed is active:exec command="cd {baseDir} && ts-node {baseDir}/scripts/read-data-feed.ts <COLLATERAL_PROXY_ADDRESS> <CHAIN_ALIAS>"
If the script fails, let user know about the problem and ask what to do.
Show the value and timestamp from the output and ask the user if it looks correct. If no, ask them to recheck the URL and re-enter the address, then repeat.
Ask the user to open https://market.api3.org/<CHAIN_ALIAS>/<LOAN_TOKEN>-usd/integrate, copy the Api3ReaderProxyV1 address, and share it here.
0x and be exactly 42 characters. If invalid, tell the user and ask them to re-enter.LOAN_PROXY_ADDRESS to the validated value.Run read-data-feed.ts to verify the loan feed is active:
exec command="cd {baseDir} && ts-node {baseDir}/scripts/read-data-feed.ts <LOAN_PROXY_ADDRESS> <CHAIN_ALIAS>"
<CHAIN_NAME> as the chain. Ask them to select the collateral and loan assets from the dropdowns — they should confirm those contract addresses match the intended assets. Then paste <COLLATERAL_PROXY_ADDRESS> into Base Feed1 and <LOAN_PROXY_ADDRESS> into Quote Feed1. Wait for confirmation before continuing.get-oracle-contract-link.ts to get the correct Etherscan URL:exec command="cd {baseDir} && ts-node {baseDir}/scripts/get-oracle-contract-link.ts <CHAIN_ALIAS>"
createMorphoChainlinkOracleV2 function and fill in the parameters exactly as shown in the Morpho Oracle Tester.{baseDir}/oracle-params.json and fill in the oracle constructor parameters using the values from the Morpho Oracle Tester: set baseFeed1 to <COLLATERAL_PROXY_ADDRESS> and quoteFeed1 to <LOAN_PROXY_ADDRESS>, and fill in the remaining fields (decimals, vaults, salt) to match. Also ask them to set WALLET_MNEMONIC in the .env file. Wait for confirmation.deploy-oracle.ts. Wait for an affirmative response, then run:exec command="cd {baseDir} && ts-node {baseDir}/scripts/deploy-oracle.ts <CHAIN_ALIAS>"
{baseDir}/market-params.json and fill in the market parameters:
loanToken — contract address of the loan token (e.g. can be found at /tokens path of block explorer)collateralToken — contract address of the collateral token (e.g. can be found at /tokens path of block explorer)oracle — the oracle address deployed in Phase 4irm — governance-approved Interest Rate Model address for <CHAIN_NAME> (tell the user to check https://docs.morpho.org/get-started/resources/addresses/#morpho-blue Adaptive Curve IRM model address)lltv — liquidation LTV as a percentage number; suggested to be one of the governance-approved values: 0, 38.5, 62.5, 77, 86, 91.5, 94.5, 96.5, 98WALLET_MNEMONIC is still set in the .env file. Wait for confirmation.create-market.ts. Wait for an affirmative response, then run:exec command="cd {baseDir} && ts-node {baseDir}/scripts/create-market.ts <CHAIN_ALIAS>"