Create account
Create account

Arcadia · Acts onchain

Opens an Arcadia Account, a smart account its owner deposits assets into and, for a Margin account, borrows against. The Factory deploys the account and mints its ERC-721 to the sender, who owns it; createAccount returns the account. A Spot account takes any token or liquidity position and borrows nothing. A Margin account is opened against one lending pool, which is its creditor: it takes only the assets Arcadia's Registry prices and the pool accepts, borrows that pool's asset against them, and refuses any withdrawal that would leave it unhealthy. The account's address comes from CREATE2 over a salt read when the creation runs, the low bits of the sender's address's hash plus the Factory's count of every account it has deployed mixed with the parent block's hash, joined to the low 32 bits of the transaction's origin. The count only grows, so an account the sender made and handed away never gives its salt back, and nobody can take the salt ahead of the creation: deploying an account to occupy it moves the count the creation reads. A collision with an account already deployed reverts and touches no account, and the next block's hash moves the salt for the next attempt. Standing as a program's only write, the wallet sends it itself and owns the account; composed with other writes it runs in the Plug account's program, which then owns the account and works it in every later program. Reach for it to open an account and deposit into it in the same run, coiling the account into the deposit, the borrow, or a stored record of the account.