Skip to content

QuenumGerald/yieldcore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YieldCore

Self-funding DeFi intelligence agent powered by Bankr

YieldCore launches a token on Base, earns trading fees, and uses those fees to pay for its own LLM inference through the Bankr LLM Gateway — creating a self-sustaining economic loop. All inference goes through llm.bankr.bot with access to 15+ models (Claude, Gemini, GPT, Kimi, Qwen).

The Economic Loop

┌──────────────────────────────────────────────────────────┐
│                YieldCore's Economic Loop                  │
│                                                          │
│  1. Launch $YCORE token on Base (Bankr Agent API)        │
│         ↓                                                │
│  2. Generate DeFi alpha via Bankr LLM Gateway            │
│         ↓                                                │
│  3. Content attracts holders → trading volume            │
│         ↓                                                │
│  4. 1.2% trading fee → agent's wallet (Uniswap V4)      │
│         ↓                                                │
│  5. Fees top up LLM Gateway credits                      │
│         ↓                                                │
│  6. Better intelligence → better content → more holders  │
│         └──────────── REPEAT ──────────────┘             │
└──────────────────────────────────────────────────────────┘

Quick Start

Prerequisites

# Get a Bankr API key at https://bankr.bot/api
# Enable both "LLM Gateway" and "Agent API" on the key
# Top up LLM credits at https://bankr.bot/llm?tab=credits

Install & Run

cd yieldcore
npm install

cp .env.example .env
# Edit .env — set BANKR_API_KEY=bk_...

npm run dev

Environment Variables

Variable Required Description
BANKR_API_KEY Yes Bankr API key (bk_...) with LLM Gateway + Agent API enabled
BANKR_MODEL No LLM model (default: gemini-2.5-flash). Options: claude-sonnet-4.5, gemini-2.5-pro, gpt-5-mini, kimi-k2.5, qwen3-coder
WALLET_ADDRESS No Optional Base wallet (Bankr manages custodial wallet)
LOOP_ITERATIONS No Number of economic loop cycles (default: 5)

Architecture

┌──────────────────────────────────────────────────────┐
│              YieldCore Agent (agent.ts)               │
│   Economic loop: launch → generate → earn → repeat   │
└──────────┬───────────────────┬───────────────────────┘
           │                   │
    ┌──────▼──────┐     ┌──────▼──────────────────────┐
    │ Bankr LLM   │     │  Economic Loop Manager      │
    │  Gateway    │     │  (balance check, fee claim,  │
    │ llm.bankr   │     │   viability decision)        │
    │   .bot      │     └────────────┬────────────────┘
    │             │                  │
    │ Claude      │     ┌────────────▼────────────────┐
    │ Gemini      │     │    Bankr Agent API           │
    │ GPT         │     │    api.bankr.bot             │
    │ Kimi/Qwen   │     │                              │
    └─────────────┘     │  POST /agent/prompt          │
                        │  GET  /agent/balances         │
                        │  GET  /agent/job/{id}         │
                        └──────────────────────────────┘
                                     │
                              ┌──────▼──────┐
                              │    Base     │
                              │  (onchain)  │
                              │ Token launch│
                              │ Fee claims  │
                              │ Uniswap V4 │
                              └─────────────┘

Bankr Integration

LLM Gateway (llm.bankr.bot)

All inference goes through the Bankr LLM Gateway — OpenAI-compatible API with 15+ models:

POST https://llm.bankr.bot/v1/chat/completions
X-API-Key: bk_YOUR_API_KEY

Models: claude-sonnet-4.5, claude-haiku-4.5, gemini-2.5-pro, gemini-2.5-flash, gemini-3-flash, gpt-5.2, gpt-5-mini, kimi-k2.5, qwen3-coder

Credits are topped up from trading fees, creating the self-funding loop.

Agent API (api.bankr.bot)

Token launch, fee claims, and balance checks go through the Bankr Agent API:

