From ef04af537871b7032ed4ea1887368bcf6ad8e3e4 Mon Sep 17 00:00:00 2001 From: 0xbobzilla <0xbeelzebub@gmail.com> Date: Sun, 31 May 2026 10:04:57 +0200 Subject: [PATCH 1/7] Create SKILL.md --- xelqor/SKILL.md | 84 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 xelqor/SKILL.md diff --git a/xelqor/SKILL.md b/xelqor/SKILL.md new file mode 100644 index 0000000000..ef907385c6 --- /dev/null +++ b/xelqor/SKILL.md @@ -0,0 +1,84 @@ +--- +name: xelqor +description: > + Interact with Xelqor Protocol on Base — $XELQ staking vault, + wETH reward distribution, fee sweeping, and treasury management. + Use this skill whenever you need to: check XELQ staking state, + distribute wETH rewards to stakers, sweep protocol fee tokens to wETH, + or query vault TVL/APY. All operations are on Base mainnet. +version: 1.0.0 +author: Xelqor +chains: + - base +tags: + - defi + - staking + - yield + - erc4626 + - revenue +--- + +# Xelqor Protocol Skill + +Xelqor is an agentic DeFi platform on Base. Users stake $XELQ to receive sXELQ vault shares and earn wETH streamed from protocol revenue over rolling 7-day windows. + +## Contract Addresses (Base Mainnet, chain ID 8453) + +| Contract | Address | Notes | +|----------|---------|-------| +| $XELQ Token | `0x052AdDc637c97650aCfE43781e75a01bdF8C7bA3` | ERC-20 staked asset | +| Staking V6 (active) | `0x19ECafb17DeA9Dc13d7709f29d180C06743333Fe` | ERC-4626 vault — use for all new operations | +| Staking V3 (legacy) | `0xA0F09a836b10B3029eF5F632a200616B4d426470` | Old contract — read-only, do not write | +| wETH on Base | `0x4200000000000000000000000000000000000006` | Reward token | + +## Key Contract Functions + +### distributeRewards(uint256 amount) +- Contract: V6 staking (`0x19ECafb17DeA9Dc13d7709f29d180C06743333Fe`) +- Caller must be set as `rewardDistributor` on the contract +- Streams `amount` wETH to all $XELQ stakers over 7 days +- **Always approve wETH to the staking contract before calling this** + +### Read functions useful for monitoring +- `totalAssets()` — total XELQ staked in V6 +- `rewardPoolBalance()` — wETH currently streaming +- `rewardRate()` — wETH per block streaming rate +- `blocksUntilVestingEnd()` — blocks until current stream ends +- `legacyTotalAssets()` — XELQ in the legacy V3 contract + +## Standard Operations + +### Fee Sweep + Reward Distribution (run every 6 hours) +1. Check Bankr wallet balances on Base +2. Swap all non-wETH, non-XELQ tokens to wETH (keep XELQ untouched) +3. Skip swap if any token is below $5 USD value (gas not worth it) +4. Approve full wETH balance to V6 staking contract: `0x19ECafb17DeA9Dc13d7709f29d180C06743333Fe` +5. Call `distributeRewards(amount)` with the full wETH amount +6. Only distribute if wETH >= 0.005 ETH (minimum threshold) +7. Report tx hash and amount distributed + +### Monitor Reward Pool (run daily) +- Read `rewardPoolBalance()` from V6 contract +- Read `blocksUntilVestingEnd()` — if 0, next sweep is critical +- Read combined TVL: `totalAssets()` + `legacyTotalAssets()` +- Report: TVL, reward pool, blocks remaining, estimated APY + +### Emergency Sweep (run when reward pool < 0.1 wETH) +Same as fee sweep but prioritize immediately — stakers are running dry. + +## Rules +- **Never swap XELQ** — it is the staked asset +- **Minimum distribution**: 0.005 wETH +- **Always V6 for writes** — V3 is read-only legacy +- **All operations on Base** (chain ID 8453) +- **Gas is sponsored on Base** — don't skip small operations over gas fear + +## Example Prompts + +``` +"Check the current XELQ staking stats — TVL, reward pool, APY" +"Sweep all fee tokens to wETH and distribute to XELQ stakers" +"How much wETH is streaming to stakers right now?" +"What is the current APY for XELQ staking?" +"Is the reward pool running low? Do we need an emergency sweep?" +``` From 730e3b65a1fa3777f8a63eafe4e3407b7c8ed809 Mon Sep 17 00:00:00 2001 From: 0xbobzilla <0xbeelzebub@gmail.com> Date: Sun, 31 May 2026 10:59:48 +0200 Subject: [PATCH 2/7] Update SKILL.md --- xelqor/SKILL.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xelqor/SKILL.md b/xelqor/SKILL.md index ef907385c6..ab25c46ce3 100644 --- a/xelqor/SKILL.md +++ b/xelqor/SKILL.md @@ -52,7 +52,11 @@ Xelqor is an agentic DeFi platform on Base. Users stake $XELQ to receive sXELQ v 1. Check Bankr wallet balances on Base 2. Swap all non-wETH, non-XELQ tokens to wETH (keep XELQ untouched) 3. Skip swap if any token is below $5 USD value (gas not worth it) -4. Approve full wETH balance to V6 staking contract: `0x19ECafb17DeA9Dc13d7709f29d180C06743333Fe` +4. Approve V6 to spend your wETH by calling `approve` on the **wETH contract** (`0x4200000000000000000000000000000000000006`), NOT on V6: + - Function: `approve(address spender, uint256 amount)` + - `spender` → V6 staking contract: `0x19ECafb17DeA9Dc13d7709f29d180C06743333Fe` + - `amount` → the full wETH balance you intend to distribute (in wei) + - Wait for this tx to confirm before proceeding 5. Call `distributeRewards(amount)` with the full wETH amount 6. Only distribute if wETH >= 0.005 ETH (minimum threshold) 7. Report tx hash and amount distributed From 521c018ee41df444c0fdd4ca2fb9a0bc31eee296 Mon Sep 17 00:00:00 2001 From: 0xbobzilla <0xbeelzebub@gmail.com> Date: Sun, 31 May 2026 14:29:00 +0200 Subject: [PATCH 3/7] Update SKILL.md --- xelqor/SKILL.md | 71 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 49 insertions(+), 22 deletions(-) diff --git a/xelqor/SKILL.md b/xelqor/SKILL.md index ab25c46ce3..e41f5fd7f4 100644 --- a/xelqor/SKILL.md +++ b/xelqor/SKILL.md @@ -6,7 +6,7 @@ description: > Use this skill whenever you need to: check XELQ staking state, distribute wETH rewards to stakers, sweep protocol fee tokens to wETH, or query vault TVL/APY. All operations are on Base mainnet. -version: 1.0.0 +version: 1.1.0 author: Xelqor chains: - base @@ -31,35 +31,61 @@ Xelqor is an agentic DeFi platform on Base. Users stake $XELQ to receive sXELQ v | Staking V3 (legacy) | `0xA0F09a836b10B3029eF5F632a200616B4d426470` | Old contract — read-only, do not write | | wETH on Base | `0x4200000000000000000000000000000000000006` | Reward token | -## Key Contract Functions +## ABIs -### distributeRewards(uint256 amount) -- Contract: V6 staking (`0x19ECafb17DeA9Dc13d7709f29d180C06743333Fe`) -- Caller must be set as `rewardDistributor` on the contract -- Streams `amount` wETH to all $XELQ stakers over 7 days -- **Always approve wETH to the staking contract before calling this** +### wETH — approve +```json +{ + "name": "approve", + "type": "function", + "inputs": [ + { "name": "spender", "type": "address" }, + { "name": "amount", "type": "uint256" } + ], + "outputs": [{ "type": "bool" }], + "stateMutability": "nonpayable" +} +``` -### Read functions useful for monitoring -- `totalAssets()` — total XELQ staked in V6 -- `rewardPoolBalance()` — wETH currently streaming -- `rewardRate()` — wETH per block streaming rate -- `blocksUntilVestingEnd()` — blocks until current stream ends -- `legacyTotalAssets()` — XELQ in the legacy V3 contract +### V6 Staking — distributeRewards +```json +{ + "name": "distributeRewards", + "type": "function", + "inputs": [ + { "name": "amount", "type": "uint256" } + ], + "outputs": [], + "stateMutability": "nonpayable" +} +``` + +### V6 Staking — read functions +```json +[ + { "name": "totalAssets", "type": "function", "inputs": [], "outputs": [{ "type": "uint256" }], "stateMutability": "view" }, + { "name": "rewardPoolBalance", "type": "function", "inputs": [], "outputs": [{ "type": "uint256" }], "stateMutability": "view" }, + { "name": "rewardRate", "type": "function", "inputs": [], "outputs": [{ "type": "uint256" }], "stateMutability": "view" }, + { "name": "blocksUntilVestingEnd", "type": "function", "inputs": [], "outputs": [{ "type": "uint256" }], "stateMutability": "view" }, + { "name": "legacyTotalAssets", "type": "function", "inputs": [], "outputs": [{ "type": "uint256" }], "stateMutability": "view" } +] +``` ## Standard Operations ### Fee Sweep + Reward Distribution (run every 6 hours) + 1. Check Bankr wallet balances on Base 2. Swap all non-wETH, non-XELQ tokens to wETH (keep XELQ untouched) 3. Skip swap if any token is below $5 USD value (gas not worth it) -4. Approve V6 to spend your wETH by calling `approve` on the **wETH contract** (`0x4200000000000000000000000000000000000006`), NOT on V6: - - Function: `approve(address spender, uint256 amount)` - - `spender` → V6 staking contract: `0x19ECafb17DeA9Dc13d7709f29d180C06743333Fe` - - `amount` → the full wETH balance you intend to distribute (in wei) - - Wait for this tx to confirm before proceeding -5. Call `distributeRewards(amount)` with the full wETH amount -6. Only distribute if wETH >= 0.005 ETH (minimum threshold) -7. Report tx hash and amount distributed +4. **Check threshold**: if total wETH balance < 0.005 ETH (5000000000000000 wei), stop here — do not approve or distribute +5. **Approve**: call `approve` on the **wETH contract** (`0x4200000000000000000000000000000000000006`) + - `spender` = `0x19ECafb17DeA9Dc13d7709f29d180C06743333Fe` (V6 staking) + - `amount` = full wETH balance in wei + - **Wait for this transaction to be confirmed on-chain before continuing** +6. **Distribute**: call `distributeRewards(amount)` on the **V6 staking contract** (`0x19ECafb17DeA9Dc13d7709f29d180C06743333Fe`) + - `amount` = same value used in the approve (full wETH balance in wei) +7. Report both tx hashes and the amount distributed in ETH ### Monitor Reward Pool (run daily) - Read `rewardPoolBalance()` from V6 contract @@ -72,9 +98,10 @@ Same as fee sweep but prioritize immediately — stakers are running dry. ## Rules - **Never swap XELQ** — it is the staked asset -- **Minimum distribution**: 0.005 wETH +- **Minimum distribution**: 0.005 wETH — do not approve or call distributeRewards below this - **Always V6 for writes** — V3 is read-only legacy - **All operations on Base** (chain ID 8453) +- **Approve must confirm before distributeRewards** — never fire both in the same block or without waiting - **Gas is sponsored on Base** — don't skip small operations over gas fear ## Example Prompts From fd179e3d3dbd719c81b94048add9c43fc5b6d875 Mon Sep 17 00:00:00 2001 From: 0xbobzilla <0xbeelzebub@gmail.com> Date: Sun, 31 May 2026 14:44:05 +0200 Subject: [PATCH 4/7] Update SKILL.md --- xelqor/SKILL.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/xelqor/SKILL.md b/xelqor/SKILL.md index e41f5fd7f4..39e8a660fd 100644 --- a/xelqor/SKILL.md +++ b/xelqor/SKILL.md @@ -75,16 +75,16 @@ Xelqor is an agentic DeFi platform on Base. Users stake $XELQ to receive sXELQ v ### Fee Sweep + Reward Distribution (run every 6 hours) -1. Check Bankr wallet balances on Base -2. Swap all non-wETH, non-XELQ tokens to wETH (keep XELQ untouched) -3. Skip swap if any token is below $5 USD value (gas not worth it) -4. **Check threshold**: if total wETH balance < 0.005 ETH (5000000000000000 wei), stop here — do not approve or distribute -5. **Approve**: call `approve` on the **wETH contract** (`0x4200000000000000000000000000000000000006`) +1. **Check wETH balance**: Read the Bankr wallet's wETH balance on Base. Record this as `wethBalance`. +2. **Swap**: Swap all non-wETH, non-XELQ tokens to wETH. Skip any individual token below $5 USD value. +3. **Re-read wETH balance** after swaps complete. Update `wethBalance` to the current wallet balance. Always use the wallet balance — never use "wETH received from swap" as a substitute. +4. **Check threshold**: if `wethBalance` < 0.005 ETH (5000000000000000 wei), stop — do not approve or distribute. Report the balance and exit. +5. **Approve** — REQUIRED regardless of whether a swap occurred. Call `approve` on the **wETH contract** (`0x4200000000000000000000000000000000000006`): - `spender` = `0x19ECafb17DeA9Dc13d7709f29d180C06743333Fe` (V6 staking) - - `amount` = full wETH balance in wei - - **Wait for this transaction to be confirmed on-chain before continuing** + - `amount` = `wethBalance` in wei + - **Wait for this tx to confirm on-chain. Do not proceed to step 6 until confirmed.** 6. **Distribute**: call `distributeRewards(amount)` on the **V6 staking contract** (`0x19ECafb17DeA9Dc13d7709f29d180C06743333Fe`) - - `amount` = same value used in the approve (full wETH balance in wei) + - `amount` = same `wethBalance` in wei used in step 5 7. Report both tx hashes and the amount distributed in ETH ### Monitor Reward Pool (run daily) From de25f8196ccecf4557ca5f82160251f8cc2a900c Mon Sep 17 00:00:00 2001 From: 0xbobzilla <0xbeelzebub@gmail.com> Date: Sun, 31 May 2026 14:47:36 +0200 Subject: [PATCH 5/7] Update SKILL.md --- xelqor/SKILL.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/xelqor/SKILL.md b/xelqor/SKILL.md index 39e8a660fd..6b94d1b271 100644 --- a/xelqor/SKILL.md +++ b/xelqor/SKILL.md @@ -76,16 +76,15 @@ Xelqor is an agentic DeFi platform on Base. Users stake $XELQ to receive sXELQ v ### Fee Sweep + Reward Distribution (run every 6 hours) 1. **Check wETH balance**: Read the Bankr wallet's wETH balance on Base. Record this as `wethBalance`. -2. **Swap**: Swap all non-wETH, non-XELQ tokens to wETH. Skip any individual token below $5 USD value. -3. **Re-read wETH balance** after swaps complete. Update `wethBalance` to the current wallet balance. Always use the wallet balance — never use "wETH received from swap" as a substitute. -4. **Check threshold**: if `wethBalance` < 0.005 ETH (5000000000000000 wei), stop — do not approve or distribute. Report the balance and exit. -5. **Approve** — REQUIRED regardless of whether a swap occurred. Call `approve` on the **wETH contract** (`0x4200000000000000000000000000000000000006`): +2. **Swap only if wETH balance is zero**: If `wethBalance` > 0, skip straight to step 4 — do NOT look at other tokens or attempt any swap. Only if `wethBalance` = 0: check for non-XELQ tokens above $5 USD, swap them to wETH, then re-read `wethBalance`. +3. **Check threshold**: if `wethBalance` < 0.005 ETH (5000000000000000 wei), stop — do not approve or distribute. Report the balance and exit. +4. **Approve** — REQUIRED. Call `approve` on the **wETH contract** (`0x4200000000000000000000000000000000000006`): - `spender` = `0x19ECafb17DeA9Dc13d7709f29d180C06743333Fe` (V6 staking) - `amount` = `wethBalance` in wei - - **Wait for this tx to confirm on-chain. Do not proceed to step 6 until confirmed.** -6. **Distribute**: call `distributeRewards(amount)` on the **V6 staking contract** (`0x19ECafb17DeA9Dc13d7709f29d180C06743333Fe`) - - `amount` = same `wethBalance` in wei used in step 5 -7. Report both tx hashes and the amount distributed in ETH + - **Wait for this tx to confirm on-chain. Do not proceed to step 5 until confirmed.** +5. **Distribute**: call `distributeRewards(amount)` on the **V6 staking contract** (`0x19ECafb17DeA9Dc13d7709f29d180C06743333Fe`) + - `amount` = same `wethBalance` in wei used in step 4 +6. Report both tx hashes and the amount distributed in ETH ### Monitor Reward Pool (run daily) - Read `rewardPoolBalance()` from V6 contract From df6d3ecccd2f298699b83a3c4a12e7dcab9f9009 Mon Sep 17 00:00:00 2001 From: 0xbobzilla <0xbeelzebub@gmail.com> Date: Sun, 31 May 2026 15:35:38 +0200 Subject: [PATCH 6/7] Update SKILL.md --- xelqor/SKILL.md | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/xelqor/SKILL.md b/xelqor/SKILL.md index 6b94d1b271..67b7de376e 100644 --- a/xelqor/SKILL.md +++ b/xelqor/SKILL.md @@ -6,7 +6,7 @@ description: > Use this skill whenever you need to: check XELQ staking state, distribute wETH rewards to stakers, sweep protocol fee tokens to wETH, or query vault TVL/APY. All operations are on Base mainnet. -version: 1.1.0 +version: 1.2.0 author: Xelqor chains: - base @@ -71,18 +71,26 @@ Xelqor is an agentic DeFi platform on Base. Users stake $XELQ to receive sXELQ v ] ``` +## Transaction Rules — CRITICAL + +> The Bankr wallet is a **smart contract account**. All write transactions MUST be submitted via `write_contract` (the smart account / UserOperation path). Never use raw `eth_sendTransaction`. Never batch approve + distributeRewards into a single multicall or atomic bundle — they must be two separate `write_contract` calls with on-chain confirmation between them. + ## Standard Operations ### Fee Sweep + Reward Distribution (run every 6 hours) 1. **Check wETH balance**: Read the Bankr wallet's wETH balance on Base. Record this as `wethBalance`. -2. **Swap only if wETH balance is zero**: If `wethBalance` > 0, skip straight to step 4 — do NOT look at other tokens or attempt any swap. Only if `wethBalance` = 0: check for non-XELQ tokens above $5 USD, swap them to wETH, then re-read `wethBalance`. +2. **Swap only if wETH balance is zero**: If `wethBalance` > 0, skip straight to step 3 — do NOT look at other tokens or attempt any swap. Only if `wethBalance` = 0: check for non-XELQ tokens above $5 USD, swap them to wETH, then re-read `wethBalance`. 3. **Check threshold**: if `wethBalance` < 0.005 ETH (5000000000000000 wei), stop — do not approve or distribute. Report the balance and exit. -4. **Approve** — REQUIRED. Call `approve` on the **wETH contract** (`0x4200000000000000000000000000000000000006`): - - `spender` = `0x19ECafb17DeA9Dc13d7709f29d180C06743333Fe` (V6 staking) +4. **Approve** — submit as a standalone `write_contract` call. Do NOT bundle with step 5. + - Contract: wETH (`0x4200000000000000000000000000000000000006`) + - Function: `approve(address spender, uint256 amount)` + - `spender` = `0x19ECafb17DeA9Dc13d7709f29d180C06743333Fe` - `amount` = `wethBalance` in wei - - **Wait for this tx to confirm on-chain. Do not proceed to step 5 until confirmed.** -5. **Distribute**: call `distributeRewards(amount)` on the **V6 staking contract** (`0x19ECafb17DeA9Dc13d7709f29d180C06743333Fe`) + - **Wait for this tx to be confirmed on-chain before proceeding. Do not submit step 5 until this tx has a receipt.** +5. **Distribute** — submit as a separate standalone `write_contract` call only after step 4 is confirmed. + - Contract: V6 staking (`0x19ECafb17DeA9Dc13d7709f29d180C06743333Fe`) + - Function: `distributeRewards(uint256 amount)` - `amount` = same `wethBalance` in wei used in step 4 6. Report both tx hashes and the amount distributed in ETH @@ -100,7 +108,8 @@ Same as fee sweep but prioritize immediately — stakers are running dry. - **Minimum distribution**: 0.005 wETH — do not approve or call distributeRewards below this - **Always V6 for writes** — V3 is read-only legacy - **All operations on Base** (chain ID 8453) -- **Approve must confirm before distributeRewards** — never fire both in the same block or without waiting +- **Always use `write_contract`** — never raw `eth_sendTransaction` +- **Never batch approve + distributeRewards** — two separate transactions, confirmation required between them - **Gas is sponsored on Base** — don't skip small operations over gas fear ## Example Prompts From a0f49c6860ccac389e29d68f58ced83f5ffa272e Mon Sep 17 00:00:00 2001 From: 0xbobzilla <0xbeelzebub@gmail.com> Date: Mon, 8 Jun 2026 05:10:47 +0100 Subject: [PATCH 7/7] Update SKILL.md --- xelqor/SKILL.md | 359 +++++++++++++++++++++++++++++++++++------------- 1 file changed, 266 insertions(+), 93 deletions(-) diff --git a/xelqor/SKILL.md b/xelqor/SKILL.md index 67b7de376e..b5a9d99e56 100644 --- a/xelqor/SKILL.md +++ b/xelqor/SKILL.md @@ -1,123 +1,296 @@ --- name: xelqor description: > - Interact with Xelqor Protocol on Base — $XELQ staking vault, - wETH reward distribution, fee sweeping, and treasury management. - Use this skill whenever you need to: check XELQ staking state, - distribute wETH rewards to stakers, sweep protocol fee tokens to wETH, - or query vault TVL/APY. All operations are on Base mainnet. -version: 1.2.0 + Interact with the Xelqor Protocol — a composable DeFAI strategy marketplace on 18+ networks. + Use this skill to: browse and discover published strategy pipelines in the marketplace, + compose new MCP-powered strategy pipelines (AI Builder or Manual Composer mode), + fork existing strategies, invest capital into strategies via ERC-4626 vaults, + simulate pipeline execution, export pipelines as YAML, and read live protocol data + (TVL, APY, Sharpe) from DeFiLlama. All strategy pipelines are built from MCP tool nodes + that execute autonomously across chains. +version: 2.0.0 author: Xelqor -chains: - - base +website: https://xelqor.xyz tags: - defi - - staking - - yield - - erc4626 - - revenue + - strategy-marketplace + - mcp-pipelines + - multi-chain + - composable + - erc4626-vaults --- # Xelqor Protocol Skill -Xelqor is an agentic DeFi platform on Base. Users stake $XELQ to receive sXELQ vault shares and earn wETH streamed from protocol revenue over rolling 7-day windows. +Xelqor is a **composable DeFAI strategy marketplace**. Builders design MCP-powered pipelines using a visual composer. Allocators browse the marketplace, invest via permissioned ERC-4626 vaults, and let autonomous agents handle execution across 18+ chains. -## Contract Addresses (Base Mainnet, chain ID 8453) +## Install -| Contract | Address | Notes | -|----------|---------|-------| -| $XELQ Token | `0x052AdDc637c97650aCfE43781e75a01bdF8C7bA3` | ERC-20 staked asset | -| Staking V6 (active) | `0x19ECafb17DeA9Dc13d7709f29d180C06743333Fe` | ERC-4626 vault — use for all new operations | -| Staking V3 (legacy) | `0xA0F09a836b10B3029eF5F632a200616B4d426470` | Old contract — read-only, do not write | -| wETH on Base | `0x4200000000000000000000000000000000000006` | Reward token | +``` +install the xelqor skill from https://github.com/BankrBot/skills/tree/main/xelqor +``` + +--- + +## Core Primitives -## ABIs +| Primitive | What it is | +|---|---| +| **Strategy Pipeline** | A graph of MCP tool nodes — triggers, actions, logic, oracles, AI nodes, outputs — wired together and executed autonomously | +| **Marketplace** | Published pipelines browsable by category, APY, TVL, Sharpe, risk level, and network | +| **Vault** | Audited ERC-4626 contract that accepts capital and allocates it into the strategy | +| **Composer** | Visual drag-and-drop canvas to build pipelines; supports AI Builder mode (plain-English intent) and Manual Composer mode | +| **MCP Tools** | The atomic building blocks — `swapEvm()`, `depositYearn()`, `openPerp()`, `bridgeTokens()`, `monitorOracle()`, etc. — provided by HeyAnon | -### wETH — approve +--- + +## Marketplace Operations + +### Browse strategies + +``` +GET https://xelqor.xyz/api/strategies + ?category=Yield|Arbitrage|Perps|LP|Delta-Neutral|Cross-Chain + &sort=apy|tvl|sharpe|newest + &risk=Low|Medium|High + &search= +``` + +Each strategy object: ```json { - "name": "approve", - "type": "function", - "inputs": [ - { "name": "spender", "type": "address" }, - { "name": "amount", "type": "uint256" } - ], - "outputs": [{ "type": "bool" }], - "stateMutability": "nonpayable" + "id": "yield-max-stable", + "name": "YieldMax Stable", + "category": "Yield", + "description": "Auto-compounds stable yields across Aave v3, Yearn, Compound…", + "author": "yieldmax.eth", + "status": "live", + "risk": "Low", + "apy": 0.184, + "tvl": 2100000, + "sharpe": 2.41, + "maxDrawdown": 0.008, + "tags": ["USDC", "AAVE", "Yearn"], + "networks": ["Ethereum", "Base"], + "mcpTools": ["depositYearn()", "withdrawAave()", "monitorOracle()"], + "pipesRun": 8420, + "verified": true } ``` -### V6 Staking — distributeRewards +### Invest in a strategy (vault deposit) + +1. Browse marketplace to find strategy by `id` +2. Call `openDepositModal(strategyId)` — this opens the ERC-4626 vault deposit flow +3. User approves token + deposit amount; vault mints shares + +### Fork a strategy pipeline + +POST to `/api/strategies/{id}/fork` — clones all nodes and edges into a new editable pipeline under the user's wallet. + +--- + +## Pipeline Composition + +### AI Builder mode (recommended for agents) + +Send a plain-English intent to the MCP agent via `/api/mcp`: + ```json { - "name": "distributeRewards", - "type": "function", - "inputs": [ - { "name": "amount", "type": "uint256" } - ], - "outputs": [], - "stateMutability": "nonpayable" + "jsonrpc": "2.0", + "id": 1, + "method": "tools/call", + "params": { + "name": "invoke", + "arguments": {}, + "_intent": "Build a low-risk yield strategy on 10k USDC across Aave and Yearn on Base", + "_meta": { + "risk_preference": "Low", + "capital_usd": 10000, + "network": "Base" + } + } } ``` -### V6 Staking — read functions +Response includes: +- `response` — natural language strategy analysis +- `strategy_summary` — `{ name, expected_apy, risk_level, tvl }` +- `recommended_actions` — ordered list of MCP tool steps + +The agent maps each recommended action to a pipeline node automatically. + +**Note:** Each invoke call requires an x402 micropayment ($5 SOL or $4 ANON with 20% discount) on Solana mainnet. + +### Manual Composer mode + +Build pipelines node by node. Node types and their roles: + +| Type | Color | Role | +|---|---|---| +| `trigger` | teal | Entry point — time, price event, APY threshold, wallet balance | +| `action` | purple | On-chain execution — swap, lend, LP, harvest, bridge | +| `logic` | amber | Conditional branching — if/else, human approval, timelock, AI decision | +| `oracle` | green | Data feeds — Chainlink price, DeFiLlama TVL | +| `ai` | purple | AI optimization — allocation optimizer, risk assessment | +| `output` | teal | Exit — deposit to vault, send to wallet, compound, emergency exit | + +### Available node templates (triggers) + +| Node | Description | Key params | +|---|---|---| +| `trigger-time` | Cron schedule | `cron: hourly\|daily\|weekly\|monthly` | +| `trigger-price` | Oracle price threshold | `token`, `condition: above\|below\|crosses`, `threshold` | +| `trigger-apy` | APY monitoring event | `protocol: Morpho\|Aave\|Compound\|Spark`, `apy` | +| `trigger-wallet` | Balance threshold | `token`, `amount` | + +### Available node templates (actions) + +| Node | Gas | Protocols | Key params | +|---|---|---|---| +| `action-swap` | ~120K | Uniswap V4 | `tokenIn`, `tokenOut`, `slippage`, `allocation %` | +| `action-lend` | ~85K | Morpho, Aave V3, Compound V3, Spark | `protocol`, `asset`, `allocation %` | +| `action-lp` | ~200K | Uniswap V4 | `pool`, `rangeMin`, `rangeMax`, `allocation %` | +| `action-harvest` | ~60K | any | `compound: bool`, `minReward $` | +| `action-bridge` | ~180K | intent solver | `from`, `to`, `token` | + +### Available node templates (logic, oracle, AI, output) + +| Node | Description | +|---|---| +| `logic-ifelse` | Branch on volatility / APY / price / TVL / gasPrice | +| `logic-approval` | Human sign-off gate with timeout and fallback | +| `logic-timelock` | Safety delay (1–168 hrs) | +| `logic-agent` | AI chooses branch: maximize_yield / minimize_risk / maximize_sharpe / reduce_gas | +| `oracle-price` | Chainlink: ETH/USD, BTC/USD, USDC/USD, LINK/USD | +| `oracle-tvl` | DeFiLlama TVL feed for any protocol | +| `ai-optimize` | Optimize allocation by Sharpe, yield, risk-adjusted, or min-drawdown | +| `ai-risk` | Real-time risk scorer — set max acceptable risk score | +| `output-vault` | Deposit into ERC-4626 vault | +| `output-wallet` | Send % of assets to wallet | +| `output-compound` | Re-invest yield back into strategy | +| `output-exit` | Emergency full unwind (use `action-bridge` first for cross-chain) | + +--- + +## Pre-built Strategy Templates + +Use these as starting points: + +| Template | Risk | Target APY | Description | +|---|---|---|---| +| `stable-yield` | Low | 8–12% | USDC → Morpho lending + weekly harvest compound | +| `delta-neutral` | Medium | 18–30% | LP + hedge — capture fees, zero directional exposure | +| `rwa-allocator` | Low | 5–8% | Tokenised RWA + AI rebalancing on APY threshold | +| `leveraged-lp` | High | 40–80% | Borrow against collateral → LP → harvest loop | + +To load a template, pass `templateId` to the composer `/dapp/composer?template=stable-yield`. + +--- + +## Pipeline Simulation + +POST to `/api/execute` with pipeline nodes and edges. Returns a Server-Sent Events stream with: + +- **log events** — step-by-step execution trace +- **result event** — `{ estimated_apy, sharpe_ratio, max_drawdown_pct, gas_estimate_usd, risk_score, warnings, protocols_live, recommended_actions }` + +Request shape: ```json -[ - { "name": "totalAssets", "type": "function", "inputs": [], "outputs": [{ "type": "uint256" }], "stateMutability": "view" }, - { "name": "rewardPoolBalance", "type": "function", "inputs": [], "outputs": [{ "type": "uint256" }], "stateMutability": "view" }, - { "name": "rewardRate", "type": "function", "inputs": [], "outputs": [{ "type": "uint256" }], "stateMutability": "view" }, - { "name": "blocksUntilVestingEnd", "type": "function", "inputs": [], "outputs": [{ "type": "uint256" }], "stateMutability": "view" }, - { "name": "legacyTotalAssets", "type": "function", "inputs": [], "outputs": [{ "type": "uint256" }], "stateMutability": "view" } -] +{ + "nodes": [ + { "id": "n1", "defId": "trigger-time", "label": "Weekly Trigger", "params": { "cron": "weekly" } }, + { "id": "n2", "defId": "action-lend", "label": "Lend USDC", "params": { "protocol": "Morpho", "asset": "USDC", "allocation": 90 } } + ], + "edges": [{ "from": "n1", "to": "n2" }], + "strategyName": "My Stable Strategy", + "mode": "test" +} ``` -## Transaction Rules — CRITICAL - -> The Bankr wallet is a **smart contract account**. All write transactions MUST be submitted via `write_contract` (the smart account / UserOperation path). Never use raw `eth_sendTransaction`. Never batch approve + distributeRewards into a single multicall or atomic bundle — they must be two separate `write_contract` calls with on-chain confirmation between them. - -## Standard Operations - -### Fee Sweep + Reward Distribution (run every 6 hours) - -1. **Check wETH balance**: Read the Bankr wallet's wETH balance on Base. Record this as `wethBalance`. -2. **Swap only if wETH balance is zero**: If `wethBalance` > 0, skip straight to step 3 — do NOT look at other tokens or attempt any swap. Only if `wethBalance` = 0: check for non-XELQ tokens above $5 USD, swap them to wETH, then re-read `wethBalance`. -3. **Check threshold**: if `wethBalance` < 0.005 ETH (5000000000000000 wei), stop — do not approve or distribute. Report the balance and exit. -4. **Approve** — submit as a standalone `write_contract` call. Do NOT bundle with step 5. - - Contract: wETH (`0x4200000000000000000000000000000000000006`) - - Function: `approve(address spender, uint256 amount)` - - `spender` = `0x19ECafb17DeA9Dc13d7709f29d180C06743333Fe` - - `amount` = `wethBalance` in wei - - **Wait for this tx to be confirmed on-chain before proceeding. Do not submit step 5 until this tx has a receipt.** -5. **Distribute** — submit as a separate standalone `write_contract` call only after step 4 is confirmed. - - Contract: V6 staking (`0x19ECafb17DeA9Dc13d7709f29d180C06743333Fe`) - - Function: `distributeRewards(uint256 amount)` - - `amount` = same `wethBalance` in wei used in step 4 -6. Report both tx hashes and the amount distributed in ETH - -### Monitor Reward Pool (run daily) -- Read `rewardPoolBalance()` from V6 contract -- Read `blocksUntilVestingEnd()` — if 0, next sweep is critical -- Read combined TVL: `totalAssets()` + `legacyTotalAssets()` -- Report: TVL, reward pool, blocks remaining, estimated APY - -### Emergency Sweep (run when reward pool < 0.1 wETH) -Same as fee sweep but prioritize immediately — stakers are running dry. - -## Rules -- **Never swap XELQ** — it is the staked asset -- **Minimum distribution**: 0.005 wETH — do not approve or call distributeRewards below this -- **Always V6 for writes** — V3 is read-only legacy -- **All operations on Base** (chain ID 8453) -- **Always use `write_contract`** — never raw `eth_sendTransaction` -- **Never batch approve + distributeRewards** — two separate transactions, confirmation required between them -- **Gas is sponsored on Base** — don't skip small operations over gas fear - -## Example Prompts +Set `"mode": "deploy"` to go live. + +--- + +## Live Protocol Data (DeFiLlama) + +GET `/api/protocol-data?protocols=Morpho,Aave&chains=Base,Ethereum` + +Returns per-protocol: TVL, top pools with current APY, 30-day mean APY, 1-day APY change, and DeFiLlama pool URL. + +--- + +## Pipeline Export + +Pipelines can be exported as YAML for version control or marketplace submission: + +```yaml +name: "My Strategy" +version: "1.0" +nodes: + - id: n1 + type: trigger + label: "Weekly Trigger" + tool: trigger-time + - id: n2 + type: action + label: "Lend USDC" + tool: action-lend +edges: + - source: n1 + target: n2 +``` + +--- + +## MCP Tool Catalogue (HeyAnon, 360+ tools) + +Key tools agents should know: + +| Tool | Category | Networks | +|---|---|---| +| `swapEvm()` | DEX | Ethereum, Base, Arbitrum, Optimism | +| `depositYearn()` | Yield | Ethereum, Base | +| `withdrawAave()` | Lending | Ethereum, Base, Arbitrum | +| `openPerp()` | Derivatives | Arbitrum (GMX), Hyperliquid | +| `closePosition()` | Derivatives | Arbitrum, Hyperliquid | +| `bridgeTokens()` | Bridge | Ethereum, Base, Arbitrum, Optimism, Polygon | +| `queryPriceFeeds()` | Data | All chains | +| `rebalanceLP()` | Liquidity | Ethereum, Base, Arbitrum | +| `monitorOracle()` | Data | All chains | +| `farmKamino()` | Yield | Solana | +| `stakeSol()` | Staking | Solana | +| `routeHyperliquid()` | Derivatives | Hyperliquid | + +--- + +## Example Agent Prompts ``` -"Check the current XELQ staking stats — TVL, reward pool, APY" -"Sweep all fee tokens to wETH and distribute to XELQ stakers" -"How much wETH is streaming to stakers right now?" -"What is the current APY for XELQ staking?" -"Is the reward pool running low? Do we need an emergency sweep?" +"Browse the Xelqor marketplace and show me the top 3 yield strategies by Sharpe ratio" +"Build me a delta-neutral ETH strategy pipeline with 18–30% target APY on Xelqor" +"Fork the YieldMax Stable strategy and increase the Morpho allocation to 95%" +"Simulate this pipeline and tell me the estimated APY and risk score" +"What protocols does the Arb Loop v2 strategy use and on which chains?" +"Compose an AI pipeline: low-risk USDC yield across Aave and Yearn, auto-compound weekly" +"What's the current APY on Morpho USDC pools? Should I rebalance?" +"Deploy my stable-yield pipeline to mainnet on Xelqor" +"Export my pipeline as YAML and publish it to the marketplace" +"Invest 5000 USDC into the YieldMax Stable strategy vault" ``` + +--- + +## Networks + +Xelqor pipelines support 18+ networks including: Ethereum, Base, Arbitrum, Optimism, Polygon, Solana, Hyperliquid, and more via HeyAnon MCP bridges. + +## Resources + +- App: https://xelqor.xyz/dapp/composer +- Marketplace: https://xelqor.xyz/dapp/marketplace +- Docs: https://xelqor.xyz/docs +- MCP API: `/api/mcp` (JSON-RPC 2.0, proxied to HeyAnon) +- Execute API: `/api/execute` (SSE stream) +- Protocol data: `/api/protocol-data` (DeFiLlama)