Skip to main content
The Teller contract is an audited smart contract that handles USYC subscriptions and redemptions. It is implemented with Solidity and you can interact with it using Solidity, TypeScript, or any other programming language that supports Ethereum smart contracts.
This quickstart uses testnet addresses. For mainnet addresses, see USYC Contract Addresses.
The following example shows you how to call the Teller contract to subscribe to and redeem USYC:
import "../IERC20.sol";

interface ITeller {
  function deposit(uint256 _assets, address _receiver) external returns (uint256);
  function redeem(uint256 _shares, address _receiver, address _account) external returns (uint256);
}

ITeller teller = ITeller(0x96424C885951ceb4B79fecb934eD857999e6f82B);

// Subscribe to USYC
IERC20 usdc = IERC20(0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238);
uint256 usdcAmount = 100 * 1e6; // 100.000000 USDC
address usycReceiver = address(this); // Address to receive USYC
usdc.approve(address(teller), usdcAmount);
uint256 usycPurchased = teller.deposit(usdcAmount, usycReceiver);

// Redeem USYC
IERC20 usyc = IERC20(0x38D3A3f8717F4DB1CcB4Ad7D8C755919440848A3);
uint256 usycAmount = 100 * 1e6; // 100.000000 USYC
address usdcReceiver = address(this); // Address to receive USDC
address usycAccount = address(this); // Address that holds USYC
uint256 usdcPayout = teller.redeem(usycAmount, usdcReceiver, usycAccount);