Two contracts share the EVM side. ApsisInventory is the vault: it holds all float, receives plain deposits, and is the only contract that pays value out. ApsisRouter carries every entry point that swaps or takes a signature — aggregator deposits, permit and permit2 variants, gasless witness deposits, same-chain swaps, partner funding — and forwards the resulting funds into the inventory. The router is UUPS-upgradeable by the owner; the inventory is not upgradeable. Solana is covered separately in SVM program. Prefer the router_address from the quote over these constants. A plain cross-chain deposit binds to the inventory, a swap deposit is sent to the router returned by GetSwapInstructions, and a same-chain swap binds to the router.

Inventory deposit entry points

Both emit Deposit and leave the funds in the vault.

Router deposit entry points

depositWithSwapAndPermit and depositWithSwapAndPermit2 take the same arguments plus the respective signature parameters. Permit variants attempt the permit and ignore its failure, so an already-consumed permit does not revert the deposit. Token pulls credit what was actually received, so fee-on-transfer amounts are accounted at the vault, not assumed. Two witness variants back gasless orders: depositTokenWithPermit2Witness and depositWithSwapAndPermit2Witness take an owner plus a permit2 SignatureTransfer witness signature binding the quote hash (and, for swaps, the bridge token and floor), so an operator wallet can submit the deposit on the signer’s behalf. They are called by the operator’s relayer, not by integrators.

Same-chain swap

Swaps and pays the recipient in one transaction, on the router. Delivery is floored at minAmountOut and capped at amountOut; the referrer share and any surplus are forwarded to the vault. swapAndForwardWithPermit and swapAndForwardWithPermit2 add the signature parameters. See Same-chain swaps.

Partner funding

Deposits an allowlisted funding token against a funding id issued by BuildPartnerFunding, emitting PartnerFunding. The indexer credits the partner’s balance from the event. See PartnerApi funding.

Voucher redemption

On the inventory, callable by anyone. The EIP-712 signature is verified against the current voucher-signer set, the id is marked used so it cannot be redeemed twice, and the amount is paid to referrer from the vault. See Referral program.

Operator functions

Restricted to the owner or registered executors, listed for completeness.

Events

The indexer matches Deposit and SameChainSwap against stored quotes by quoteHash.

Reverts