V3 Technical Docs
  • Deployed Contracts
    • Notional V3
      • Ethereum Mainnet
      • Arbitrum
  • Security
    • Audits
    • Bug Bounty
  • Currency Ids & Precision
    • Currency Ids
    • Market Indexes
    • Notional Internal Precision
  • Contract interaction guides
    • Intro
    • Trading guide
      • Deposit (Prime Lend)
      • Trade fCash (Borrow & Lend Fixed)
      • Add liquidity (Mint nTokens)
      • Withdraw liquidity (Redeem nTokens)
      • Withdraw (Prime Cash)
      • Settle Account
      • Enter Leveraged Vaults
      • Exit Leveraged Vaults
    • Accounts
    • Prime Cash Markets
    • fCash Markets
    • nTokens
    • Leveraged Vaults
    • Oracles
    • Governance parameters
  • Subgraph guides
    • Notional V3 Subgraphs
      • Fetch Notional Accounts
      • Fetch Notional's reserves
      • Fetch Notional nToken accounts
      • Fetch Historical Trades
      • Fetch an Account's P&L
      • Fetch current fCash and Prime Cash Rates
      • Fetch Historical Prime Cash & Prime Debt Exchange Rates
      • Fetch Prime Cash Market Balances
      • Fetch fCash Market Balances
      • Fetch Outstanding Debt
      • Fetch Historical nToken Exchange Rates
      • Fetch ETH Oracle Exchange Rates
      • Fetch Annual Incentive Rates
      • Fetch Interest Rate Models
      • Fetch Governance Parameters
  • Dune Dashboard
  • Notional Risk Docs
  • Notional V3 Docs
  • Notional Blog
Powered by GitBook
On this page
  • Contract Github repository
  • Setup
  • Contract approval
  1. Contract interaction guides

Intro

PreviousNotional Internal PrecisionNextTrading guide

Last updated 5 months ago

This section will cover how to interact with Notional V3 contracts using a Python-based development and testing framework.

Contract Github repository

Notional's V3 smart contracts repository can be found .

Setup

Here is a simple setup to start interacting with Notional V3 using ETH brownie:

import json
from brownie import (
    accounts, 
    interface
)
from brownie.network.state import Chain
import eth_abi

class V3Environment:
    def __init__(self):
        self.notional = interface.NotionalProxy("0x1344A36A1B56144C3Bc62E7757377D288fDE0369")
        self.owner = self.notional.owner()

def main():
    env = V3Environment()
    env.chain = Chain()
    env.notional.address

Contract approval

To interact with the protocol using ERC-20 tokens, accounts must approve Notional's Proxy.

# Approve sending an unlimited amount of DAI to the Notional Proxy.
interface.ERC20(currencyAddress).approve(notional.address, 2**255, {'from': account}) 
ETH brownie
here