<!DOCTYPE html><htmlclass="default"><head><metacharSet="utf-8"/><metahttp-equiv="x-ua-compatible"content="IE=edge"/><title>@project-serum/serum-dev-tools</title><metaname="description"content="Documentation for @project-serum/serum-dev-tools"/><metaname="viewport"content="width=device-width, initial-scale=1"/><linkrel="stylesheet"href="assets/style.css"/><linkrel="stylesheet"href="assets/highlight.css"/><scriptasyncsrc="assets/search.js"id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme")||"os")</script><header><divclass="tsd-page-toolbar"><divclass="container"><divclass="table-wrap"><divclass="table-cell"id="tsd-search"data-base="."><divclass="field"><labelfor="tsd-search-field"class="tsd-widget search no-caption">Search</label><inputtype="text"id="tsd-search-field"/></div><ulclass="results"><liclass="state loading">Preparing search index...</li><liclass="state failure">The search index is not available</li></ul><ahref="index.html"class="title">@project-serum/serum-dev-tools</a></div><divclass="table-cell"id="tsd-widgets"><divid="tsd-filter"><ahref="#"class="tsd-widget options no-caption"data-toggle="options">Options</a><divclass="tsd-filter-group"><divclass="tsd-select"id="tsd-filter-visibility"><spanclass="tsd-select-label">All</span><ulclass="tsd-select-list"><lidata-value="public">Public</li><lidata-value="protected">Public/Protected</li><lidata-value="private"class="selected">All</li></ul></div><inputtype="checkbox"id="tsd-filter-inherited"checked/><labelclass="tsd-widget"for="tsd-filter-inherited">Inherited</label><inputtype="checkbox"id="tsd-filter-externals"checked/><labelclass="tsd-widget"for="tsd-filter-externals">Externals</label></div></div><ahref="#"class="tsd-widget menu no-caption"data-toggle="menu">Menu</a></div></div></div></div><divclass="tsd-page-title"><divclass="container"><h1>@project-serum/serum-dev-tools </h1></div></div></header><divclass="container container-main"><divclass="row"><divclass="col-8 col-content"><divclass="tsd-panel tsd-typography">
<p>You will need to use the <code>FileKeypair</code> class that extends the <ahref="https://solana-labs.github.io/solana-web3.js/classes/Keypair.html"><code>Keypair</code></a> class from <ahref="https://npmjs.com/package/@solana/web3.js"><code>@solana/web3.js</code></a> to provide easy file-based keypair management, which is required for the market making features provided by this package.</p>
<p>You need to have a <ahref="https://github.com/project-serum/serum-dex/">serum-dex</a> program deployed on the cluster you wish to interact with.</p>
<p>You can either,</p>
<ul>
<li><p>Use the <ahref="https://github.com/project-serum/serum-dev-tools/tree/main/cli">serum-dev-tools CLI</a> to deploy the program.</p>
<li><p>use the already deployed <code>serum-dex</code> programs, <code>9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin</code> on <strong>mainnet-beta</strong> and <code>DESVgJVGajEgKGXhb6XmqDHGz3VjdgP7rEVESBgxmroY</code> on <strong>devnet</strong>.</p>
<pre><codeclass="language-javascript"><spanclass="hl-0">const</span><spanclass="hl-1"></span><spanclass="hl-2">baseCoin</span><spanclass="hl-1"> = </span><spanclass="hl-6">await</span><spanclass="hl-1"></span><spanclass="hl-3">dex</span><spanclass="hl-1">.</span><spanclass="hl-4">createCoin</span><spanclass="hl-1">(</span><br/><spanclass="hl-1"></span><spanclass="hl-5">"SAYA"</span><spanclass="hl-1">,</span><br/><spanclass="hl-1"></span><spanclass="hl-7">9</span><spanclass="hl-1">,</span><br/><spanclass="hl-1"></span><spanclass="hl-3">owner</span><spanclass="hl-1">.</span><spanclass="hl-3">keypair</span><spanclass="hl-1">,</span><br/><spanclass="hl-1"></span><spanclass="hl-3">owner</span><spanclass="hl-1">.</span><spanclass="hl-3">keypair</span><spanclass="hl-1">,</span><br/><spanclass="hl-1"></span><spanclass="hl-3">owner</span><spanclass="hl-1">.</span><spanclass="hl-3">keypair</span><spanclass="hl-1">,</span><br/><spanclass="hl-1">);</span><br/><br/><spanclass="hl-0">const</span><spanclass="hl-1"></span><spanclass="hl-2">quoteCoin</span><spanclass="hl-1"> = </span><spanclass="hl-6">await</span><spanclass="hl-1"></span><spanclass="hl-3">dex</span><spanclass="hl-1">.</span><spanclass="hl-4">createCoin</span><spanclass="hl-1">(</span><br/><spanclass="hl-1"></span><spanclass="hl-5">"SRM"</span><spanclass="hl-1">,</span><br/><spanclass="hl-1"></span><spanclass="hl-7">9</span><spanclass="hl-1">,</span><br/><spanclass="hl-1"></span><spanclass="hl-3">owner</span><spanclass="hl-1">.</span><spanclass="hl-3">keypair</span><spanclass="hl-1">,</span><br/><spanclass="hl-1"></span><spanclass="hl-3">owner</span><spanclass="hl-1">.</span><spanclass="hl-3">keypair</span><spanclass="hl-1">,</span><br/><spanclass="hl-1"></span><spanclass="hl-3">owner</span><spanclass="hl-1">.</span><spanclass="hl-3">keypair</span><spanclass="hl-1">,</span><br/><spanclass="hl-1">);</span><br/><br/><spanclass="hl-8">// Fund the FileKeypair object to place orders.</span><br/><br/><spanclass="hl-6">await</span><spanclass="hl-1"></span><spanclass="hl-3">baseCoin</span><spanclass="hl-1">.</span><spanclass="hl-4">fundAccount</span><spanclass="hl-1">(</span><spanclass="hl-7">1000000</span><spanclass="hl-1">, </span><spanclass="hl-3">owner</span><spanclass="hl-1">.</span><spanclass="hl-3">keypair</span><spanclass="hl-1">, </span><spanclass="hl-3">connection</span><spanclass="hl-1">);</span><br/><br/><spanclass="hl-6">await</span><spanclass="hl-1"></span><spanclass="hl-3">quoteCoin</span><spanclass="hl-1">.</span><spanclass="hl-4">fundAccount</span><spanclass="hl-1">(</span><spanclass="hl-7">2000000</span><spanclass="hl-1">, </span><spanclass="hl-3">owner</span><spanclass="hl-1">.</span><spanclass="hl-3">keypair</span><spanclass="hl-1">, </span><spanclass="hl-3">connection</span><spanclass="hl-1">);</span>