Master backend architectures, REST API design, microservices, and server-side development across multiple languages. Use this as a central index to access specialized sub-skills.
日本語の概要は準備中です。原文の説明を表示しています。
Interactive guide for integrating new DeFi modules or protocols into OneKey. Use when adding new DeFi features like staking protocols, lending markets, or entirely new DeFi modules. Triggers on DeFi, protocol, integration, Earn, Borrow, staking, lending, supply, borrow, withdraw, repay, claim, new module, Pendle, Aave, Compound.
インストールする前に、エージェントに与えられる指示の中身を確認できます。
This skill provides interactive guidance for integrating new DeFi modules or protocols into OneKey.
Before starting, determine your integration scenario:
| Scenario | Description | Guide |
|---|---|---|
| New Protocol in Earn | Adding a staking/yield protocol (e.g., Lido, Rocket Pool) | earn-module-guide.md |
| New Protocol in Borrow | Adding a lending market (e.g., Aave, Compound) | borrow-module-guide.md |
| Entirely New Module | Creating a new DeFi category (e.g., Pendle, GMX) | new-module-guide.md |
Each DeFi module consists of 4 layers. Home and Modal are required; Details and List are optional.
┌─────────────────────────────────────────────────────────────┐
│ Layer 1: HOME PAGE (Required) │
│ - Overview data (total value, APY, health factor) │
│ - Asset cards/tables │
│ - Pending transaction tracking │
├─────────────────────────────────────────────────────────────┤
│ Layer 2: OPERATION MODALS (Required) │
│ - Earn: Stake, Unstake, Claim (2-3 types) │
│ - Borrow: Supply, Withdraw, Borrow, Repay (4 types) │
│ - Amount input, validation, risk warnings │
├─────────────────────────────────────────────────────────────┤
│ Layer 3: DETAILS PAGE (Optional) │
│ - Charts (APY history, interest rate model) │
│ - Detailed protocol information │
│ - Share functionality │
├─────────────────────────────────────────────────────────────┤
│ Layer 4: PROTOCOL LIST (Optional, for multi-token) │
│ - List of available protocols/assets │
│ - Filtering and sorting │
│ - Navigation to details │
└─────────────────────────────────────────────────────────────┘
Ask for clarification when:
Earn Protocol (Staking/Yield):
Borrow Protocol (Lending):
New Module:
Time-Based Protocol (Fixed-rate yield):
| Decision | Options | Default |
|---|---|---|
| Integration type | Earn / Borrow / New Module | Ask user |
| Tab placement | Existing Earn Tab / New Tab | Earn Tab |
| Operation count | 2-3 (Earn) / 4 (Borrow) / Custom | Based on type |
| Risk warnings | Liquidation / Slashing / None | Based on type |
| Token selection | Single / Multiple | Single |
| Charts | APY history / Interest model / None | Based on type |
| Share feature | Yes / No | Yes |
| Multi-token list | Yes / No | Based on token count |
| Time-based features | Maturity date / Conditional ops / None | Based on protocol |
| Multi-variant assets | Group by underlying / Flat list | Based on protocol |
| Operation tabs | Single op / Tab switching (Buy/Sell/Redeem) | Based on protocol |
| Repay with collateral | Wallet balance only / With collateral option | Based on protocol |
| Dual amount input | Single input / Bidirectional sync | Based on operation |
| Slippage settings | Not needed / Auto / Custom | Based on swap involvement |
When integrating a new DeFi module, analyze the state requirements and ask the user:
| State Type | Recommendation | Examples |
|---|---|---|
| Needs Persistence (across page navigation) | Use Jotai atoms | Portfolio data, user preferences, cached investments |
| Page-scoped (no persistence needed) | Use React Context | Current operation state, form data, temporary UI state |
When using this skill, you should:
Example question to ask:
"Does this module's data need to persist when the user navigates away and returns? For example:
- If yes (like portfolio data that should be cached): Use Jotai atoms
- If no (like form state that resets on page exit): Use React Context"
| Module | Path |
|---|---|
| Earn | packages/kit/src/views/Earn/ |
| Borrow | packages/kit/src/views/Borrow/ |
| Staking (shared) | packages/kit/src/views/Staking/ |
| Routes | packages/shared/src/routes/ |
| Modal Router | packages/kit/src/routes/Modal/router.tsx |
| Tab Router | packages/kit/src/routes/Tab/router.ts |
| Component | Location | Usage |
|---|---|---|
StakingAmountInput | Staking/components/ | Amount input with validation |
StakingFormWrapper | Staking/components/ | Form layout wrapper |
EarnText | Staking/components/ProtocolDetails/ | Styled text with color support |
EarnTooltip | Staking/components/ProtocolDetails/ | Info tooltips |
PendingIndicator | Staking/components/StakingActivityIndicator/ | Pending tx indicator |
ManagePositionContent | Staking/pages/ManagePosition/ | Shared manage position UI |
ManagePosition | Borrow/components/ManagePosition/ | Unified Borrow operation component (Supply/Withdraw/Borrow/Repay) |
| Pattern | Use Case | Reference |
|---|---|---|
IAsyncData<T> | Unified async data format | state-management-guide.md |
DataGate | Data orchestration | state-management-guide.md |
PendingBridge | External pending state | state-management-guide.md |
| Tag System | Pending tx identification | state-management-guide.md |
This skill works best when combined with these other OneKey skills:
| Skill | Use For |
|---|---|
1k-i18n | Adding translations, using ETranslations, useIntl() |
1k-coding-patterns | React patterns, error handling, TypeScript best practices |
1k-cross-platform | Platform-specific code, platformEnv checks |
page-and-route | Route configuration, deep links, navigation |
All user-facing strings must use internationalization. See 1k-i18n skill for full details.
Basic Usage:
import { useIntl } from 'react-intl';
import { ETranslations } from '@onekeyhq/shared/src/locale';
function MyComponent() {
const intl = useIntl();
return (
<Text>
{intl.formatMessage({ id: ETranslations.defi_net_worth })}
</Text>
);
}
Common DeFi Translation Keys:
ETranslations.defi_net_worth - "Net Worth"ETranslations.defi_net_apy - "Net APY"ETranslations.defi_health_factor - "Health Factor"ETranslations.defi_platform_bonus - "Platform Bonus"ETranslations.defi_claimable_rewards - "Claimable Rewards"ETranslations.global_history - "History"Adding New Keys:
ETranslations enum in packages/shared/src/locale/enum.ts| Document | Content |
|---|---|
| earn-module-guide.md | Earn module architecture, files, operations |
| borrow-module-guide.md | Borrow module architecture, 4 operations, health factor |
| new-module-guide.md | Creating new modules, Provider design |
| routing-guide.md | Modal routes, Tab routes, navigation utilities, deep links |
| state-management-guide.md | IAsyncData, Pending, Tag system, refresh strategies |
| checklist.md | Integration checklist with required/optional markers |
まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Master backend architectures, REST API design, microservices, and server-side development across multiple languages. Use this as a central index to access specialized sub-skills.
日本語の概要は準備中です。原文の説明を表示しています。
在每次回复中使用固定前缀并列出本次实际参考的指令/文件,便于校验是否遵循上下文与规则。
日本語の概要は準備中です。原文の説明を表示しています。
Automate 21risk tasks via Rube MCP (Composio). Always search tools first for current schemas.
日本語の概要は準備中です。原文の説明を表示しています。
Automate 2chat tasks via Rube MCP (Composio). Always search tools first for current schemas.
日本語の概要は準備中です。原文の説明を表示しています。
Arquitecto de Soluciones Principal y Consultor Tecnológico de Andru.ia. Diagnostica y traza la hoja de ruta óptima para proyectos de IA en español.
日本語の概要は準備中です。原文の説明を表示しています。
[00] META. Orchestrate skills into dynamic chains for complex tasks. Analyzes the task, discovers available skills, builds an optimal chain, explains why each skill is needed, and executes step-by-step with user confirmation. Use for any complex task requiring multiple thinking/research/analysis steps. Triggers on "plan this", "how to approach", "what's the strategy", "build a plan", or any multi-step problem requiring skill orchestration.
日本語の概要は準備中です。原文の説明を表示しています。