Instrucciones de origen · Vista previa de solo lectura
name
colorpool
version
3.0.0
description
ColorPool DEX — Chromia's decentralized exchange for token swaps, liquidity pools, and balance management.
homepage
https://colorpool.xyz
env
[{"name":"COLORPOOL_BRID","description":"Blockchain RID (identifier) for the ColorPool DEX dapp on Chromia.","default":"19571DCB739CCDDC4BC8B96A01C7BDE9FCC389B566DD1B85737E892695674288","required":true},{"name":"COLORPOOL_NODE","description":"Chromia node URL for ColorPool API requests.","default":"https://chromia.01node.com:7740","required":true},{"name":"CLAWCHAIN_BRID","description":"Blockchain RID for ClawChain (used to look up account ID from pubkey).","default":"9D728CC635A9D33DAABAC8217AA8131997A8CBF946447ED0B98760245CE5207E","required":true},{"name":"CLAWCHAIN_NODE","description":"Chromia node URL for ClawChain queries.","default":"https://chromia.01node.com:7740","required":true}]
credentials
[{"name":"ColorPool Credentials","path":"~/.config/colorpool/credentials.json","description":"Chromia keypair (privKey + pubKey in hex) for signing ColorPool transactions. This may be the same keypair as your ClawChain credentials, or a separate one for ColorPool. Used only locally by Chromia CLI for signing — never sent over the network.","access":"read"},{"name":"ClawChain Credentials (for account lookup)","path":"~/.config/clawchain/credentials.json","description":"Chromia keypair used for looking up your account ID. Created by the clawchain skill. Read-only access — this skill does not modify it.","access":"read","optional":true}]
dependencies
[{"name":"Chromia CLI (chr)","description":"Command-line interface for interacting with Chromia blockchain. Used for queries, transactions, and account registration.","install":"brew tap chromia/core https://gitlab.com/chromaway/core-tools/homebrew-chromia.git && brew install chromia/core/chr","docs":"https://learn.chromia.com/docs/install/cli-installation/"}]
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
File
Access
Purpose
~/.config/colorpool/credentials.json
Read (used for --secret flag)
Chromia keypair for signing swap transactions via CLI
~/.config/clawchain/credentials.json
Read-only (optional)
Used to look up your account ID from your pubkey
Transparency: Network Calls
Endpoint
Purpose
$COLORPOOL_NODE with $COLORPOOL_BRID
ColorPool DEX — token queries, swap quotes, and swap execution
$CLAWCHAIN_NODE with $CLAWCHAIN_BRID
ClawChain — 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 () must be installed.
chr
Configuration
# Required — set these or replace in commandsexport 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
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.
'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
Operation
Arguments
Description
swap_exact_tokens_for_tokens
amount_inamount_out_minpathtodeadline
Swap exact input for minimum output
swap_tokens_for_exact_tokens
amount_outamount_in_maxpathtodeadline
Swap 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.
Format
Valid?
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 args
❌
Queries 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
Operation
Arguments
Description
ft4.transfer
recipient_idasset_idamount
Transfer tokens
ft4.crosschain.init_transfer
recipient_idasset_idamounthopsdeadline
Cross-chain transfer
Queries
Token Queries
Query
Arguments
Returns
get_list_tokens
namepagepage_size
List of tokens (filtered by name)
get_token_detail
search
Token info by symbol/name
get_token_by_address
address
Token info by ID (hex)
get_balance_of
pubkeyasset_symbol
User balance for token
get_list_tokens_balance_of
userpagepage_size
All token balances for user
Swap Queries
Query
Arguments
Returns
query_get_amounts_out
amount_inpath
Expected output amounts
query_get_amounts_in
amount_outpath
Required input amounts
find_route_out
amount_infromto
Best route for input amount
find_route_in
amount_outfromto
Best route for output amount
calculate_price_impact
asset_symbol_0asset_symbol_1delta0delta1path
Price impact percentage
Pool Queries
Query
Arguments
Returns
get_all_pool
pagepage_size
All liquidity pools
is_pair_exist
asset_symbol_0asset_symbol_1
Boolean - pair exists?
get_pair_public
asset0_symbolasset1_symbol
Pair details
get_asset_balance_in_pool
asset_0_symbolasset_1_symbol
Pool reserves
get_tvl
page_sizepage_cursor
Total value locked
get_supported_pairs
page_sizepage_cursor
All trading pairs
Credit Queries
Query
Arguments
Returns
get_asset_balance_credit_override
account_idasset_symbolcurrent_time
Credit balance (use "Credit" as symbol)
get_credit_amount
Credit costs for all operations
Account Queries
Query
Arguments
Returns
get_account_by_pubkey
pubkey
Account info
check_account_exists
pubkey
Boolean
get_all_account
pagepage_size
All accounts
Swap workflow (quote → slippage → execute)
Never execute a blind swap. Always:
Get a quote with query_get_amounts_out using named arguments and a valid GTV path (see Path format (GTV)).
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).
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.