Skip to main content

Solver Guide

This tutorial describes how to run a solver node and how users can post problems to this.

Deployments

ChainStageID
centauri-1mainnetcentauri1lnyecncq9akyk8nk0qlppgrq6yxktr68483ahryn457x9ap4ty2sthjcyt
osmosis-1mainnet

Problem Submission

An example of a problem that the user can post is here:

          {
"@type": "/cosmwasm.wasm.v1.MsgExecuteContract",
"sender": "centauri1mgnu00vn0feumu660y6p7ty5mv58txvhgkr2lu",
"contract": "centauri1lnyecncq9akyk8nk0qlppgrq6yxktr68483ahryn457x9ap4ty2sthjcyt",
"msg": {
"order": {
"msg": {
"wants": {
"denom": "ppica",
"amount": "1000000"
},
"transfer": null,
"timeout": 2506928,
"min_fill": null
}
}
},
"funds": [
{
"denom": "ibc/EF48E6B1A1A19F47ECAEA62F5670C37C0580E86A9E88498B7E393EB6F49F33C0",
"amount": "1"
}
]
}

An example of a mainnet transaction is available here.

You can try it using live code with this.

Deploying Your Own Contracts

Here is how you can deploy your own contracts:

$BINARY tx wasm store $ORDER_WASM_FILE --from dz --gas=auto
$BINARY tx wasm instantiate 18 '{"admin": "centauri1u2sr0p2j75fuezu92nfxg5wm46gu22ywfgul6k", "cvm_address" : "centauri1wpf2szs4uazej8pe7g8vlck34u24cvxx7ys0esfq6tuw8yxygzuqpjsn0d"}' --label "mantis_order_1" --admin centauri1u2sr0p2j75fuezu92nfxg5wm46gu22ywfgul6k --gas=auto --from=dz

Running a Solver Node

Documentation on how to run a solver node is located here.

Problem/Solution Format

See on-chain indexer/explorer for the Problem Solver contract. It will show all in JSON format.

Querying the Order Book

How to query the order book on MANTIS is shown below:

CVM Interface

An example of how to convert the solution into a CVM program algorithm is depicted here.

Fees

There are no fees; users just need to pay gas.

Contracts

The full MANTIS contracts GitHub repo is here.

Contract to add the Problem to MANTIS

The MANTIS contract to add the problem can be viewed here.