teeter finance
  • Introduction
  • GETTING STARTED
    • Problems teeter solved
    • How to earn money on teeter
    • Market of teeter
    • Fees
    • Risk
  • Fundamentals
    • Overall mechanism
    • Pricing model and leverage
    • Rebalancing mechanism
    • Implementation
  • DEVELOPER
    • teeter Contract
  • Tutorials
    • Wallet Setup
    • Testnet
    • Prime and Creative Market
    • Purchase bToken
    • Sell bToken
    • Purchase xToken
    • Sell xToken
    • Holdings
Powered by GitBook
On this page
  • Contract address
  • Kovan
  • Create a liquidity pool or add liquidity
  • Remove Liquidity
  • Query the details of a liquidity pool
  1. DEVELOPER

teeter Contract

For all of those under-the-hood details, read on

Contract address

Kovan

FACTORY

0xD8e39D7D6297f239E800890C5c3CeB9B1d4A9e75

FrontDesk01

0x4Bf60aFFdB8E4fa92a983002fbE890030e7396De

USDT (for teeter in Kovan)

0xe538Eada62aC2466CA10CD0f1F73Cf829c84daC5

WETH9

0x021861cC8d0Ad95C1C7E8BA77517bA9344e9a64F

Get teeter's USDT on Kovan:

You can use Kovan's test ETH to do traders in uniswap:

  • Uniswap ETH / USDT contract address on Kovan: 0xEc835EadAb771EC73Ac57a217d8b398e43E0FdD4

  • USDT on Kovan: 0xe538Eada62aC2466CA10CD0f1F73Cf829c84daC5

Create a liquidity pool or add liquidity

function deposit(
        address token0, uint8 initLever, uint8 direction, uint256 amtToken0, address to, uint128 deadline
        ) external ensure(deadline) returns(uint256 liquidity)

Input parameters

Name
Required
Type
Description

token0

Yes

address

The address of the underlying token

initLever

Yes

uint8

3

direction

Yes

uint8

0 for short ;1 for long

amtToken0

Yes

uint256

The number to add liquidity in underlying

to

Yes

address

The address to receive the LP token

deadline

Yes

uint128

The time limit, in seconds;

If the transaction is not completed over time, it is rolled back

Output parameters

Name
Type
Description

liquidity

uint256

Number of LP Tokens sent

Remove Liquidity

FrontDesk01.recycle()

function recycle(
        uint256 amtliquIn, address token0, uint8 initLever, uint8 direction, address to, uint256 deadline
        )external ensure(deadline) returns (uint256 amtToken0, uint256 amtU)

Input parameters

Name
Required
Type
Description

amtliquIn

Y

uint256

Number of LP tokens to remove

token0

Y

address

The token address of the underlying asset of the pool

initLever

Y

uint8

The initial leverage multiple of the pool

direction

Y

uint8

The long/short direction of the pool

to

Y

address

The address to receive the asset

deadline

Y

uint256

The time limit

Output parameters

Name
Type
Description

amtToken0

uint256

The amount of the underlying asset to be acquired

amtU

uint256

The number of base currency acquired

Query the details of a liquidity pool

Query the market data of a pool

IFolloUnderlying(underlying).getReserves()

function getReserves() external view returns (
        uint256 _fundSoldValueEn, 
        uint256 _fundAvaiValueEn, 
        uint256 _fundSoldQTY, 
        uint256 _fundAvaiQTY, 
        uint256 _nvEn, 
        uint256 _presLeverEn, 
        uint256 _underlyingQTY, 
        uint256 _priceEn, 
        uint256 _underlyingValueEn, 
        uint256 _capPoolU, 
        uint256 _usrMarginU,
        uint256 _feeU,
        uint256 _capU,
        uint256 _usrPoolQ
        );

Output parameters

Parameters ending in "En" indicate that the data has been moved 112 bits to the left and needs to be shifted 112 bits to the right to restore to the original value.

Name
Type
Description

_fundSoldValueEn

uint256

Position of leveraged tokens sold, moved 112 to the left, decimal is 18

_fundAvaiValueEn

uint256

Position of unsold leveraged tokens, moved 112 to the left, decimal is 18

_fundSoldQTY

uint256

Number of Leveraged Tokens Sold, DECIMAL IS 18

_fundAvaiQTY

uint256

Number of Unsold Leveraged Tokens, Decimal is 18

_nvEn

uint256

Net value

_presLeverEn

uint256

The latest real leverage multiples

_underlyingQTY

uint256

The amount of the underlying asset

_priceEn

uint256

Latest price

_underlyingValueEn

uint256

The value of the underlying asset

_capPoolU

uint256

The value of the current margin liability pool when the price changes

_usrMarginU

uint256

Trader's margin

_feeU

uint256

fee in total

_capU

uint256

The value transferred to the pool when a user liquidated a position at a loss

_usrPoolQ

uint256

The value owed to investors in liquidity as prices change

PreviousImplementationNextWallet Setup

Last updated 3 years ago