Automate Treasury top-ups
This guide explains how to integrate with the Smart Treasury APIs to automate top-ups, configure thresholds, and monitor liquidity.
The Smart Treasury feature automates liquidity top-ups based on configurable thresholds and AI-powered forecasts derived from your treasury history. This helps ensure your Layer1 Wallet always maintains sufficient balance to support trading and withdrawals—even during periods of volatility or high activity.
This guide will walk you through how to integrate with the Layer1 Treasury API to:
- Monitor and manage your wallet balances
- Set up automatic top-ups using pre-defined rules
- Leverage forecasting to anticipate and prevent liquidity shortfalls

Use Cases: When and How Smart Treasury Triggers Top-Ups
The Smart Treasury system helps ensure your Layer1 Wallet always has sufficient liquidity by monitoring multiple inputs and automatically triggering top-ups when needed. It supports the following use cases, which can be enabled individually or in combination:
- Minimum Threshold Enforcement
Automatically top up assets that fall below a configured minimum balance. This rule ensures you always maintain a baseline level of liquidity to meet expected trading and withdrawal demand.
Example: You set a 50 USDC minimum on a specific wallet. If the balance drops to 50, the system initiates a top-up. - ML-Powered Forecasting
The treasury system uses historical transaction data to forecast future needs and proactively top up balances before they drop. This is especially useful during periods of high volatility or when preparing for known events (e.g. campaigns or market shifts).
Example: Based on past weekly activity, the system predicts a spike in ETH withdrawals and initiates a top-up ahead of time. - Incoming Withdrawal Coverage
If a new withdrawal request exceeds the available balance, the system will automatically move the transaction to FUNDS_NEEDED and trigger a top-up to fulfill it—eliminating the need for manual intervention.
Example: A user requests a 10 BTC withdrawal, but your wallet only has 8 BTC. The system detects the shortfall and initiates a top-up to fulfil the withdrawal (+2 BTC) and restore the post-withdrawal balance to the target balance (+8 BTC). - Gas Fee Management
The system can monitor wallets you use to fund gas fees (e.g., ETH for ERC-20 tokens or MATIC for Polygon) and trigger top-ups to ensure sufficient funds for transaction fees.
Example: Your operational wallet runs low on ETH needed to process ERC-20 withdrawals. The system identifies the deficit and triggers a gas fee top-up.
These use cases work together seamlessly and combing them gives you the most resilient liquidity strategy.
Prerequisites
Before integrating Smart Treasury features, ensure your API key has the treasury:admin
role.
To check your roles and permissions, in Layer1 Portal, go to Settings > Profile > Roles and Permissions.
Key concepts
Term | Description |
---|---|
Managed Balance | A wallet configured with liquidity thresholds and optional forecasting/monitoring |
Thresholds | Rules that trigger notifications or top-ups (min, warning, target, buffer) |
Eligible Source | A liquidity provider (for example Kraken, Binance) that can fund top-ups or another asset pool |
Balance Adjustment | A manual or automated top-up |
Buffer Factor | Safety margin preventing cascading liquidity issues |
Forecasting | Predictive system based on historical data to maintain sufficient balance |
Updated 3 days ago