Can an ERC-3643 Token Cap Investor Deposits to an Exchange?
TimeExchangeLimitsModule is a T-REX compliance module for ERC-3643 tokens that caps how many tokens each investor identity can send to an exchange-tagged ONCHAINID per time window, with up to four windows per exchange. Each window is fixed and starts at the first counted deposit. Withdrawals, mints and transfers sent by token agents are not checked.
TL;DR — Key Takeaways
- ✓The rule: TimeExchangeLimitsModule caps what one investor identity can deposit to an exchange-tagged ONCHAINID per window, with up to four windows per exchange per token. A single transfer above any window's limit always fails.
- ✓The window: Each window is fixed, not rolling or calendar-based. It starts at the first counted deposit after the previous window ended and lasts limitTime seconds (code reading).
- ✓The keys: The module owner tags exchanges, and the tag list is shared by every token bound to that deployment. The compliance owner sets limits per token. Venue deposit wallets must be registered to the venue ONCHAINID in the token's Identity Registry.
- ✓The gaps: Withdrawals, mints and transfers sent from agent wallets are not checked. An agent forcedTransfer to an exchange skips the check but, in code reading, still adds to the investor's counter.
- ✓The variant: ExchangeMonthlyLimitsModule has one 30-day window per exchange and a default limit of zero, so a tagged exchange with no limit set rejects every deposit (code reading).

