Tango vaults
Rate limits
How a Tango vault limits how fast money can move into sub-accounts, through swaps and into money markets, and who can raise or lower each limit.
A rate limit caps how much money can move along one path in a vault over a period of time. Tango vaults use them so that even a key with permission to act, such as the one your agents use, cannot move a strategy's whole balance at once. Each limit works like a bucket that refills: every move takes from it, it fills back up at a set rate, and a move larger than what is left is refused.
Key points
- Rate limits cover USDC sent into sub-accounts, swaps, and supplies to money markets. Each has its own bucket for each sub-account, and for each asset or venue.
- Every bucket has two settings, a capacity and a refill rate. Swaps have one bucket for each direction of each asset.
- Some moves are never limited: withdrawing from a money market, and bringing USDC back to the vault. Deposits and withdrawals have no rate limit.
- Raising a limit is a High-tier change. Lowering a limit, or closing it to zero, takes effect at once. On tango.finance you change them from the Advanced tab.
How a bucket works
Each bucket has two settings:
- its capacity, which is the most that can move before the bucket has to refill;
- its refill rate, which is how much room comes back each second.
Say a bucket has a capacity of 100 and refills completely over a day. If a swap uses 60, there are 40 left, and room comes back steadily until the bucket is full again. A swap of 50 straight after the first one would be refused, and the whole swap would revert.
Because a full bucket can be emptied and then used again as it refills, up to twice the capacity can pass through in the time the bucket takes to refill. That is the most a limit ever allows.
Every bucket starts at zero, which refuses everything until a limit is set. A bucket can also be set to unlimited, which turns it off. An unlimited bucket must have a refill rate of zero.
What can be limited
| Path | One bucket for each | What uses it up | What is never limited |
|---|---|---|---|
| Sending USDC from the vault to a sub-account | Sub-account | Each amount sent | Bringing USDC back from the sub-account to the vault |
| Swaps | Sub-account and asset, one bucket for each direction | What actually left and arrived, measured after the swap | Nothing in a swap is exempt |
| Money markets | Sub-account and venue | Each amount of the vault's asset supplied to the venue | Withdrawing from the venue |
Swaps are charged from the amounts that actually moved, not the amounts asked for. A swap that spends less than its maximum only uses up what it spent.
A swap uses two buckets at once. Swapping USDC for cbBTC takes from the USDC outbound bucket and the cbBTC inbound bucket. Swapping cbBTC back into USDC takes from the cbBTC outbound bucket and the USDC inbound bucket. Both must have room, or the swap reverts.
Because each direction has its own bucket, a vault can give moves towards cash, such as selling an asset back into USDC, more room than moves that add exposure, such as buying an asset. Moves towards cash are the ones needed to pay a withdrawal or to leave a position.
Withdrawals from a money market are never limited, so a strategy can always leave a venue. If a venue goes bad, its supply bucket can be lowered to zero, which stops new supplies while withdrawals keep working.
The reported value of an attested sub-account has a limit of its own. A new value can only move within its deviation band in each window, which caps how fast that account's value can change.
Deposits and withdrawals
Deposits and withdrawals have no rate limit. Other settings bound them instead:
- The deposit cap limits the total a vault accepts, after withdrawals.
- The settlement batch size limits how many requests can be settled in one transaction.
- The minimum deposit and minimum withdrawal set the smallest request the vault accepts.
The levers
| Setting | Set for each | To raise it | To lower it |
|---|---|---|---|
| Bucket capacity | Bucket | VaultAdmin, High tier | Sentry or VaultAdmin, immediately |
| Bucket refill rate | Bucket | VaultAdmin, High tier | Sentry or VaultAdmin, immediately |
| Allocation cap, the most USDC a sub-account can hold from the vault | Sub-account | VaultAdmin, High tier, never above a ceiling fixed at deployment | Sentry or VaultAdmin, immediately |
| Deposit cap | Vault | VaultAdmin, High tier, never above a ceiling fixed at deployment | VaultManager, Sentry or VaultAdmin, immediately |
| Settlement batch size | Vault | Fixed at deployment | Fixed at deployment |
| Minimum deposit and withdrawal | Vault | Fixed at deployment | Fixed at deployment |
Closing a bucket to zero is the quickest way to stop one path, such as new supplies to a money market, while everything else keeps working.
See Timelocks for how long the High tier waits on your strategy, and Roles and profiles for who holds each role.
On tango.finance
Tango sizes every bucket when your strategy is deployed, from the assets and money markets you keep on Review. Your wallet is the VaultAdmin, and a tango.finance vault has no Sentry, so you are the only one who can raise or lower a limit. Agents use the buckets but cannot change them.
The Advanced tab lists every bucket on your strategy:
| Limit | What it meters |
|---|---|
| Cash In | USDC sent from the vault into one of the strategy's accounts |
| Buy | An asset arriving in the Strategy account from a swap |
| Sell | An asset leaving the Strategy account in a swap |
| Lend | USDC supplied to one money market |
Each row shows its Capacity, its Refill per Day and what is Available Now. Choose a row to set a new capacity and refill, or to make it Unlimited. Lowering takes effect once you sign. Raising waits your strategy's High timelock, if it has one, and then asks you to sign again. See Timelocks, roles and limits in the app.
When a bucket has no room left, a move that needs it cannot run until the bucket refills. A Close or a Withdraw waits for that room rather than failing.