Synthetix Docs
  • User Docs
  • Synthetix Exchange
  • Leveraged Tokens
  • For Developers
  • Orientation
  • Synthetix Overview
  • Development Progress
  • V3 FAQ
  • For Developers
    • Technical Architecture
    • Quick Start
      • Base Quickstart
    • Smart Contracts
    • Data Platform
    • Data Dictionary
    • Addresses + ABIs
    • Deployment Info
      • Mainnet
      • Sepolia
      • Sepolia Carina
      • Optimism Mainnet
      • Base Mainnet Andromeda
      • Base Sepolia Andromeda
      • Arbitrum Mainnet
      • Arbitrum Sepolia
    • Smart Contract Audits
    • Perps Market
    • Spot Market
    • Developer FAQ
  • For Perp Integrators
    • 101
    • Perps V3
    • L1 Perp (BFP)
    • Base Andromeda
    • Perps Python SDK
    • Perps V3 Keepers
  • For Liquidity Integrators
    • Creating Accounts
    • Delegating Collateral
      • Liquidity Pools
    • Liquidity Positions
      • Minting and Burning snxUSD
      • Position Liquidations
    • Base LP Guide
  • For Liquidity Pool Managers
    • Creating and Configuring Pools and Vaults
    • Collateral Vaults
      • Vault Liquidations
    • Rewards Distributors
    • Credit and Debt Distribution
  • For Derivatives Market Builders
    • Build on v3
    • Market Development Guide
    • Build on v3 FAQ
    • Operating a Market
    • Registering a Market
  • For Governance Participants
    • Synthetix Governance
    • Elections
  • For Designers
    • Design Resources
Powered by GitBook
On this page
  • Introduction
  • Configuration
  • For LP Integrators
  • For Perp Integrators
  • Preparing Margin Transactions
  • Useful links
  1. For Perp Integrators

Base Andromeda

Reference for Core V3 + Perps V3 on Base

PreviousL1 Perp (BFP)NextPerps Python SDK

Last updated 9 months ago

Evolving configuration

  • See Deployment Info

Introduction

Andromeda is the combination of

  • Core V3

  • Perps V3

  • USDC as collateral

The Spot Market is included, but only to be used as a mechanism to exchange the assets brought by traders and LPs (USDC) for the internal accounting tokens (sUSDC and sUSD).

Configuration

  • Unique to Andromeda Base is the use of a USDC wrapper, enabling USDC to appear to be used as collateral for LPs, and as margin as perp traders.

  • Underneath, USDC is wrapped and or traded into sUSDC for LP collateral (and collecting fees), and sUSD as perp margin

  • The full configuration of Base Goerli can be seen

  • See for Addresses and ABIs

  • Configuration explained:

    • that deploys sUSDC (a USDC synth) and creates the spot market

    • USDC <--> sUSDC can be wrapped/unwrapped on the spot market

    • sUSD <--> sUSDC can be bought/sold on the spot market

    • No fee on these, all atomic so can be composed with multicalls

  • Coming: Andromeda Base Sandbox, but in the meant time see Cannon config

For LP Integrators

LPs can arrive with USDC to provide liquidity (LP). The contracts or integrators need to:

  1. Wrap USDC to sUSDC on the Spot Market

    1. Function: SpotMarketProxy.wrap(marketId, wrapAmount, amountReceived)

    2. Example: wrap(1, 1000000000000000000, 1000000000000000000)

  2. Deposit sUSDC to Pool

  3. Delegate sUSDC to Market

When withdrawing, initial collateral plus any fees can be withdrawn, then unwrapped from sUSDC to USDC.

For Perp Integrators

Integrators can create a seamless trading experience using USDC by utilizing the wrapper and spot market. Since USDC-sUSDC and sUSDC-sUSD exchanges are both 1:1 swaps, integrators can easily prepare a multicall to "zap" between USDC in their wallet and their account margin.

Preparing Margin Transactions

Integrators can directly deposit and withdraw USDC by preparing a multicall to execute in a single transaction. These transactions interact with the SpotMarketProxy to wrap and swap USDC for sUSD. Use marketId = 1 for sUSDC. Matching values like wrapAmount and amountReceived in the transactions will guarantee this 1:1 swap.

All transactions should be prepared as a multicall and sent to the TrustedMulticallForwarder contracts using aggregate3Value.

Prerequisites

An account must meet the following requirements to execute USDC transfers between their wallet and a perps account.

Deposit:

  • Approve SpotMarketProxy to transfer USDC

  • Approve SpotMarketProxy to transfer sUSDC

  • Approve PerpsMarketProxy to transfer sUSD

Withdraw:

  • Account NFT has some withdrawable margin

  • Approve SpotMarketProxy to transfer sUSD

  • Approve SpotMarketProxy to transfer sUSDC

Deposit perp margin

  1. USDC -> sUSDC - Wrap USDC on the spot market

    1. Function: SpotMarketProxy.wrap(marketId, wrapAmount, amountReceived)

    2. Example: wrap(1, 1000000000000000000, 1000000000000000000)

  2. sUSDC -> sUSD - Sell sUSDC for sUSD on the spot market

    1. Function: SpotMarketProxy.sell(marketId, synthAmount, minUsdAmount, referrer)

    2. Example: sell(1, 1000000000000000000, 1000000000000000000, 0x0000000000000000000000000000000000000000)

  3. Deposit sUSD

    1. Function: PerpsMarketProxy.modifyCollateral(accountId, synthMarketId, amountDelta)

    2. Example: modifyCollateral(12345, 0, 1000000000000000000)

Withdraw perp margin

  1. Withdraw sUSD

    1. Function: PerpsMarketProxy.modifyCollateral(accountId, synthMarketId, amountDelta)

    2. Example: modifyCollateral(12345, 0, -1000000000000000000)

  2. sUSD -> sUSDC - Buy sUSDC on the spot market

    1. Function: SpotMarketProxy.buy(marketId, usdAmount, minAmountReceived, referrer)

    2. Example: buy(1, 1000000000000000000, 1000000000000000000, 0x0000000000000000000000000000000000000000)

  3. sUSDC -> USDC - Unwrap sUSDC on the spot market

    1. Function: SpotMarketProxy.unwrap(marketId, unwrapAmount, minAmountReceived)

    2. Example: unwrap(1, 1000000000000000000, 1000000000000000000)

Sample Margin Transactions

Useful links

  • Perp order settlement and liquidation keepers are running on Goerli, and you can run your own Perps V3 Keepers

The Andromeda Release is configured to use oracle contracts which comply with . Use when building off-chain integrations like UIs and bots.

Holds an account NFT for perps. See .

ERC-7412
the client library
Deposit
Withdraw
Base Goerli keeper for order settlement and liquidation
Base Goerli Perp trades
on Cannon
this is the part
Cannon | Package
Base Goerli Andromeda
Logo
#andromeda-on-base-goerli
creating an account