Integrate via Smart Contracts
Integrating with Vertex via a Smart Contract
Smart contracts can use the LinkSigner
transaction type (see Link Signer) to perform the following:
Deposit into Vertex.
LinkSigner an externally owned account (EOA).
Have the externally owned account trade using the smart contract's assets on Vertex.
Setup: Depositing into Vertex + Linking an EOA
Deposits are always on-chain, as such, users can simply have their smart contract call depositCollateral on our
Endpoint
contract (see Contracts for addresses).The contract needs to have 1 USDC available to pay for slow-mode fee and approve the endpoint contract, assemble the bytes for a slow mode linked signer transaction, and submit it via submitSlowModeTransaction.
You can find the requisite parsing logic in the Endpoint contract.
Example
Once the transaction is confirmed, it may take a few seconds for it to make its way into the vertex offchain sequencer. Afterwards, you can sign transactions that have sender contractSubaccount
using externalSubaccount
, and they will be accepted by the sequencer and the blockchain.
Last updated