An integration is your own interface on top of Mog’s venue. Your users trade the same markets, with the same positions, payouts and risks, as traders in the Mog app. Every order your interface signs can name your address as its builder. When those positions settle a win, you earn a share of the settlement fee.
How an order travels
Section titled “How an order travels”- Your user connects a wallet in your interface.
- The wallet signs once to grant a session key. The session key can trade for the account, but it can never withdraw.
- Your interface signs each order with the session key and puts your builder address in the order.
- The signed order goes to Mog’s relay, which pays the network fee, or straight to the chain. Today the relay accepts browser requests only from Mog’s own sites. Send to it from your server, which sends no browser origin, or have your users’ wallets send the order to the chain.
- The order fills at the next attested price, the same as an order from the Mog app. See Positions and leverage.
The builder address is part of what the user signs. Nobody can add it, change it or remove it later.
What you need
Section titled “What you need”| Need | Where |
|---|---|
| How builder earnings work and how to collect them | Builder codes |
| How builder codes relate to the app’s referral links | Builder codes and referrals |
| Endpoints, the CLI and error codes | API |
| Who may call each part of the venue | Permissions |