How to Trade Crypto Coins on CrexSoft
To start trading on the CrexSoft exchange, you need to complete the registration process.
Since the exchange does not link accounts to email addresses or phone numbers,
it is very important to save your registration code.
Only with this code can you change your password and prove that you are
the account owner in case someone steals your login/password.
After registration, all trading features will become available.
To sell or buy anything on the exchange, you first need to fund one of your wallets.
Each cryptocurrency has its own wallet, and each user is given a unique personal address
to deposit funds into that wallet.
When coins are received at this address, they become available for trading.
To buy or sell cryptocurrency, go to the "Trades" page and select a cryptocurrency pair.
This is done from the left menu in the "MARKET" table.
For example, if you want to buy Bitcoin for rubles (RUR),
select RUR in the MARKET table header and then choose the BTC row.
This will open trading information for the BTC/RUR pair.
When a user wants to buy or sell something, they create an Order.
Orders can be for buying or selling.
Each order specifies the number of coins, the price at which they are being sold or bought,
and the total amount, which is calculated by multiplying the price by the number of coins.
All users’ orders form two order books — a buy order book and a sell order book.
If a user wants to buy coins immediately,
they need to set a buy order price higher than the price in the sell order book.
In this case, their order will be executed instantly (market order).
If a user believes the current selling price is too high and expects it to drop,
they can set their buy order price below the current selling price.
Their order will then be placed in the buy order list and will execute automatically
when the price drops to the specified level.
When a buy order is executed, the purchased cryptocurrency will appear
in the user’s wallet.
It can then be sold later for a higher price or withdrawn from the exchange.
Withdrawals are made through the "Wallets" menu.
When depositing or withdrawing coins, double-check addresses carefully — at least seven times —
because these operations are irreversible.
If you enter incorrect information, the cryptocurrency will be lost permanently.
RPC API Format Description
The exchange provides an API service for automated trading using programs and trading bots.
To work with the API, you need to generate API keys in the "Settings" menu.
You can create multiple keys, for example, one key for each program.
RPC API Methods:
Information methods are called via the address
https://crexsoft.com/api/ and do not require API keys.
ticker
Method for retrieving information about the specified currency pair over the last 24 hours.
Call examples:
https://crexsoft.com/api/ticker/btc_rur
https://crexsoft.com/api/ticker/btc_rur-mdc_rur
Output format:
{"mdc_rur":{"high":"1.00000000","low":"0.01500000","avg":"0.02984925","vol":"2.97000000","vol_cur":"99.50000000","last":"0.01500000","buy":"0.00000000","sell":"0.00000000","updated":1569165432}}
trades
Method for retrieving information about the latest trades for the specified pairs.
Call example:
https://crexsoft.com/api/trades/btc_rur
Output format:
{"mdc_rur":[{"type":"bid","price":0.015,"amount":98,"tid":3,"timestamp":1569165432},{"type":"bid","price":1,"amount":1.5,"tid":1,"timestamp":1569159695}]}
depth
Method for retrieving information about active orders for the specified pairs.
Call example:
https://crexsoft.com/api/depth/btc_rur
Output format:
{"btc_rur":{"asks":[[645000,0.0163156],[646000,0.03]],"bids":[[644000,0.00232919],[643000,0.0021773]]}}
Trading API methods are called via the address
https://crexsoft.com/tapi/ and require API keys for access.
Trade
Method for creating a trade order.
Required parameters:
- **pair** – currency pair, string format like "btc_rur"
- **type** – `buy` or `sell` (`buy` - purchase, `sell` - sale)
- **rate** – order price (format 1234.12345678)
- **amount** – number of coins to buy or sell (format 1234.12345678)
Response format:
Array
(
[success] => 1
[return] => Array
(
[received] => 0.00000000
[remains] => 0.00100000
[order_id] => 223512
)
)
Error message format:
Array
(
[success] => 0
[error] => Minimal order amount for price 1.00000000 is 0.00001
)
CancelOrder
Method for canceling a trade order.
Required parameters:
- **order_id** – integer with the order number.
Response format:
Array
(
[success] => 1
[return] => Array
(
[order_id] => 223145
)
)
ActiveOrders
Method for retrieving information about the user's active orders.
Required parameters:
- **pair** – string with the currency pair like `btc_rur`
Response format:
Array
(
[success] => 1
[return] => Array
(
[23] => Array
(
[pair] => btc_rur
[type] => sell
[amount] => 0.00100000
[rate] => 640000.00000000
[timestamp_created] => 1569253154
[status] => 0
)
)
)
OrderInfo
Method for retrieving information about a specific order.
Required parameters:
- **order_id** – integer with the order number.
Response format:
Array
(
[success] => 1
[return] => Array
(
[23] => Array
(
[pair] => btc_rur
[type] => sell
[start_amount] => 0.00100000
[amount] => 0.00100000
[rate] => 640000.00000000
[timestamp_created] => 1569253154
[status] => 0
)
)
)
Where the **status** field values are:
- StateOpen = 0; // order is open
- StateCompleted = 1; // order is completed
- StateCanceled = 2; // order is canceled
- StateCanceledPartially = 3; // order canceled but partially executed
TradeHistory
Method for retrieving trade history.
Parameters:
- **pair** – string with the currency pair like `btc_rur`
- **from** or **from_id** – starting trade ID
- **end_id** – ending trade ID
- **count** – number of trades to retrieve
- **order** – `ASC` or `DESC` (sorting)
- **since** – start time in UNIX timestamp format, e.g., 1569159695690
- **end** – end time in UNIX timestamp format, e.g., 1569159695690
Output format:
Array
(
[success] => 1
[return] => Array
(
[3] => Array
(
[pair] => mdc_rur
[type] => buy
[amount] => 98.00000000
[rate] => 0.01500000
[order_id] => 15
[is_your_order] => 1
[timestamp_created] => 1569165433
)
)
)
getInfo
Method for retrieving information about user balances (number of coins in wallets).
No parameters required.
Response format:
Array
(
[success] => 1
[return] => Array
(
[funds] => Array
(
[rur] => 30000
[btc] => 3.0453156
[eth] => 311.104
[doge] => 346246
[usdte] => 5121
)
[funds_incl_orders] => Array
(
[rur] => 35000
[btc] => 3.3453156
[eth] => 411.104
[doge] => 546246
[usdte] => 6121
)
)
[rights] => Array
(
[info] => 1
[trade] => 1
[withdraw] => 0
)
[transaction_count] => 0
[open_orders] => 0
[server_time] => 1569253346
)
)
API Usage Examples:
PHP Example demonstrating the tradeHistory method for the btc_rur currency pair
=== start of file testapi.php ===
function request($req)
{
$site='crexsoft.com';
$api_key='a876a876a66a86a86a6a6a866a8a';
$api_secret='a65a765a67a567a56a756a76a75a';
$post_data = http_build_query($req, '', '&');
$sign = hash_hmac("sha512", $post_data, $api_secret);
$headers = array('Sign: '.$sign, 'Key: '.$api_key);
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; SMART_API PHP client; '.php_uname('s').'; PHP/'.phpversion().')');
curl_setopt($ch, CURLOPT_URL, 'https://'.$site.'/tapi/');
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_POST, true );
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_ENCODING , 'gzip');
$res = curl_exec($ch);
if($res === false){
$e = curl_error($ch);
tolog3( "transaction error: ".print_r($e, true) );
curl_close($ch);
return null;
}
curl_close($ch);
$result = json_decode($res, true);
if($result['success']!=1){
tolog2( "reply with error: ".print_r($result,true) );
}
return $result;
}
function tradeHistory($pair)
{
$data['method']='TradeHistory';
$data['pair']=$pair;
$data['from_id']=0;
$data['count']=3;
//$data['order']='ASC';
$ret=request($data);
return $ret;
}
print_r( tradeHistory('btc_rur') );
=== end of file testapi.php ===
JavaScript (node.js) example demonstrating order creation, cancellation, retrieving order info, etc.
=== start of file testapi.js ===
const axios = require('axios');
const httpBuildQuery = require('http-build-query');
const crypto = require("crypto");
class CrexsoftApi {
constructor(config) {
this.config=config;
}
async get(method,params){
let url = this.config.apiEndpoint + '/' + method+'/'+params;
let response = await axios.get(url, {}, { headers: { 'Content-Type': 'application/json' }});
return response.data;
}
async doRequest(reqOpts) {
let {url,method,body,headers} = reqOpts;
let response = await axios.post(url, body, { headers });
return response.data;
}
async makeSignedRequest(params){
let signature = httpBuildQuery(params);
let url=this.config.url;
let reqUrl = 'https://' + url + '/tapi/';
let hmacsignature = crypto.createHmac('sha512', this.config.secretkey).update(signature).digest('hex');
let headers = {
'Content-Type': 'application/x-www-form-urlencoded',
'Key': this.config.publickey,
'Sign': hmacsignature,
'Cache-Control': 'no-cache'
};
let reqOpts = { url: reqUrl, method: "POST", body: signature, headers: headers };
let res = await this.doRequest(reqOpts);
return res;
}
async OrderInfo({orderid}){
let params={ method:'OrderInfo', order_id:orderid };
return await this.makeSignedRequest(params);
}
async Trade({pair,type,rate,amount}){
let params={ method:'Trade', pair, type, rate, amount };
return await this.makeSignedRequest(params);
}
async getInfo(){
let params={ method:'getInfo' };
return await this.makeSignedRequest(params);
}
async CancelOrder({orderid}){
let params={ method:'CancelOrder', order_id:orderid };
return await this.makeSignedRequest(params);
}
}
let config={ apiEndpoint: 'https://crexsoft.com/api', publickey:'your public key from settings', secretkey:'your secret key from settings' };
let crexsoft=new CrexsoftApi(config);
// informational methods
crexsoft.get('ticker','btc_rur').then(console.log).catch(console.error);
crexsoft.get('trades','btc_rur').then(console.log).catch(console.error);
crexsoft.get('depth','btc_rur').then(console.log).catch(console.error);
// trading methods
crexsoft.getInfo().then(console.log).catch(console.error);
crexsoft.OrderInfo({orderid:12345}).then(console.log).catch(console.error);
crexsoft.CancelOrder({orderid:12345}).then(console.log).catch(console.error);
crexsoft.Trade({pair:'btc_rur', type:'buy', rate:0.00000001, amount:1000}).then(console.log).catch(console.error);
=== end of file testapi.js ===