What does TimeExchangeLimitsModule check on a transfer?
It checks one case: an investor sending tokens to a wallet whose ONCHAINID is tagged as an exchange. That transfer fails if its value exceeds any of up to four limits, or if it would push the investor's running total in an active window above the limit.
Every transfer of an ERC-3643 token runs ModularCompliance.canTransfer, which calls moduleCheck on each bound module and fails on the first false. In TimeExchangeLimitsModule, moduleCheck returns early in three cases before any limit is read. The order matters, because a transfer that matches an early exit is never measured.
| Transfer | moduleCheck result | Added to a counter? |
|---|---|---|
Mint (_from is the zero address) | Passes | No; moduleMintAction is empty |
| Sender wallet is a token agent | Passes | No |
| Sender identity is a tagged exchange (a withdrawal) | Passes | No, unless the receiver is also a tagged exchange |
| Receiver identity is not a tagged exchange | Passes | No |
| Investor to tagged exchange, exchange has no limits set | Passes | No; there are no windows to count |
Investor to tagged exchange, value above any limitValue | Fails | n/a |
| Investor to tagged exchange, running total plus value above a limit in an active window | Fails | n/a |
| Investor to tagged exchange, within every limit | Passes | Yes, in every window |
The module is one of the per-token rules that sit inside the token contract. Where that layer stops and network-level controls start is covered in the guide to smart contract compliance versus Layer-0 governance for RWA. Everything in this article is read from the TokenySolutions/T-REX repository at commit f1390127. We have read the code; we have not executed its tests.
“This module enforces restrictions on the volume of tokens a holder can transfer to centralized exchanges (CEXs) within a specified timeframe. The timeframe is customizable, allowing issuers to set daily, weekly, monthly, or any custom period limits.”
Tokeny documentation, Time Based Exchange Limits Module
How does the module know a wallet belongs to an exchange?
It asks the token's Identity Registry for the ONCHAINID behind the receiving wallet, then checks that identity against a tag list set by the module owner. A venue deposit wallet that is not registered to the venue's tagged ONCHAINID is treated as an ordinary investor.
_getIdentity calls identityRegistry().identity(wallet) on the token bound to the compliance. So the tag is attached to an identity contract, and each wallet the venue uses for deposits must be registered in that token's Identity Registry and linked to the venue's ONCHAINID. If the venue registers a new deposit wallet under a different identity, deposits to it fall through the “receiver is not a tagged exchange” exit and are not limited. The listing checklist therefore has to cover every deposit wallet, not only the venue's legal entity. How venues connect to tokens after issuance is set out in where tokenized real-world assets trade after issuance.
Two keys split the configuration. addExchangeID and removeExchangeID are onlyOwner on the module, and the _exchangeIDs mapping is a plain address => bool, not keyed by compliance. The limits sit in mappings keyed by the calling compliance contract. One module deployment bound to five tokens therefore has one exchange list for all five and five separate sets of limits and counters. The module owner also authorises upgrades of the module itself, because _authorizeUpgrade in AbstractModuleUpgradeable is onlyOwner.
| Setting | Function | Who calls it | Scope |
|---|---|---|---|
| Exchange tag | addExchangeID / removeExchangeID | Module owner | Global to the module deployment |
| Exchange limits | setExchangeLimit(exchangeID, {limitTime, limitValue}) | Compliance owner, through callModuleFunction (onlyComplianceCall) | Per compliance, per exchange |
| Deposit wallet to identity link | registerIdentity on the Identity Registry | Registry agent | Per token registry (or shared storage) |
| Module code | UUPS upgrade | Module owner | Every bound token |
“ExchangeIDs are global and can be added/removed by the contract owner.”
Tokeny documentation, Time Based Exchange Limits Module, How Does It Work
How do the limits and time windows work?
Each limit is a pair: limitTime in seconds and limitValue in token units. A token can set up to four per exchange; a fifth distinct limitTime reverts with LimitsArraySizeExceeded. Each window is fixed and starts at the first deposit counted after the previous window ended.
setExchangeLimit looks up the limitTime. If that window length already exists for the exchange, the call overwrites its value in place. If it is new and four limits exist, it reverts. There is no function to delete a limit. A window length set by mistake keeps its slot; the closest available fix is to overwrite its value with a number large enough never to bind, which still uses one of the four slots. Overwriting a value does not reset the counter, so lowering a limit below what an investor has already deposited in the current window blocks that investor until the window ends.
The window logic sits in _resetExchangeLimitCooldown, called from moduleTransferAction after a counted transfer. If the stored timer is at or before block.timestamp, it sets the timer to block.timestamp + limitTime and the counter to zero, then adds the deposit. While the timer is in the future, moduleCheck adds the new value to the counter and compares. Once it has passed, moduleCheck only enforces the single-transfer cap. In code reading that makes each window a fixed block anchored on one investor's first deposit, not a rolling 24 hours and not a calendar day. The Tokeny documentation says counters “are reset when their period ends” but does not say which kind of period.
“if (_isExchangeCounterFinished(compliance, _exchangeID, _investorID, _limitTime)) { ... counter.timer = block.timestamp + _limitTime; counter.value = 0; }”
TimeExchangeLimitsModule.sol, _resetExchangeLimitCooldown, TokenySolutions/T-REX main @ f1390127
Illustrative example (invented numbers, not a real issuer). A token sets two limits for one venue: 1,000 tokens per 86,400 seconds (one day) and 5,000 tokens per 604,800 seconds (seven days). An investor deposits 800 at 10:00 on day 1, which starts both windows. A deposit of 300 at 18:00 fails, because 800 plus 300 exceeds 1,000. A deposit of 200 at 09:00 on day 2 passes, bringing the daily counter to 1,000. At 10:01 on day 2 the daily window has ended, so a deposit of 1,000 passes and starts a new daily window; the weekly counter reaches 2,000. In the 61 minutes from 09:00 to 10:01 the investor moved 1,200 tokens to the venue, which a rolling 24-hour rule would have refused. A single deposit of 1,200 fails at any time, because it is above the 1,000 daily limit on its own. Near a window boundary, up to twice the limit can arrive in a short span.
One edge case from code reading: a limit with limitTime of zero gives a timer equal to the current block time, which counts as finished at once. Such a limit acts only as a per-transfer cap, with no accumulation.
Whose deposits does the counter add up, and what does it miss?
The counter is keyed by token compliance, exchange identity, investor identity and window length, so all of an investor's wallets share one total per venue per token. It does not see withdrawals, mints, agent-wallet transfers, or trades on the venue's own ledger.
Because the key is the investor's ONCHAINID, splitting a deposit across three wallets of the same identity does not reset anything. The same identity has separate counters on each token, because the first key is the compliance contract, and separate counters on each tagged venue. Once tokens reach the venue, the module has no view of what happens next. Orders matched on the venue's internal book move no tokens on-chain, so the module limits how fast supply arrives at the venue, not how much of it trades.
Agent actions need a separate note. moduleCheck exempts a transfer whose sender wallet is a token agent, and moduleTransferAction skips counting it. A forcedTransfer is different: the agent signs the call, but the _from address is the investor's wallet. Token.sol runs forcedTransfer with an isVerified check on the receiver and never calls canTransfer, so the limit is not checked. It does call compliance.transferred, which runs moduleTransferAction, and the sender is not an agent, so in code reading the amount is added to the investor's counter. A forced transfer to a venue can therefore take the counter above the limit and block the investor's own deposits until the window ends. This is an operating detail to plan for, not a weakness in the token.
| Movement | Limit checked? | Counted? (code reading) |
|---|---|---|
| Investor wallet to venue deposit wallet | Yes | Yes, to the investor identity |
| Venue wallet to investor (withdrawal) | No | No |
| Agent-held wallet to venue | No | No |
Agent forcedTransfer from investor to venue | No; canTransfer is not called | Yes, to the investor identity |
| Mint directly to a venue wallet | No | No |
| Venue wallet to another tagged venue | No; sender is an exchange | Yes, to the sending venue's identity |
“if (isExchangeID(receiverIdentity) && !_isTokenAgent(msg.sender, _from)) { _increaseExchangeCounters(msg.sender, receiverIdentity, senderIdentity, _value); }”
TimeExchangeLimitsModule.sol, moduleTransferAction, TokenySolutions/T-REX main @ f1390127
How does ExchangeMonthlyLimitsModule differ?
ExchangeMonthlyLimitsModule stores one limit per exchange with a hard-coded 30-day window, anchored on the first counted deposit rather than the calendar month. Its default limit is zero, so in code reading a tagged exchange with no limit set rejects every deposit.
The transfer flow is the same: the same early exits for mints, agent senders, exchange senders and untagged receivers, and the same counting rule in moduleTransferAction. The differences are in storage and defaults. In moduleCheck, the line if (_value > _exchangeMonthlyLimit[_compliance][receiverIdentity]) return false; runs before any timer check. An unset limit reads as zero, so any deposit above zero fails. TimeExchangeLimitsModule loops over its limit array instead, and an empty array lets the deposit through. The two modules fail in opposite directions when an exchange is tagged before the token owner configures it.
| Property | TimeExchangeLimitsModule | ExchangeMonthlyLimitsModule |
|---|---|---|
| Limits per exchange per token | Up to 4, each with its own window length | 1 |
| Window length | Any uint32 number of seconds | 30 days, fixed in code |
| Window start | First counted deposit after the previous window ended (code reading) | |
| Tagged exchange with no limit set | Deposits pass | Deposits above zero fail (code reading) |
| Setter | setExchangeLimit | setExchangeMonthlyLimit |
| Counter getter | getExchangeCounter | getMonthlyCounter, getMonthlyTimer |
| Exchange tag list | Global to each module deployment, owner-only; the two modules keep separate lists | |
“Similar to the Time-Based Exchange Limits module, but with a fixed monthly timeframe. This optimization simplifies the module's logic, offering a gas-efficient solution for monthly transfer volume restrictions to CEXs.”
Tokeny documentation, Exchange Monthly Limits Module
“Monthly” here means 30 days, the 30 days constant in _resetExchangeMonthlyCooldown of ExchangeMonthlyLimitsModule.sol. A disclosure that promises a calendar-month cap would not match the contract.
Can you add the module to a token that already trades?
Yes. Both exchange modules return true from isPlugAndPlay and canComplianceBind, so ModularCompliance.addModule binds them to a live token without presets. Every investor starts with an empty counter, and deposits made before binding are not counted.
The module stores only counters it builds itself from deposits after binding, so it needs no snapshot of balances. That is the opposite of the MaxBalanceModule, which refuses to bind to a token with holders until the compliance owner writes every identity's balance into its ledger. The practical risk at go-live is ordering, not data. With TimeExchangeLimitsModule, tagging the venue before limits are set leaves deposits unlimited for that gap. With ExchangeMonthlyLimitsModule, the same order blocks deposits for that gap. Setting the limit first, then tagging, avoids both, because limits are keyed by exchange identity and can be written before the tag exists.
Neither module is a holding period. They limit the rate at which an identity sends tokens to a venue, not the date a lot of securities may first be resold, a distinction worked through in whether a token lock can enforce the Rule 144 holding period. The same T-REX folder also holds TimeTransfersLimitsModule, which limits what an identity sends to anyone per window; this article covers only the exchange-specific modules.
What should a venue listing runbook include?
Six steps: identify the venue ONCHAINID, register every deposit wallet to it, set limits per token, tag the identity, publish the windows in the disclosure, and monitor counters per investor. The module enforces only the third and fourth.
| Step | What to do | Evidence to keep |
|---|---|---|
| Venue identity | Agree with the venue which ONCHAINID represents it for this token | Identity address and the venue's confirmation |
| Deposit wallets | Register each deposit wallet to that ONCHAINID in the token's Identity Registry; add a step for wallets the venue creates later | Wallet list, identity() read-back for each |
| Limits | Call setExchangeLimit through callModuleFunction for each window; choose window lengths carefully, since slots cannot be removed | ExchangeLimitUpdated events, getExchangeLimits output |
| Tag | Module owner calls addExchangeID; confirm which other tokens share the deployment and its tag list | ExchangeIDAdded event, list of bound compliances |
| Disclosure | State each window as a fixed period from the investor's first deposit, and that withdrawals and on-venue trades are not limited | Disclosure text and version |
| Monitoring | Read getExchangeCounter per investor identity; log forced transfers to the venue separately, since they add to counters | Counter snapshots and agent action log |
Typical uses, as analysis rather than observed deployments: releasing float to a venue in stages after listing, keeping one holder from moving a large position onto a venue in a single day, or giving the venue a predictable inflow while it runs its own surveillance. Volume or market-conduct duties that a venue carries under its licence stay with the venue; the token module does not discharge them.
Who is this for, and what was not checked?
It is for issuers and transfer agents running T-REX modular compliance who list a token on a venue with on-chain deposit wallets. It is not a fit for venues that settle every trade on-chain between investor wallets, since there is no deposit to limit.
All behaviour above is read from TimeExchangeLimitsModule.sol, ExchangeMonthlyLimitsModule.sol, ModularCompliance.sol and Token.sol in the TokenySolutions/T-REX repository at commit f1390127 on main. That repository is archived. Its successor, ERC-3643/ERC-3643 (main at commit 2f0704de), ships only AbstractModule, AbstractModuleUpgradeable, IModule, ModuleProxy and TestModule in its modular modules folder, so neither exchange module is there. Both module files carry a Creative Commons Attribution-NonCommercial 4.0 licence on top of GPL-3.0, which matters for teams copying them. The ERC-3643 documentation on modular compliance add-ons lists the T-REX module set.
We did not run the test suite, so the fixed-window behaviour, the zero default in the monthly module and the counting of forced transfers are code reading. We did not check which tokens or venues use either module in production, or which module versions they run.
Sources: TimeExchangeLimitsModule.sol, ExchangeMonthlyLimitsModule.sol, AbstractModuleUpgradeable.sol, ModularCompliance.sol and Token.sol, all TokenySolutions/T-REX main @ f1390127 (repository archived); ERC-3643/ERC-3643 contracts @ 2f0704de; Tokeny documentation for the Time Based Exchange Limits Module and the Exchange Monthly Limits Module; ERC-3643 modular compliance add-ons.
Frequently Asked Questions
What does the ERC-3643 TimeExchangeLimitsModule restrict?
It caps the value one investor identity can transfer to a wallet whose ONCHAINID is tagged as an exchange, per time window. Up to four windows can be set per exchange, each with a length in seconds and a maximum value. It does not restrict withdrawals from the exchange, mints, transfers sent by token agents, or trading on the venue's internal ledger. It limits the rate of deposits only.
Is the TimeExchangeLimitsModule window rolling or calendar-based?
Neither. In code reading, the window is fixed and anchored on the first counted deposit. When a deposit arrives after the previous window has ended, the module sets the timer to block.timestamp plus the window length and resets the counter to zero. Deposits are then summed until that timer passes. A daily limit is 86,400 seconds from the first deposit, not midnight to midnight.
Who can tag a wallet as an exchange in TimeExchangeLimitsModule?
The owner of the module contract, through addExchangeID and removeExchangeID. The tag applies to an ONCHAINID, not a wallet, and the tag list is global to the module deployment: every token whose compliance binds that deployment sees the same exchanges. The limits are different. They are stored per compliance contract and set by the compliance owner through callModuleFunction.
Can an investor avoid the limit by using several wallets?
Not by using several wallets linked to one ONCHAINID. The counter is keyed by the investor's identity, read from the token's Identity Registry, so all wallets registered to that identity share one counter per exchange and window. An investor with two separate verified identities would have two counters, which is a KYC question rather than a module setting.
How is ExchangeMonthlyLimitsModule different?
It allows one limit per exchange with a fixed 30-day window, also anchored on the first counted deposit rather than the calendar month. In code reading, its default limit is zero, so once an exchange is tagged every deposit of more than zero tokens to it fails until the compliance owner sets a limit. TimeExchangeLimitsModule with no limit set lets deposits through.
Can TimeExchangeLimitsModule be added to a token that already trades?
Yes. isPlugAndPlay and canComplianceBind both return true, so ModularCompliance can add it to a live token without presetting any state. Counters start at zero for every investor at binding, so past deposits are not counted. This differs from modules such as MaxBalanceModule, which need a preset ledger before they bind to a token with holders.
Related Articles
How Digital Asset Exchange Operators Ensure Compliant RWA Listings & Secondary Trading with Blockmaze
The checks a trading venue runs before and after it admits a tokenized real-world asset, and why token transfer rules must match the venue's own.
Who Really Controls an ERC-3643 Token's Agent Keys?
ERC-3643 agent keys control privileged functions that can move or freeze holdings, yet the standard requires no multisig or timelock for them.
What Happens When an ERC-3643 Investor Changes Country?
In T-REX the investor country is a per-wallet code an agent sets with updateCountry, not a KYC claim, and the country modules read only the receiver.
Who Can Upgrade an ERC-3643 Token's Code?
Who holds the upgrade path for an ERC-3643 token suite, and what governance that key needs.