colorpool

ColorPool DEX — Chromia's decentralized exchange for token swaps, liquidity pools, and balance management.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "colorpool" with this command: npx skills add kj-script/colorpool-skills

ColorPool DEX

Trade with confidence on Chromia's top liquidity pools, offering high-volume, low-friction transactions designed for serious traders.

Purpose & Scope

This skill enables an AI agent to:

  • Swap tokens on ColorPool (Chromia's DEX) using the Uniswap V2-compatible interface
  • Query token balances, pool information, and trading routes
  • Get swap quotes with slippage protection before executing trades
  • Transfer tokens between accounts (including cross-chain transfers)

What This Skill Does NOT Do

  • It does not manage BSC/EVM wallets or external DEX trades. For that, see bsc_pancakeswap_skill.md or impossible_finance_skill.md.
  • It does not manage ClawChain social network operations. For that, see skill.md or curl_skills.md.
  • It does not create or manage ClawChain agent accounts. Registration must be done first via the clawchain skill.

Transparency: Files Accessed

FileAccessPurpose
~/.config/colorpool/credentials.jsonRead (used for --secret flag)Chromia keypair for signing swap transactions via CLI
~/.config/clawchain/credentials.jsonRead-only (optional)Used to look up your account ID from your pubkey

Transparency: Network Calls

EndpointPurpose
$COLORPOOL_NODE with $COLORPOOL_BRIDColorPool DEX — token queries, swap quotes, and swap execution
$CLAWCHAIN_NODE with $CLAWCHAIN_BRIDClawChain — account ID lookup from pubkey (one-time during setup)

Prerequisites

  • You must have a registered account on ClawChain (see the clawchain skill) before registering on ColorPool.
  • Your ColorPool account must be funded with USDC before registration (see Registration section).
  • The Chromia CLI (chr) must be installed.

Configuration

# Required — set these or replace in commands
export COLORPOOL_BRID="19571DCB739CCDDC4BC8B96A01C7BDE9FCC389B566DD1B85737E892695674288"
export COLORPOOL_NODE="https://chromia.01node.com:7740"
export CLAWCHAIN_BRID="9D728CC635A9D33DAABAC8217AA8131997A8CBF946447ED0B98760245CE5207E"
export CLAWCHAIN_NODE="https://chromia.01node.com:7740"

Install Chromia CLI

macOS (Homebrew):

brew tap chromia/core https://gitlab.com/chromaway/core-tools/homebrew-chromia.git
brew install chromia/core/chr
chr --version

Other OS: See https://learn.chromia.com/docs/install/cli-installation/


Registration (First Time Only)

1. Get Your Account ID + Tell Owner How to Fund It (USDC)

Before registering, you can derive your account id from your public key and provide it to your owner so they can fund you. Unless you have funds in your account it is not possible to register it.

Get account id from pubkey

You will find your public key in ~/.config/clawchain/credentials.json which must have been previously generated. If this file does not exist prompt your user to register on ClawChain first.

chr query ft4.get_accounts_by_signer id="pubkey here"   \
  -brid $CLAWCHAIN_BRID --api-url $CLAWCHAIN_NODE

Example response:

{
  "data": [
    {
      "id": "B6B309885238EDF21508544E243293DC947FFDD2F22C9CAA80FA6A209C6E8658",
      "type": "FT4_USER"
    }
  ],
  "next_cursor": null
}

Use the first data[0].id as your account id.

Tell your owner

When you communicate this to your owner, include the account id directly so they can copy/paste:

My account id is: <ACCOUNT_ID_FROM_QUERY>

Then instruct your owner to fund you like this:

Owner Step 1 — Deposit USDC to their own account first

  1. Go to https://vault.chromia.com/deposit/
  2. Select USDC in the Asset field
  3. When USDC is selected, Colorpool Bridge should be selected by default in Deposit to (if not, select Colorpool Bridge)
  4. Click Deposit
  5. Follow the remaining steps to deposit USDC into their own account

Owner Step 2 — Transfer USDC to your account id

  1. Go to https://vault.chromia.com/transfer/
  2. Select USDC as the asset
  3. In To dapp, select Colorpool Bridge
  4. In To address, paste your account id: <ACCOUNT_ID_FROM_QUERY>
  5. Confirm the transfer

2. Create FT4 Account

chr tx ft4.ras_transfer_fee \
  'x"9BACD576F40B6674AA76B8BFA1330077A3B94F581BFDB2EF806122C384DCDF25"' \
  '[0, [["A","T"], x"<YOUR_PUBKEY>"], null]' \
  'null' \
  --ft-register-account \
  --secret ~/.config/colorpool/credentials.json \
  -brid $COLORPOOL_BRID \
  --api-url $COLORPOOL_NODE \
  --await

Command Patterns

Operations (chr tx) vs Queries (chr query)

AspectOperations (chr tx)Queries (chr query)
PurposeWrite data (create, update, delete)Read data only
Auth requiredYes (--ft-auth --secret)No
Argument stylePOSITIONAL (order matters)NAMED (use arg=value)
Costs gasYesNo

Operations (require auth) - POSITIONAL arguments

Arguments are passed in order, wrapped in double quotes:

chr tx <operation> "value1" "value2" "value3" \
  --ft-auth \
  --secret ~/.config/colorpool/credentials.json \
  -brid $COLORPOOL_BRID \
  --api-url $COLORPOOL_NODE \
  --await

Queries (no auth) - NAMED arguments

Each argument is wrapped in single quotes with name=value format:

chr query <query_name> 'arg1=value' 'arg2=123' \
  -brid $COLORPOOL_BRID \
  --api-url $COLORPOOL_NODE

When to use inner double quotes (queries only)

Value TypeFormatExample
Numbers'arg=123''lim=10' 'off=0' 'post_id=42'
Simple strings (no spaces)'arg=value''name=someagent' 'subclaw_name=general'
Strings WITH spaces'arg="value here"''bio="Hello World"' 'content="My post title"'
Empty/null'arg=''viewer_name='
List (e.g. path)'arg=["A","B"]''path=["CHR","USDT"]' — each symbol must be a quoted string

Shell quoting (Windows)

Multiple quoting layers (PowerShell vs cmd.exe) can mangle arguments so the node reports "missing arguments". To avoid that:

  • Prefer bash/zsh: Use WSL, Git Bash, or macOS/Linux so the examples work as written (single-quoted 'arg=value').
  • PowerShell: Use single quotes around each argument so PowerShell does not expand $VAR or break on spaces; for a list, escape inner double quotes or use single quotes for the outer wrapper, e.g. 'path=["CHR","USDT"]'.
  • cmd.exe: Avoid if possible; escaping is brittle. If you must, use double quotes and escape " as \"; consider switching to PowerShell or WSL for chr commands.

When in doubt, run the same command from bash (e.g. in WSL or Git Bash) to confirm the node receives amount_in and path correctly.

Multiline content (operations)

For content with newlines, use $'...' syntax (bash/zsh):

# ✅ Correct - $'...' interprets \n as actual newlines
chr tx create_post "general" "Title" $'Line 1\n\nLine 2' "" ...

# ❌ Wrong - regular quotes store \n as literal text
chr tx create_post "general" "Title" "Line 1\n\nLine 2" "" ...

Null values (operations)

For optional parameters, use null:

# Top-level comment (no parent)
chr tx create_comment 42 "My comment" null ...

Operations

Swap Operations

OperationArgumentsDescription
swap_exact_tokens_for_tokensamount_in amount_out_min path to deadlineSwap exact input for minimum output
swap_tokens_for_exact_tokensamount_out amount_in_max path to deadlineSwap for exact output with max input

Notes:

  • path is a list of token symbols in GTV format (see Path format (GTV) below).
  • to is your account ID (hex string)
  • deadline is unix timestamp in seconds
  • Max path length: 5 tokens

Path format (GTV)

path must be valid GTV: a list of strings, with each token symbol as a double-quoted string. The node rejects malformed path values; then amount_in/path can appear "missing" even when you think you passed them.

FormatValid?Example
Quoted symbols in list'path=["CHR","USDT"]' or "path=[\"CHR\",\"USDT\"]"
Unquoted symbols[CHR,USDC] — not valid GTV; symbols must be quoted strings
Positional query argsQueries require named args (arg=value), not positional
  • In bash/zsh: use single quotes around the whole named arg: 'path=["CHR","USDT"]'.
  • In queries, always use named arguments: 'amount_in=...' and 'path=["CHR","USDT"]'.

Asset Transfer

OperationArgumentsDescription
ft4.transferrecipient_id asset_id amountTransfer tokens
ft4.crosschain.init_transferrecipient_id asset_id amount hops deadlineCross-chain transfer

Queries

Token Queries

QueryArgumentsReturns
get_list_tokensname page page_sizeList of tokens (filtered by name)
get_token_detailsearchToken info by symbol/name
get_token_by_addressaddressToken info by ID (hex)
get_balance_ofpubkey asset_symbolUser balance for token
get_list_tokens_balance_ofuser page page_sizeAll token balances for user

Swap Queries

QueryArgumentsReturns
query_get_amounts_outamount_in pathExpected output amounts
query_get_amounts_inamount_out pathRequired input amounts
find_route_outamount_in from toBest route for input amount
find_route_inamount_out from toBest route for output amount
calculate_price_impactasset_symbol_0 asset_symbol_1 delta0 delta1 pathPrice impact percentage

Pool Queries

QueryArgumentsReturns
get_all_poolpage page_sizeAll liquidity pools
is_pair_existasset_symbol_0 asset_symbol_1Boolean - pair exists?
get_pair_publicasset0_symbol asset1_symbolPair details
get_asset_balance_in_poolasset_0_symbol asset_1_symbolPool reserves
get_tvlpage_size page_cursorTotal value locked
get_supported_pairspage_size page_cursorAll trading pairs

Credit Queries

QueryArgumentsReturns
get_asset_balance_credit_overrideaccount_id asset_symbol current_timeCredit balance (use "Credit" as symbol)
get_credit_amountCredit costs for all operations

Account Queries

QueryArgumentsReturns
get_account_by_pubkeypubkeyAccount info
check_account_existspubkeyBoolean
get_all_accountpage page_sizeAll accounts

Swap workflow (quote → slippage → execute)

Never execute a blind swap. Always:

  1. Get a quote with query_get_amounts_out using named arguments and a valid GTV path (see Path format (GTV)).
  2. From the response, take the expected output amount and apply slippage (e.g. 0.5% or 1%): amount_out_min = quoted_amount * (1 - slippage_bps/10000).
  3. Call swap_exact_tokens_for_tokens with that amount_out_min and the same path/amount_in/to/deadline.

If the quote call fails or returns missing data, fix the query (named args + valid path) before attempting a swap.


Examples

All queries use named arguments (arg=value). Positional query formats are rejected by chr.

Get swap quote (CHR → USDT):

chr query query_get_amounts_out 'amount_in=1000000000000000000' 'path=["CHR","USDT"]' \
  -brid $COLORPOOL_BRID --api-url $COLORPOOL_NODE

Find best route:

chr query find_route_out 'amount_in=1000000000000000000' 'from=CHR' 'to=USDT' \
  -brid $COLORPOOL_BRID --api-url $COLORPOOL_NODE

Swap CHR for USDT (after getting quote and computing amount_out_min):

chr tx swap_exact_tokens_for_tokens \
  1000000000000000000 \
  950000 \
  '["CHR", "USDT"]' \
  "<YOUR_ACCOUNT_ID>" \
  1735689600 \
  --ft-auth --secret ~/.config/colorpool/credentials.json \
  -brid $COLORPOOL_BRID --api-url $COLORPOOL_NODE --await

Use the amount_out_min from the quote (with slippage applied), not a guess.

Check token balance:

chr query get_balance_of 'pubkey=x"<YOUR_PUBKEY>"' 'asset_symbol=CHR' \
  -brid $COLORPOOL_BRID --api-url $COLORPOOL_NODE

Get all pools:

chr query get_all_pool 'page=1' 'page_size=20' \
  -brid $COLORPOOL_BRID --api-url $COLORPOOL_NODE

Check credit balance:

chr query get_asset_balance_credit_override \
  'account_id=x"<YOUR_ACCOUNT_ID>"' 'asset_symbol=Credit' 'current_time=1738678800' \
  -brid $COLORPOOL_BRID --api-url $COLORPOOL_NODE

Credit System

ColorPool uses a credit system for gas fees:

ActionCredit Cost
Daily free credits+1000
Account registration+200
Swap-1
Transfer-5
Cross-chain init transfer-2
Cross-chain apply transfer-2

Token Decimals

Most tokens use 18 decimals. For example:

  • 1 CHR = 1000000000000000000 (10^18)
  • USDT typically uses 6 decimals: 1 USDT = 1000000

Always check token decimals with get_token_detail before transactions.


Security Notes

Credential Storage

  • ~/.config/colorpool/credentials.json contains your Chromia keypair for ColorPool. Protect it with chmod 600.
  • The private key is used only locally by Chromia CLI to sign transactions. It is never sent over the network.
  • The --secret flag tells chr where to find the keypair for signing — the CLI handles signing in-memory.

Best Practices

  • Only trade with amounts you can afford to lose.
  • Always get a swap quote before executing a trade.
  • Use appropriate slippage tolerance (0.5–1% for stable pairs, 2–5% for volatile pairs).

Errors

ErrorSolution
UniswapV2: INSUFFICIENT_OUTPUT_AMOUNTIncrease slippage tolerance
UniswapV2: INSUFFICIENT_LIQUIDITYReduce swap amount
UniswapV2: EXPIREDUse later deadline
UniswapV2: KInternal invariant error, try again
Credit is not enoughWait for daily credits or reduce operations

Links

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Construction Claim Strategy

• Strategy before drafting. Decide direction, scope, and argument before choosing clauses. • 7 dimensions. Situation, scope, direction, argument, disclosure, response architecture, risk. • All major contract forms. FIDIC, PSSCOC, NEC, SIA, JCT, and bespoke.

Registry SourceRecently Updated
General

Goldman Sachs Co

提供高盛公司历史、业务模式、市场地位及关键数据,助力研究投资银行和金融机构角色分析。

Registry SourceRecently Updated
General

Goldfish

Goldfish是Pepperidge Farm旗下标志性小鱼形儿童零食,始于1962年,北美市场销量领先且覆盖多口味多渠道。

Registry SourceRecently Updated
General

Dailymotion

法国的视频分享平台,2005年创立,Vivendi持有,聚焦欧洲和中东市场,提供优质内容与媒体合作,月活超3亿用户。

Registry SourceRecently Updated