Onchain Summer

Welcome to the Onchain Summer builder's guide for Synthetix. We've provided some extra resources to help builders on Base get started building on the Synthetix contracts.

Most of the resources you need will already be available here in the Synthetix V3 Developers Docs. You can navigate to the relevant sections in the left-hand nav menu to explore more. For reference, Andromeda refers to the Synthetix V3 deployment on Base.

  • If you'd like to build an integration with Synthetix Perpetual Futures markets on Base, check out: Base Andromeda

  • If you'd like to build new derivatives markets on Synthetix's Base deployment, check out: Build on v3

  • If you'd like to build integrations for liquidity providers, checkout: Creating Accounts

If you can't find what you need please join us in the Synthetix discord server and ask your question in the #onchain-summer channel to talk with someone on our developer support team.

Overview

Synthetix V3 consists of multiple systems, deployed via an omnibus on Base.

  • Synthetix's core system holds collateral and manages liquidity provisioning for the deployment. It issues an account NFT to liquidity providers and a stablecoin used by traders.

  • There is a spot market used to wrap USDC into synthetic USDC (for LPs) and this can be "sold" into the stablecoin. All of these exchanges happen 1:1. Additional types of collateral may be introduced in the future.

  • All of the systems integrate with the oracle manager to assess the value of collateral and derivatives.

Building Apps/Front-ends

To start a local node with running with the same configuration as the Base deployment and retrieve the addresses/ABIs:

npm i -g @usecannon/cli
cannon inspect synthetix-omnibus@andromeda --write-deployments ./deployment
cannon synthetix-omnibus@andromeda

Building Bots/Scripts

💡 Ideas

  • Execute trading strategies similar to the funding rate arbitrage bot. Consider simplified strategies like price triggers, or triggers based on market conditions.

  • Automate functions around the contracts similar to the sample liquidation or order keepers.

  • Build Telegram or Discord bots for tracking market conditions, traders, and market activity.

  • Build a command line interface for the SDK, improving the user experience.

For Python Developers

If you are interested in building bots or scripts using the Python SDK, check out the playground or read the docs.

For JavaScript/TypeScript Developers

You can retrieve the addresses and ABIs for the Synthetix deployment on Base and call functions using viem as follows:

import { createPublicClient, http } from 'viem';
import { base } from 'viem/chains';
import { getCannonContract, traceActions } from '@usecannon/builder';

async function getCollateralConfigurations(){
    // Retrieve deployment data
    const CoreProxy = await getCannonContract({
        package: 'synthetix-omnibus@andromeda',
        chainId: base.id,
        contractName: 'CoreProxy',
    });
    
    // Create a client with the ability to decode errors from the CoreProxy
    const publicClient = createPublicClient({ 
        chain: base,
        transport: http()
      }).extend(traceActions(CoreProxy));

    // Call a smart contract function and log the result
    const result = await publicClient.readContract({
        ...CoreProxy,
        functionName: 'getCollateralConfigurations',
        args: [false],
    })
    console.log(result);
}

getCollateralConfigurations();

Building Protocols/Smart Contracts

To build a protocol or smart contract that integrates with Synthetix V3, we recommend forking an existing sandbox for Synthetix: https://github.com/Synthetixio/synthetix-deployments/tree/main/sandboxes

Last updated