Action API Call Description
Launch token POST /agent/prompt "deploy a token called YieldCore" Deploys to Base via Uniswap V4
Check balance GET /agent/balances Wallet balances across chains
Claim fees POST /agent/prompt "claim my token fees" Withdraw accumulated trading fees
Post update POST /agent/prompt "post this update..." Content for token feed

Fee Structure

Tokens launch with a 1.2% swap fee on Uniswap V4. Trading fees are split between the creator and Bankr. Fees accumulate in your token and WETH.

Key Features

1. Token Launch on Base

  • Fair launch via Bankr Agent API (natural language prompt)
  • 1.2% trading fee on Uniswap V4
  • Fixed supply: 100 billion tokens
  • Fees accumulate automatically

2. Self-Funding Decision Engine

Before every inference call, the agent checks:

Available balance ≥ Inference cost ($0.02) + Buffer ($0.05)

If viable → inference is "self-funded" from trading fees If not → uses pre-loaded LLM credits (building toward self-funding)

3. Multi-Model Inference via Bankr

Uses gemini-2.5-flash by default (fastest/cheapest), can switch to Claude or GPT for higher quality analysis.

4. Value Generation Loop

Each iteration produces one of 5 content types:

  • Market Analysis — Base ecosystem overview
  • DeFi Insights — Actionable alpha for holders
  • Token Update — Transparent economic health report
  • Alpha Report — Deep dive on emerging opportunities
  • Ecosystem Analysis — Protocol launches, TVL changes, catalysts

5. Economic Reporting

═══ Economic Loop Report ═══════════════════════════
  Token:           YCORE (0x7F4e3C8A...)
  Loop iterations: 5
  Total fees:      $0.4231 USD
  Inference cost:  $0.1000 USD
  Net P&L:         +$0.3231 USD
  ROI:             323.1%
  Balance:         $0.3231 USD
  Status:          ✅ SELF-FUNDING
  Gateway:         Bankr LLM Gateway (llm.bankr.bot)
════════════════════════════════════════════════════

Onchain Artifacts

Artifact Description Network
Token Launch TX Fair launch via Bankr Agent API Base
Fee Claim TX Trading fees claimed to wallet Base
LLM Credits Inference costs deducted from LLM credits Bankr
Token Updates Content posted via Agent API Base

Conversation Log

Every session produces conversation-log.json:

{
  "agentName": "YieldCore",
  "model": "gemini-2.5-flash",
  "tokenAddress": "0x7F4e3C8A...",
  "tokenSymbol": "YCORE",
  "launchTxHash": "0xa1b2c3d4...",
  "loops": [
    {
      "iteration": 1,
      "feeBalanceUsd": 0.00,
      "inferencePaidFromFees": false,
      "action": "market_analysis",
      "output": "Base ecosystem analysis: TVL up 12%...",
      "economicState": "{\"isViable\":false,\"loopCount\":1}"
    },
    {
      "iteration": 4,
      "feeBalanceUsd": 0.23,
      "inferencePaidFromFees": true,
      "action": "alpha_report",
      "output": "Emerging opportunity: Aerodrome v3...",
      "economicState": "{\"isViable\":true,\"loopCount\":4}"
    }
  ],
  "roi": { "revenue": 0.42, "cost": 0.10, "roi": 320 }
}

Why This Matters

Current AI agents need humans to fund their API costs, manage their wallets, and pay for inference.

YieldCore closes this loop: the AI's intelligence IS the economic engine.

Better analysis → more holders → more fees → more inference → smarter agent → repeat.

Project Structure

yieldcore/
├── src/
│   ├── index.ts          # Entry point — token launch + agent session
│   ├── agent.ts          # Self-funding agent loop, content generation
│   ├── bankr-client.ts   # Bankr Agent API + LLM Gateway client
│   ├── economic-loop.ts  # Fee tracking, viability engine, reporting
│   └── demo.ts           # Standalone runner with built-in content
├── conversation-log.json # Session audit trail (generated)
├── .env                  # Configuration
├── package.json
└── tsconfig.json

License

MIT

About

Yieldcore

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors