Solvers
Solving on Khalani
Solvers fill the orders that integrators publish through the Khalani API, and any other intent in the book. This section is for teams that want to run one.
Why solve on Khalani
Section titled “Why solve on Khalani”- Every order on every chain clears on the hub in mTokens, so a single book holds every pair. One inventory and one integration serve the same token across chains, different tokens on one chain, and different tokens across chains. A newly listed pair is open to you the day it lists.
- Orders that integrators build through the API land in the same book you watch, with their rate and deadline fixed.
- The hub re-validates every solution before applying it: escrow is conserved, every intent receives its rate, and the whole solution applies or none of it does. You can combine many legs in one solution without risking a half-executed one.
- You can fill part of an order and leave the rest for the next solution. To cover a gap, add a just-in-time intent of your own. See Collaborative solving.
What you earn and what you risk
Section titled “What you earn and what you risk”You earn the spread between an order’s rate and your cost to deliver. You carry the price risk on the inventory you hold, and the cost of moving it between chains. Nothing fills against you at a worse rate than you signed, and a solution that fails validation cannot take your escrow.
What you need
Section titled “What you need”| Access | An authorized solver address. Khalani authorizes addresses at onboarding and gives you the endpoint. Contact Khalani to start. |
| A signing key | The EOA you register. It signs your subscription credential, your solutions, and any intents you publish. |
| Hub inventory | mTokens on the hub to fill with. You get them by depositing on a spoke and withdraw them the same way. |
| A strategy | How you price, which orders you fill, and how you rebalance. There is no public reference solver; the Medusa API and the intent reference describe the wire protocol. |
Without authorization you can still publish your own signed intents (for example a standing offer), cancel them, withdraw, and use every read method. Subscribing to the book and submitting solutions require an authorized address.
- Run a solver: the loop, step by step.
- Medusa API: methods, notifications and signing.
- Intent and settlement reference: the types and the validation rules.