Skip to content
Back to skills

Gate Exchange Assetswap

ASecurity

Use when designing portfolio rebalancing strategies — conservative / conviction / market-cap-Top-N baskets, preview-before-create, and order-state checks. Strategy-only; uses public data (CoinGecko market-cap), no exchange CLI/MCP.

  • 19 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 8, 2026
ai-agentspythongobashexpressapi

Works with

  • cli
  • api
  • mcp

Security analysis

A100/100

Scanned November 12, 2026

npx -y skills add oyi77/1ai-skills --skill gate-exchange-assetswap --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Gate Exchange Assetswap?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Gate Exchange Assetswap
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/oyi77-gate-exchange-assetswap/badge)](https://www.skillsdirectory.com/skills/oyi77-gate-exchange-assetswap)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: gate-exchange-assetswap
description: "Use when designing portfolio rebalancing strategies — conservative / conviction / market-cap-Top-N baskets, preview-before-create, and order-state checks. Strategy-only; uses public data (CoinGecko market-cap), no exchange CLI/MCP."
domain: trading
author: oyi77
license: Apache-2.0
subdomain: trading
tags:
  - trading
  - rebalancing
  - portfolio
  - allocation
version: 1.0.0
category: trading
---

# Portfolio Rebalancing (Asset Swap) Strategy Design

Methodology from Gate.io's asset-swap / rebalancing playbook — re-expressed as a portable strategy. Replace the exchange's bundled CLI with public data (CoinGecko market-cap) so you can design a rebalance yourself.

## When to Use
- You want to rebalance a portfolio to a target weight using **only available spot balances**.
- You want a rules-based basket (Top-N by market cap) instead of manual picks.
- Pre-buy or post-sell rebalancing of an existing holding.


## When NOT to Use
- You need to execute live trades against an exchange — this skill designs the strategy only; it does not call any exchange API.
- You require private data (private balances, order history, account state) beyond public CoinGecko market-cap data.

## Workflow

### Phase 1: Select strategy type
- **Conservative**: shift toward a stablecoin anchor (lower volatility).
- **Conviction**: overweight a single asset you believe in (custom weight).
- **Market cap**: Top-N basket weighted by market cap — pull the ranking from public data:
```bash
python3 - <<'PY'
import requests
r = requests.get("https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&order=market_cap_desc&per_page=5&page=1")
for c in r.json():
    print(c["symbol"].upper(), round(c["market_cap"]/1e9,1), "B")
PY
```

### Phase 2: Build the target
- Eligible assets = those with available spot balance.
- Define each leg as **asset + amount** (not ratio-only) so the preview is unambiguous.

### Phase 3: Preview, then create (gated)
- Generate a preview showing each from→to leg with asset and amount.
- Present the preview; do not create until the user explicitly confirms.
- On confirm, the create payload copies each leg's asset + amount.

### Phase 4: Check order state
- States: `configuring`, `completed`, `partially completed`, `failed`.
- Verify final state via the returned order id, not just the create HTTP response.

## Anti-Rationalization Table
| Rationalization | Reality |
|---|---|
| "I'll rebalance with borrowed funds" | Only available spot balances are eligible; don't assume margin. |
| "Ratio-only spec is fine" | Preview needs asset + amount per leg; ratio alone is ambiguous at execution. |
| "Top-N is always safe" | Market-cap weighting is mechanical, not a quality verdict; size conviction separately if needed. |
| "Create returned 200, done" | Inspect order state; `partially completed` / `failed` need follow-up. |

## Overview
Asset swap rebalances a portfolio to a target weight from available spot balances. Pick strategy (conservative / conviction / market-cap Top-N), build legs as asset+amount, preview before create, and confirm. Verify the final order state — not the create response alone.

## Verification
- [ ] Strategy type chosen (conservative / conviction / market-cap).
- [ ] Eligible assets limited to available spot balances.
- [ ] Legs specified as asset + amount (not ratio-only).
- [ ] Preview shown; create executed only after explicit confirmation.
- [ ] Final order state verified (completed / partially / failed), not just HTTP 200.
- [ ] No API key; strategy design only.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.