Skip to content

Commit 94ce3f9

Browse files
committed
Deploying to gh-pages from @ 91bb2e2 🚀
1 parent 43bec96 commit 94ce3f9

3 files changed

Lines changed: 23 additions & 3 deletions

File tree

libraries/cosmwasm/clearing_queue.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ <h1 class="menu-title">Valence Protocol Documentation</h1>
173173
<main>
174174
<h1 id="valence-clearing-queue-library"><a class="header" href="#valence-clearing-queue-library">Valence Clearing Queue Library</a></h1>
175175
<p>The <strong>Valence Clearing Queue</strong> library allows <strong>registration and settlement of withdrawal obligations</strong> in a FIFO (First-In-First-Out) manner. It maintains a queue of pending withdrawal obligations, with each obligation containing recipient information, payout amounts, and a unique identifier. When settling obligations, funds are pulled from a <strong>settlement input account</strong> and sent to the specified recipients.</p>
176+
<p>The queue processes obligations based on a strict, monotonically increasing order of the obligation ids.
177+
This is meant to prevent any out-of-order errors that may arise from latency or other issues.</p>
176178
<blockquote>
177179
<p><strong>Important:</strong>
178180
This library functions solely as a settlement engine. The settlement account funding (liquidity-management) flow is outside of its scope and is managed by a strategist. This management process likely involves monitoring both the settlement account balance and the obligation queue in order to ensure the settlement account maintains sufficient liquidity for obligation settlements.</p>
@@ -195,7 +197,7 @@ <h2 id="high-level-flow"><a class="header" href="#high-level-flow">High-level fl
195197
</pre>
196198
<h2 id="functions"><a class="header" href="#functions">Functions</a></h2>
197199
<div class="table-wrapper"><table><thead><tr><th>Function</th><th>Parameters</th><th>Description</th></tr></thead><tbody>
198-
<tr><td><strong>RegisterObligation</strong></td><td><code>recipient: String</code><br><code>payout_coins: Vec&lt;Coin&gt;</code><br><code>id: Uint64</code></td><td>Registers a new withdrawal obligation in the queue with the specified recipient, payout coins, and unique ID. Each obligation must have non-zero payout amounts. Recipient must be a valid bech32 address.</td></tr>
200+
<tr><td><strong>RegisterObligation</strong></td><td><code>recipient: String</code><br><code>payout_amount: Uint128</code><br><code>id: Uint64</code></td><td>Registers a new withdrawal obligation in the queue with the specified recipient, payout coins, and unique ID. Each obligation must have a non-zero payout amount. Recipient must be a valid bech32 address. Obligation id must equal the latest registered obligation id plus 1.</td></tr>
199201
<tr><td><strong>SettleNextObligation</strong></td><td>-</td><td>Settles the oldest withdrawal obligation in the queue by transferring funds from the <strong>settlement input account</strong> to the specified recipient. Fails if there are no pending obligations or if the input account has insufficient balance.</td></tr>
200202
</tbody></table>
201203
</div>
@@ -207,9 +209,17 @@ <h2 id="configuration"><a class="header" href="#configuration">Configuration</a>
207209
/// settlement input account which we tap into in order
208210
/// to settle the obligations
209211
pub settlement_acc_addr: LibraryAccountType,
212+
/// obligation base denom
213+
pub denom: String,
214+
/// latest registered obligation id.
215+
/// if `None`, defaults to 0
216+
pub latest_id: Option&lt;Uint64&gt;,
210217
}
211218
<span class="boring">}</span></code></pre></pre>
212219
<p>The <code>settlement_acc_addr</code> specifies the account from which funds will be pulled to fulfill settlement obligations. The library will check that this account has sufficient balance before attempting to settle each obligation.</p>
220+
<p>Configured <code>denom</code> is the base clearing denomination which will be applied to all obligation amounts.</p>
221+
<p>Lastly, the optional <code>latest_id</code> field allows to configure the library order to start from a specific id.
222+
If <code>None</code>, latest id defaults to 0. Otherwise, it will start from the specified id.</p>
213223

214224
</main>
215225

print.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1540,6 +1540,8 @@ <h2 id="configuration-1"><a class="header" href="#configuration-1">Configuration
15401540
<span class="boring">}</span></code></pre></pre>
15411541
<div style="break-before: page; page-break-before: always;"></div><h1 id="valence-clearing-queue-library"><a class="header" href="#valence-clearing-queue-library">Valence Clearing Queue Library</a></h1>
15421542
<p>The <strong>Valence Clearing Queue</strong> library allows <strong>registration and settlement of withdrawal obligations</strong> in a FIFO (First-In-First-Out) manner. It maintains a queue of pending withdrawal obligations, with each obligation containing recipient information, payout amounts, and a unique identifier. When settling obligations, funds are pulled from a <strong>settlement input account</strong> and sent to the specified recipients.</p>
1543+
<p>The queue processes obligations based on a strict, monotonically increasing order of the obligation ids.
1544+
This is meant to prevent any out-of-order errors that may arise from latency or other issues.</p>
15431545
<blockquote>
15441546
<p><strong>Important:</strong>
15451547
This library functions solely as a settlement engine. The settlement account funding (liquidity-management) flow is outside of its scope and is managed by a strategist. This management process likely involves monitoring both the settlement account balance and the obligation queue in order to ensure the settlement account maintains sufficient liquidity for obligation settlements.</p>
@@ -1562,7 +1564,7 @@ <h2 id="high-level-flow-2"><a class="header" href="#high-level-flow-2">High-leve
15621564
</pre>
15631565
<h2 id="functions-2"><a class="header" href="#functions-2">Functions</a></h2>
15641566
<div class="table-wrapper"><table><thead><tr><th>Function</th><th>Parameters</th><th>Description</th></tr></thead><tbody>
1565-
<tr><td><strong>RegisterObligation</strong></td><td><code>recipient: String</code><br><code>payout_coins: Vec&lt;Coin&gt;</code><br><code>id: Uint64</code></td><td>Registers a new withdrawal obligation in the queue with the specified recipient, payout coins, and unique ID. Each obligation must have non-zero payout amounts. Recipient must be a valid bech32 address.</td></tr>
1567+
<tr><td><strong>RegisterObligation</strong></td><td><code>recipient: String</code><br><code>payout_amount: Uint128</code><br><code>id: Uint64</code></td><td>Registers a new withdrawal obligation in the queue with the specified recipient, payout coins, and unique ID. Each obligation must have a non-zero payout amount. Recipient must be a valid bech32 address. Obligation id must equal the latest registered obligation id plus 1.</td></tr>
15661568
<tr><td><strong>SettleNextObligation</strong></td><td>-</td><td>Settles the oldest withdrawal obligation in the queue by transferring funds from the <strong>settlement input account</strong> to the specified recipient. Fails if there are no pending obligations or if the input account has insufficient balance.</td></tr>
15671569
</tbody></table>
15681570
</div>
@@ -1574,9 +1576,17 @@ <h2 id="configuration-2"><a class="header" href="#configuration-2">Configuration
15741576
/// settlement input account which we tap into in order
15751577
/// to settle the obligations
15761578
pub settlement_acc_addr: LibraryAccountType,
1579+
/// obligation base denom
1580+
pub denom: String,
1581+
/// latest registered obligation id.
1582+
/// if `None`, defaults to 0
1583+
pub latest_id: Option&lt;Uint64&gt;,
15771584
}
15781585
<span class="boring">}</span></code></pre></pre>
15791586
<p>The <code>settlement_acc_addr</code> specifies the account from which funds will be pulled to fulfill settlement obligations. The library will check that this account has sufficient balance before attempting to settle each obligation.</p>
1587+
<p>Configured <code>denom</code> is the base clearing denomination which will be applied to all obligation amounts.</p>
1588+
<p>Lastly, the optional <code>latest_id</code> field allows to configure the library order to start from a specific id.
1589+
If <code>None</code>, latest id defaults to 0. Otherwise, it will start from the specified id.</p>
15801590
<div style="break-before: page; page-break-before: always;"></div><h1 id="valence-forwarder-library"><a class="header" href="#valence-forwarder-library">Valence Forwarder library</a></h1>
15811591
<p>The <strong>Valence Forwarder</strong> library allows to <strong>continuously forward funds</strong> from an <strong>input account</strong> to an <strong>output account</strong>, following some time <strong>constraints</strong>. It is typically used as part of a <strong>Valence Program</strong>. In that context, a <strong>Processor</strong> contract will be the main contract interacting with the Forwarder library.</p>
15821592
<h2 id="high-level-flow-3"><a class="header" href="#high-level-flow-3">High-level flow</a></h2>

searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)